]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring/io-wq: protect against sprintf overflow
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 1 Apr 2021 08:55:04 +0000 (09:55 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 1 Apr 2021 15:21:18 +0000 (09:21 -0600)
commit7e31a87f966ff1db1be5db8387ab19df3a81cb10
treeb215f2544b7f3c95374a7a1ebaa85262296d05e5
parentddcf0c7b38306a7c70e23b0597caf0f75c9ccc72
io_uring/io-wq: protect against sprintf overflow

task_pid may be large enough to not fit into the left space of
TASK_COMM_LEN-sized buffers and overflow in sprintf. We not so care
about uniqueness, so replace it with safer snprintf().

Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/1702c6145d7e1c46fbc382f28334c02e1a3d3994.1617267273.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
fs/io_uring.c