Skip to content

Commit

Permalink
tgt_null: don't allow un-privileged mode for null target
Browse files Browse the repository at this point in the history
Signed-off-by: Ming Lei <[email protected]>
  • Loading branch information
ming1 committed Nov 17, 2024
1 parent 1f486cd commit f7a6f87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tgt_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ static int null_init_tgt(struct ublksrv_dev *dev, int type, int argc,
if (type != UBLKSRV_TGT_TYPE_NULL)
return -1;

if (info->flags & UBLK_F_UNPRIVILEGED_DEV)
return -1;

tgt_json.dev_size = tgt->dev_size = dev_size;
tgt->tgt_ring_depth = info->queue_depth;
tgt->nr_fds = 0;
Expand Down

0 comments on commit f7a6f87

Please sign in to comment.