History

Merge tag 'io_uring-5.5-2020-01-22' of git://git.kernel.dk/linux-block

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

Linus Torvalds committed 6 years ago

Commit dbab40b2 parents d96d875 1292e972 files · +5 −2Browse files

Unified · Split

2 files
  1. fs/io_uring.c +3 −1
  2. include/uapi/linux/io_uring.h +2 −1
fs/io_uring.c+3−1
@@ -4463,13 +4463,15 @@ static int io_sqe_files_update(struct io_ring_ctx *ctx, void __user *arg, · 4462 unmodified lines
4463 return -EINVAL;4463 return -EINVAL;
4464 if (copy_from_user(&up, arg, sizeof(up)))4464 if (copy_from_user(&up, arg, sizeof(up)))
4465 return -EFAULT;4465 return -EFAULT;
4466 if (up.resv)
4467 return -EINVAL;
4466 if (check_add_overflow(up.offset, nr_args, &done))4468 if (check_add_overflow(up.offset, nr_args, &done))
4467 return -EOVERFLOW;4469 return -EOVERFLOW;
4468 if (done > ctx->nr_user_files)4470 if (done > ctx->nr_user_files)
4469 return -EINVAL;4471 return -EINVAL;
4470 4472
4471 done = 0;4473 done = 0;
4472 fds = (__s32 __user *) up.fds;4474 fds = u64_to_user_ptr(up.fds);
4473 while (nr_args) {4475 while (nr_args) {
4474 struct fixed_file_table *table;4476 struct fixed_file_table *table;
4475 unsigned index;4477 unsigned index;
include/uapi/linux/io_uring.h+2−1
@@ -178,7 +178,8 @@ struct io_uring_params { · 177 unmodified lines
178 178
179struct io_uring_files_update {179struct io_uring_files_update {
180 __u32 offset;180 __u32 offset;
181 __s32 *fds;181 __u32 resv;
182 __aligned_u64 /* __s32 * */ fds;
182};183};
183 184
184#endif185#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t