Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
bcd514d3
Commit
bcd514d3
authored
Jun 11, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix two bugs in ACL compile code.
Fixes #1312 See Also: CVE-2013-4090
parent
0acece74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
r01312.vtc
bin/varnishtest/tests/r01312.vtc
+28
-0
vcc_acl.c
lib/libvcl/vcc_acl.c
+2
-2
No files found.
bin/varnishtest/tests/r01312.vtc
0 → 100644
View file @
bcd514d3
varnishtest "acl miscompile"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
acl foo {
"127.0.0.2";
"127.0.1"/19;
}
acl bar {
"127.0.1.2";
"127.0.1"/19;
}
sub vcl_deliver {
set resp.http.ACLfoo = client.ip ~ foo;
set resp.http.ACLbar = client.ip ~ bar;
}
} -start
client c1 {
txreq
rxresp
expect resp.http.aclfoo == true
expect resp.http.aclbar == true
} -run
lib/libvcl/vcc_acl.c
View file @
bcd514d3
...
...
@@ -381,7 +381,7 @@ vcc_acl_emit(const struct vcc *tl, const char *acln, int anon)
VTAILQ_FOREACH
(
ae
,
&
tl
->
acl
,
list
)
{
/* Find how much common prefix we have */
for
(
l
=
0
;
l
<=
depth
&&
l
*
8
<
ae
->
mask
;
l
++
)
{
for
(
l
=
0
;
l
<=
depth
&&
l
*
8
<
ae
->
mask
-
7
;
l
++
)
{
assert
(
l
>=
0
);
if
(
ae
->
data
[
l
]
!=
at
[
l
])
break
;
...
...
@@ -392,11 +392,11 @@ vcc_acl_emit(const struct vcc *tl, const char *acln, int anon)
while
(
l
<=
depth
)
{
Fh
(
tl
,
0
,
"
\t
%*s}
\n
"
,
-
depth
,
""
);
depth
--
;
oc
=
"else "
;
}
m
=
ae
->
mask
;
m
-=
l
*
8
;
assert
(
m
>=
0
);
/* Do whole byte compares */
for
(
i
=
l
;
m
>=
8
;
m
-=
8
,
i
++
)
{
...
...
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