]> git.baikalelectronics.ru Git - kernel.git/commit
seccomp: rework define for SECCOMP_USER_NOTIF_FLAG_CONTINUE
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 24 Oct 2019 21:25:39 +0000 (23:25 +0200)
committerKees Cook <keescook@chromium.org>
Mon, 28 Oct 2019 19:29:46 +0000 (12:29 -0700)
commitf81fd06eca776210089d252383fce982a42b1115
tree955198c930f1c6e6592b0a1933e034a412ae59ae
parent3bfa9e72464c5221fd01f61a5599139c46c4ba5d
seccomp: rework define for SECCOMP_USER_NOTIF_FLAG_CONTINUE

Switch from BIT(0) to (1UL << 0).
First, there are already two different forms used in the header, so there's
no need to add a third. Second, the BIT() macros is kernel internal and
afaict not actually exposed to userspace. Maybe there's some magic there
I'm missing but it definitely causes issues when compiling a program that
tries to use SECCOMP_USER_NOTIF_FLAG_CONTINUE. It currently fails in the
following way:

# github.com/lxc/lxd/lxd
/usr/bin/ld: $WORK/b001/_x003.o: in function
`__do_user_notification_continue':
lxd/main_checkfeature.go:240: undefined reference to `BIT'
collect2: error: ld returned 1 exit status

Switching to (1UL << 0) should prevent that and is more in line what is
already done in the rest of the header.

Cc: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20191024212539.4059-1-christian.brauner@ubuntu.com
Signed-off-by: Kees Cook <keescook@chromium.org>
include/uapi/linux/seccomp.h