Files
android_kernel_xiaomi_sm8450/include/uapi/linux
Tycho Andersen 51891498f2 seccomp: allow TSYNC and USER_NOTIF together
The restriction introduced in 7a0df7fbc1 ("seccomp: Make NEW_LISTENER and
TSYNC flags exclusive") is mostly artificial: there is enough information
in a seccomp user notification to tell which thread triggered a
notification. The reason it was introduced is because TSYNC makes the
syscall return a thread-id on failure, and NEW_LISTENER returns an fd, and
there's no way to distinguish between these two cases (well, I suppose the
caller could check all fds it has, then do the syscall, and if the return
value was an fd that already existed, then it must be a thread id, but
bleh).

Matthew would like to use these two flags together in the Chrome sandbox
which wants to use TSYNC for video drivers and NEW_LISTENER to proxy
syscalls.

So, let's fix this ugliness by adding another flag, TSYNC_ESRCH, which
tells the kernel to just return -ESRCH on a TSYNC error. This way,
NEW_LISTENER (and any subsequent seccomp() commands that want to return
positive values) don't conflict with each other.

Suggested-by: Matthew Denton <mpdenton@google.com>
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Link: https://lore.kernel.org/r/20200304180517.23867-1-tycho@tycho.ws
Signed-off-by: Kees Cook <keescook@chromium.org>
2020-03-04 14:48:54 -08:00
..
2019-01-28 08:13:52 +01:00
2019-12-18 18:07:31 +01:00
2019-03-07 18:32:01 -08:00
2020-01-22 16:30:10 -08:00
2019-10-09 22:31:14 -04:00
2019-09-25 17:51:39 -07:00
2019-08-02 14:44:02 +10:00
2019-09-16 10:18:01 -04:00
2019-06-14 15:00:51 +05:30
2018-12-20 19:13:07 +01:00
2020-01-18 09:19:18 -05:00
2019-03-27 13:30:07 -07:00
2018-06-18 15:11:53 +10:00
2019-08-12 19:33:50 -07:00
2019-12-11 15:31:52 +01:00
2018-09-05 22:27:11 -07:00
2020-01-09 18:41:41 -08:00
2019-09-08 15:37:04 +02:00
2018-07-07 17:41:38 +02:00
2020-01-31 12:50:04 +01:00
2018-08-03 10:03:57 -07:00
2017-11-28 16:54:00 +01:00
2020-02-07 14:39:38 +09:00
2019-08-19 13:04:45 -07:00
2018-12-16 12:15:25 -08:00
2018-12-01 12:38:32 +01:00
2019-05-28 21:37:30 -07:00
2018-01-14 23:06:30 -05:00
2018-01-16 16:47:29 +01:00
2020-01-18 09:19:18 -05:00
2019-10-02 20:32:27 -06:00
2019-01-22 10:21:45 +01:00
2019-07-30 20:34:34 +02:00
2018-03-20 03:17:41 +02:00
2019-12-18 10:37:18 +01:00
2020-01-14 12:20:48 +01:00
2017-11-16 10:49:00 +09:00
2020-01-26 15:28:47 +01:00
2019-11-13 12:15:34 -08:00
2019-12-18 18:07:31 +01:00
2020-01-26 15:28:47 +01:00
2020-01-04 13:49:51 +08:00
2018-09-03 13:29:38 +02:00
2019-12-09 09:59:07 +01:00
2018-02-06 18:32:44 -08:00
2019-09-18 20:17:50 +02:00
2019-08-01 21:49:46 +02:00