| Message ID | 20260921032117.90254-2-zixing.liu@canonical.com |
|---|---|
| State | New |
| Headers | show |
| Series | Ubuntu: SAUCE: ioprio: do not mask ioprio value before checking | expand |
diff --git a/block/ioprio.c b/block/ioprio.c index 73301a261429..529db39fede4 100644 --- a/block/ioprio.c +++ b/block/ioprio.c @@ -33,7 +33,7 @@ int ioprio_check_cap(int ioprio) { int class = IOPRIO_PRIO_CLASS(ioprio); - int level = IOPRIO_PRIO_LEVEL(ioprio); + int level = IOPRIO_PRIO_DATA(ioprio); switch (class) { case IOPRIO_CLASS_RT: @@ -49,7 +49,7 @@ int ioprio_check_cap(int ioprio) fallthrough; /* rt has prio field too */ case IOPRIO_CLASS_BE: - if (level >= IOPRIO_NR_LEVELS) + if (level >= IOPRIO_NR_LEVELS || level < 0) return -EINVAL; break; case IOPRIO_CLASS_IDLE:
BugLink: https://bugs.launchpad.net/bugs/2031382 On Ubuntu Jammy, since we are using linux-klibc-dev package from 5.15 kernel the new ioprio level checking logic resided in the 6.8 linux-klibc-dev headers will not be triggered. This commit partially reverts eca2040972b411ec27483bf75dc8b84e730e88ff. Signed-off-by: Zixing Liu <zixing.liu@canonical.com> --- block/ioprio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)