Skip to content

Commit

Permalink
io_uring: fix mis-seting personality's creds
Browse files Browse the repository at this point in the history
After io_identity_cow() copies an work.identity it wants to copy creds
to the new just allocated id, not the old one. Otherwise it's
akin to req->work.identity->creds = req->work.identity->creds.

Signed-off-by: Pavel Begunkov <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
isilence authored and axboe committed Dec 7, 2020
1 parent 2d280bc commit e8c954d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ static bool io_identity_cow(struct io_kiocb *req)
*/
io_init_identity(id);
if (creds)
req->work.identity->creds = creds;
id->creds = creds;

/* add one for this request */
refcount_inc(&id->count);
Expand Down

0 comments on commit e8c954d

Please sign in to comment.