Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/sync: validate passed in offset

Check if the passed in offset is negative once cast to sync->off. This
ensures that -EINVAL is returned for that case, like it would be for
sync_file_range(2).

Fixes: c992fe2925d7 ("io_uring: add fsync support")
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+2
+2
io_uring/sync.c
··· 62 62 return -EINVAL; 63 63 64 64 sync->off = READ_ONCE(sqe->off); 65 + if (sync->off < 0) 66 + return -EINVAL; 65 67 sync->len = READ_ONCE(sqe->len); 66 68 req->flags |= REQ_F_FORCE_ASYNC; 67 69 return 0;