Skip to contentSkip to conversation

ublk: add missing DEL_DEV_ASYNC to unprivileged permission check

PATCH Applied Yitang Yang 3 participants 3 messages Sep 1 – Nov 4

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ublk: add missing DEL_DEV_ASYNC to unprivileged permission check

ublk_ctrl_uring_cmd_permission() is missing the UBLK_CMD_DEL_DEV_ASYNC case, causing the command to always return -EINVAL for unprivileged ublk devices. Fix it by adding the missing case.

Fixes 13fe8e6825e4 ("ublk: add UBLK_CMD_DEL_DEV_ASYNC")
---
 drivers/block/ublk_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/ublk_drv.c +1 -0
index 6c5bec7da97c..ade5d7fddd9d 100644
@@ -5716,6 +5716,7 @@ static int ublk_ctrl_uring_cmd_permission(struct ublk_device *ub,
 	case UBLK_CMD_STOP_DEV:
 	case UBLK_CMD_ADD_DEV:
 	case UBLK_CMD_DEL_DEV:
+	case UBLK_CMD_DEL_DEV_ASYNC:
 	case UBLK_CMD_SET_PARAMS:
 	case UBLK_CMD_START_USER_RECOVERY:
 	case UBLK_CMD_END_USER_RECOVERY:
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Yitang Yang

ublk_ctrl_uring_cmd_permission() is missing the UBLK_CMD_DEL_DEV_ASYNC case, causing the command to always return -EINVAL for unprivileged ublk devices. Fix it by adding the missing case.

Fixes 13fe8e6825e4 ("ublk: add UBLK_CMD_DEL_DEV_ASYNC")
---
 drivers/block/ublk_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/ublk_drv.c +0 -0
index 6c5bec7da97c..ade5d7fddd9d 100644

drivers/block/ublk_drv.c static int ublk_ctrl_uring_cmd_permission(struct ublk_device *ub, · line 5722

Quoted 7 lines
drivers/block/ublk_drv.c +1 -0
@@ -5716,6 +5716,7 @@ static int ublk_ctrl_uring_cmd_permission(struct ublk_device *ub,
        case UBLK_CMD_STOP_DEV:
        case UBLK_CMD_ADD_DEV:
        case UBLK_CMD_DEL_DEV:
+       case UBLK_CMD_DEL_DEV_ASYNC:
        case UBLK_CMD_SET_PARAMS:
        case UBLK_CMD_START_USER_RECOVERY:
        case UBLK_CMD_END_USER_RECOVERY:

Thanks,
Ming Lei

maintainer Applied
#2 lore raw
In reply to Yitang Yang
Quoted 3 lines · Yitang Yang

ublk_ctrl_uring_cmd_permission() is missing the UBLK_CMD_DEL_DEV_ASYNC case, causing the command to always return -EINVAL for unprivileged ublk devices. Fix it by adding the missing case.

Applied, thanks!

[1/1] ublk: add missing DEL_DEV_ASYNC to unprivileged permission check

      commit: e6ac1da6a53c5f670bf09e60a2500d15be68d2fc

Best regards,

Signature · 1 line
Jens Axboe