]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/seccomp: More closely track fds being assigned
authorKees Cook <keescook@chromium.org>
Thu, 27 May 2021 02:49:15 +0000 (19:49 -0700)
committerKees Cook <keescook@chromium.org>
Mon, 28 Jun 2021 19:49:52 +0000 (12:49 -0700)
commitbc8f585f7f5bb330fb3282bbf61fb168428b4f43
tree1086da6f073144cf3ba6ad02e7b84332b7260508
parent4f85ae07020ce3ce28c861b9aa80f7455ec32252
selftests/seccomp: More closely track fds being assigned

Since the open fds might not always start at "4" (especially when
running under kselftest, etc), start counting from the first assigned
fd, rather than using the more permissive EXPECT_GE(fd, 0).

Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/lkml/20210527032948.3730953-1-keescook@chromium.org
Reviewed-by: Rodrigo Campos <rodrigo@kinvolk.io>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
tools/testing/selftests/seccomp/seccomp_bpf.c