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
44634463 return -EINVAL;
44644464 if (copy_from_user(&up, arg, sizeof(up)))
44654465 return -EFAULT;
4466+ if (up.resv)
4467+ return -EINVAL;
44664468 if (check_add_overflow(up.offset, nr_args, &done))
44674469 return -EOVERFLOW;
44684470 if (done > ctx->nr_user_files)
44694471 return -EINVAL;
44704472
44714473 done = 0;
4472− fds = (__s32 __user *) up.fds;
4474+ fds = u64_to_user_ptr(up.fds);
44734475 while (nr_args) {
44744476 struct fixed_file_table *table;
44754477 unsigned index;
include/uapi/linux/io_uring.h+2−1
@@ -178,7 +178,8 @@ struct io_uring_params { · 177 unmodified lines
178178
179179 struct io_uring_files_update {
180180 __u32 offset;
181− __s32 *fds;
181+ __u32 resv;
182+ __aligned_u64 /* __s32 * */ fds;
182183 };
183184
184185 #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