Pull io_uring fix from Jens Axboe: "This was supposed to have gone in last week, but due to a brain fart on my part, I forgot that we made this struct addition in the 5.5 cycle. So here it is for 5.5, to prevent having a 32 vs 64-bit compatability issue with the files_update command" * tag 'io_uring-5.5-2020-01-22' of git://git.kernel.dk/linux-block: io_uring: fix compat for IORING_REGISTER_FILES_UPDATE
Unified · Split
| @@ -4463,13 +4463,15 @@ static int io_sqe_files_update(struct io_ring_ctx *ctx, void __user *arg, · 4462 unmodified lines | ||
| 4463 | 4463 | return -EINVAL; |
| 4464 | 4464 | if (copy_from_user(&up, arg, sizeof(up))) |
| 4465 | 4465 | return -EFAULT; |
| 4466 | + if (up.resv) | |
| 4467 | + return -EINVAL; | |
| 4466 | 4468 | if (check_add_overflow(up.offset, nr_args, &done)) |
| 4467 | 4469 | return -EOVERFLOW; |
| 4468 | 4470 | if (done > ctx->nr_user_files) |
| 4469 | 4471 | return -EINVAL; |
| 4470 | 4472 | |
| 4471 | 4473 | done = 0; |
| 4472 | − fds = (__s32 __user *) up.fds; | |
| 4474 | + fds = u64_to_user_ptr(up.fds); | |
| 4473 | 4475 | while (nr_args) { |
| 4474 | 4476 | struct fixed_file_table *table; |
| 4475 | 4477 | unsigned index; |
| @@ -178,7 +178,8 @@ struct io_uring_params { · 177 unmodified lines | ||
| 178 | 178 | |
| 179 | 179 | struct io_uring_files_update { |
| 180 | 180 | __u32 offset; |
| 181 | − __s32 *fds; | |
| 181 | + __u32 resv; | |
| 182 | + __aligned_u64 /* __s32 * */ fds; | |
| 182 | 183 | }; |
| 183 | 184 | |
| 184 | 185 | #endif |