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: IORING_OP_F[GS]ETXATTR is fine with REQ_F_FIXED_FILE

Rejection of IOSQE_FIXED_FILE combined with IORING_OP_[GS]ETXATTR
is fine - these do not take a file descriptor, so such combination
makes no sense. The checks are misplaced, though - as it is, they
triggers on IORING_OP_F[GS]ETXATTR as well, and those do take
a file reference, no matter the origin.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Jens Axboe and committed by
Al Viro
dc7e76ba e896474f

+6 -6
+6 -6
io_uring/xattr.c
··· 48 48 const char __user *name; 49 49 int ret; 50 50 51 - if (unlikely(req->flags & REQ_F_FIXED_FILE)) 52 - return -EBADF; 53 - 54 51 ix->filename = NULL; 55 52 ix->ctx.kvalue = NULL; 56 53 name = u64_to_user_ptr(READ_ONCE(sqe->addr)); ··· 86 89 struct io_xattr *ix = io_kiocb_to_cmd(req, struct io_xattr); 87 90 const char __user *path; 88 91 int ret; 92 + 93 + if (unlikely(req->flags & REQ_F_FIXED_FILE)) 94 + return -EBADF; 89 95 90 96 ret = __io_getxattr_prep(req, sqe); 91 97 if (ret) ··· 152 152 const char __user *name; 153 153 int ret; 154 154 155 - if (unlikely(req->flags & REQ_F_FIXED_FILE)) 156 - return -EBADF; 157 - 158 155 ix->filename = NULL; 159 156 name = u64_to_user_ptr(READ_ONCE(sqe->addr)); 160 157 ix->ctx.cvalue = u64_to_user_ptr(READ_ONCE(sqe->addr2)); ··· 179 182 struct io_xattr *ix = io_kiocb_to_cmd(req, struct io_xattr); 180 183 const char __user *path; 181 184 int ret; 185 + 186 + if (unlikely(req->flags & REQ_F_FIXED_FILE)) 187 + return -EBADF; 182 188 183 189 ret = __io_setxattr_prep(req, sqe); 184 190 if (ret)