]> www.infradead.org Git - users/hch/misc.git/commit
ublk: don't allow user copy for unprivileged device
authorMing Lei <ming.lei@redhat.com>
Wed, 16 Oct 2024 13:48:47 +0000 (21:48 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Oct 2024 14:08:18 +0000 (08:08 -0600)
commit42aafd8b48adac1c3b20fe5892b1b91b80c1a1e6
treeb34db3afc3a7f0315d0afb18a0430ea85f7a8239
parente972b08b91ef48488bae9789f03cfedb148667fb
ublk: don't allow user copy for unprivileged device

UBLK_F_USER_COPY requires userspace to call write() on ublk char
device for filling request buffer, and unprivileged device can't
be trusted.

So don't allow user copy for unprivileged device.

Cc: stable@vger.kernel.org
Fixes: 1172d5b8beca ("ublk: support user copy")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241016134847.2911721-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c
include/uapi/linux/ublk_cmd.h