Re: [PATCH v2 3/3] btrfs: don't read from userspace twice in btrfs_uring_encoded_read()

Jens Axboe
2024-12-13T20:17:37Z

On 12/13/24 11:44 AM, Mark Harmstone wrote:
> If we return -EAGAIN the first time because we need to block,
> btrfs_uring_encoded_read() will get called twice. Take a copy of args
> the first time, to prevent userspace from messing around with it.

Looks good to me, however I think you'd want to add:

Reported-by: Jens Axboe <axboe@kernel.dk>
Fixes: 34310c442e17 ("btrfs: add io_uring command for encoded reads (ENCODED_READ ioctl)")

to the tags, but probably whoever applies this can do that.

--
Jens Axboe