mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 09:05:06 -05:00
sys_linux: fix seccomp filter for BINDTODEVICE option
The BINDTODEVICE socket option is the first option in the seccomp filter
setting a string instead of int. Remove the length check from the
setsockopt rules to allow a device name longer than 3 characters.
This was reported in Debian bug #995207.
Fixes: b9f5ce83b0 ("sys_linux: allow BINDTODEVICE option in seccomp filter")
This commit is contained in:
@@ -739,10 +739,9 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
|
|||||||
|
|
||||||
/* Allow selected socket options */
|
/* Allow selected socket options */
|
||||||
for (i = 0; i < sizeof (socket_options) / sizeof (*socket_options); i++) {
|
for (i = 0; i < sizeof (socket_options) / sizeof (*socket_options); i++) {
|
||||||
if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), 3,
|
if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), 2,
|
||||||
SCMP_A1(SCMP_CMP_EQ, socket_options[i][0]),
|
SCMP_A1(SCMP_CMP_EQ, socket_options[i][0]),
|
||||||
SCMP_A2(SCMP_CMP_EQ, socket_options[i][1]),
|
SCMP_A2(SCMP_CMP_EQ, socket_options[i][1])))
|
||||||
SCMP_A4(SCMP_CMP_LE, sizeof (int))) < 0)
|
|
||||||
goto add_failed;
|
goto add_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user