Commit 1292e97
io_uring: fix compat for IORING_REGISTER_FILES_UPDATE
fds field of struct io_uring_files_update is problematic with regards
to compat user space, as pointer size is different in 32-bit, 32-on-64-bit,
and 64-bit user space. In order to avoid custom handling of compat in
the syscall implementation, make fds __u64 and use u64_to_user_ptr in
order to retrieve it. Also, align the field naturally and check that
no garbage is passed there.
Fixes: c3a31e6 ("io_uring: add support for IORING_REGISTER_FILES_UPDATE")
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 44d2827 commit 1292e97
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4463 | 4463 | | |
4464 | 4464 | | |
4465 | 4465 | | |
| 4466 | + | |
| 4467 | + | |
4466 | 4468 | | |
4467 | 4469 | | |
4468 | 4470 | | |
4469 | 4471 | | |
4470 | 4472 | | |
4471 | 4473 | | |
4472 | | - | |
| 4474 | + | |
4473 | 4475 | | |
4474 | 4476 | | |
4475 | 4477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
0 commit comments