ublk_drv: only allow owner to open unprivileged disk
authorMing Lei <ming.lei@redhat.com>
Tue, 31 Jan 2023 04:04:46 +0000 (12:04 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 31 Jan 2023 14:59:22 +0000 (07:59 -0700)
commit48a9051980242128f844defe44c7e83217f79872
treef8c38cac24798390af10c93311c8102d4e9fc2c4
parent4a6a7bc21d4726c5772e47525e6039852555b391
ublk_drv: only allow owner to open unprivileged disk

Owner of one unprivileged ublk device could be one evil user, which
can grant this disk's privilege to other users deliberately, and
this way could be like making one trap and waiting for other users
to be caught.

So only owner to open unprivileged disk even though the owner
grants disk privilege to other user. This way is reasonable too
given anyone can create ublk disk, and no need other's grant.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Fixes: 4093cb5a0634 ("ublk_drv: add mechanism for supporting unprivileged ublk device")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230131040446.214583-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c