Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
637
Issues
637
List
Boards
Labels
Service Desk
Milestones
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
3146be6f
Commit
3146be6f
authored
Aug 08, 2016
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4430. [bug] Lwresd died if a search list was not defined.
Found by 0x710DDDD At Alibaba Security. [RT #42895]
parent
c1915935
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
8 deletions
+73
-8
CHANGES
CHANGES
+3
-0
bin/named/lwsearch.c
bin/named/lwsearch.c
+0
-1
bin/tests/system/lwresd/clean.sh
bin/tests/system/lwresd/clean.sh
+1
-0
bin/tests/system/lwresd/lwresd1/nosearch.conf
bin/tests/system/lwresd/lwresd1/nosearch.conf
+24
-0
bin/tests/system/lwresd/lwtest.c
bin/tests/system/lwresd/lwtest.c
+26
-7
bin/tests/system/lwresd/tests.sh
bin/tests/system/lwresd/tests.sh
+19
-0
No files found.
CHANGES
View file @
3146be6f
4430. [bug] Lwresd died if a search list was not defined.
Found by 0x710DDDD At Alibaba Security. [RT #42895]
4429. [bug] Address potential use after free on fclose() error.
[RT #42976]
...
...
bin/named/lwsearch.c
View file @
3146be6f
...
...
@@ -155,7 +155,6 @@ ns_lwsearchctx_next(ns_lwsearchctx_t *sctx) {
return
(
ISC_R_NOMORE
);
if
(
sctx
->
searchname
==
NULL
)
{
INSIST
(
!
sctx
->
exactfirst
||
sctx
->
doneexact
);
if
(
sctx
->
exactfirst
||
sctx
->
doneexact
)
return
(
ISC_R_NOMORE
);
sctx
->
doneexact
=
ISC_TRUE
;
...
...
bin/tests/system/lwresd/clean.sh
View file @
3146be6f
...
...
@@ -13,6 +13,7 @@ rm -f */named.memstats
rm
-f
*
/named.run
rm
-f
dig.out
rm
-f
lwresd1/lwresd.run.resolv
rm
-f
lwresd1/lwresd.run.lwresd
rm
-f
ns
*
/named.lock
rm
-f
lwresd
*
/lwresd.lock
rm
-f
lwresd
*
/lwresd.run
bin/tests/system/lwresd/lwresd1/nosearch.conf
0 → 100644
View file @
3146be6f
/*
*
Copyright
(
C
)
2000
,
2001
,
2004
,
2007
,
2016
Internet
Systems
Consortium
,
Inc
. (
"ISC"
)
*
*
This
Source
Code
Form
is
subject
to
the
terms
of
the
Mozilla
Public
*
License
,
v
.
2
.
0
.
If
a
copy
of
the
MPL
was
not
distributed
with
this
*
file
,
You
can
obtain
one
at
http
://
mozilla
.
org
/
MPL
/
2
.
0
/.
*/
/* $
Id
:
lwresd
.
conf
,
v
1
.
8
2007
/
06
/
19
23
:
47
:
04
tbox
Exp
$ */
controls
{ /*
empty
*/ };
options
{
port
5300
;
pid
-
file
"lwresd.pid"
;
forwarders
{
10
.
53
.
0
.
1
;};
forward
only
;
};
lwres
{
listen
-
on
{
10
.
53
.
0
.
1
port
9210
;};
view
"_default"
;
ndots
1
;
};
bin/tests/system/lwresd/lwtest.c
View file @
3146be6f
...
...
@@ -16,6 +16,7 @@
#include <isc/net.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/util.h>
#include <lwres/lwres.h>
#include <lwres/netdb.h>
...
...
@@ -631,12 +632,18 @@ test_getrrsetbyname(const char *name, int rdclass, int rdtype,
}
int
main
(
void
)
{
main
(
int
argc
,
char
**
argv
)
{
lwres_result_t
ret
;
int
nosearch
=
0
;
UNUSED
(
argc
);
lwres_udp_port
=
9210
;
lwres_resolv_conf
=
"resolv.conf"
;
if
(
argv
[
1
]
!=
NULL
&&
strcmp
(
argv
[
1
],
"-nosearch"
)
==
0
)
nosearch
=
1
;
ret
=
lwres_context_create
(
&
ctx
,
NULL
,
NULL
,
NULL
,
0
);
CHECK
(
ret
,
"lwres_context_create"
);
...
...
@@ -655,10 +662,16 @@ main(void) {
LWRES_ADDRTYPE_V4
);
test_gabn
(
"a.example3"
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V4
);
test_gabn
(
"a.example3."
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V4
);
test_gabn
(
"a"
,
LWRES_R_SUCCESS
,
"10.0.1.1"
,
LWRES_ADDRTYPE_V4
);
if
(
nosearch
)
test_gabn
(
"a"
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V4
);
else
test_gabn
(
"a"
,
LWRES_R_SUCCESS
,
"10.0.1.1"
,
LWRES_ADDRTYPE_V4
);
test_gabn
(
"a."
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V4
);
test_gabn
(
"a2"
,
LWRES_R_SUCCESS
,
"10.0.1.1"
,
LWRES_ADDRTYPE_V4
);
if
(
nosearch
)
test_gabn
(
"a2"
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V4
);
else
test_gabn
(
"a2"
,
LWRES_R_SUCCESS
,
"10.0.1.1"
,
LWRES_ADDRTYPE_V4
);
test_gabn
(
"a3"
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V4
);
test_gabn
(
"b.example1"
,
LWRES_R_SUCCESS
,
...
...
@@ -675,9 +688,12 @@ main(void) {
LWRES_ADDRTYPE_V6
);
test_gabn
(
"b.example3"
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V6
);
test_gabn
(
"b.example3."
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V6
);
test_gabn
(
"b"
,
LWRES_R_SUCCESS
,
"eeee:eeee:eeee:eeee:ffff:ffff:ffff:ffff"
,
LWRES_ADDRTYPE_V6
);
if
(
nosearch
)
test_gabn
(
"b"
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V6
);
else
test_gabn
(
"b"
,
LWRES_R_SUCCESS
,
"eeee:eeee:eeee:eeee:ffff:ffff:ffff:ffff"
,
LWRES_ADDRTYPE_V6
);
test_gabn
(
"b."
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V6
);
test_gabn
(
"d.example1"
,
LWRES_R_NOTFOUND
,
NULL
,
LWRES_ADDRTYPE_V6
);
...
...
@@ -752,7 +768,10 @@ main(void) {
test_getnameinfo
(
"1122:3344:5566:7788:99aa:bbcc:ddee:ff00"
,
AF_INET6
,
"dname.example1"
);
test_getrrsetbyname
(
"a"
,
1
,
1
,
1
,
0
,
1
);
if
(
nosearch
)
test_getrrsetbyname
(
"a"
,
1
,
1
,
0
,
0
,
0
);
else
test_getrrsetbyname
(
"a"
,
1
,
1
,
1
,
0
,
1
);
test_getrrsetbyname
(
"a.example1."
,
1
,
1
,
1
,
0
,
1
);
test_getrrsetbyname
(
"e.example1."
,
1
,
1
,
1
,
1
,
1
);
test_getrrsetbyname
(
"e.example1."
,
1
,
255
,
1
,
1
,
0
);
...
...
bin/tests/system/lwresd/tests.sh
View file @
3146be6f
...
...
@@ -61,5 +61,24 @@ if [ $ret != 0 ]; then
fi
status
=
`
expr
$status
+
$ret
`
$PERL
$SYSTEMTESTTOP
/stop.pl
.
lwresd1
mv
lwresd1/lwresd.run lwresd1/lwresd.run.lwresd
$PERL
$SYSTEMTESTTOP
/start.pl
.
lwresd1
--
"-X lwresd.lock -m record,size,mctx -c nosearch.conf -d 99 -g"
echo
"I:using nosearch.conf"
ret
=
0
for
i
in
0 1 2 3 4 5 6 7 8 9
do
grep
' running$'
lwresd1/lwresd.run
>
/dev/null
&&
break
sleep
1
done
./lwtest
-nosearch
||
ret
=
1
if
[
$ret
!=
0
]
;
then
echo
"I:failed"
fi
status
=
`
expr
$status
+
$ret
`
echo
"I:exit status:
$status
"
[
$status
-eq
0
]
||
exit
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment