diff options
author | Kees Cook <keescook@chromium.org> | 2024-01-29 10:40:15 -0800 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-02-02 13:11:49 +0100 |
commit | c67ef897fe08effad98f0c7fb9223fa1f771d09e (patch) | |
tree | 2de26914b5532f212d91321f0d46eaba29cdbd26 /certs | |
parent | bd8c239c0502e70c92cf9496846bcbec7cd5702f (diff) |
select: Avoid wrap-around instrumentation in do_sys_poll()
The mix of int, unsigned int, and unsigned long used by struct
poll_list::len, todo, len, and j meant that the signed overflow
sanitizer got worried it needed to instrument several places where
arithmetic happens between these variables. Since all of the variables
are always positive and bounded by unsigned int, use a single type in
all places. Additionally expand the zero-test into an explicit range
check before updating "todo".
This keeps sanitizer instrumentation[1] out of a UACCESS path:
vmlinux.o: warning: objtool: do_sys_poll+0x285: call to __ubsan_handle_sub_overflow() with UACCESS enabled
Link: https://github.com/KSPP/linux/issues/26 [1]
Cc: Christian Brauner <brauner@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jan Kara <jack@suse.cz>
Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20240129184014.work.593-kees@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions