[SRU][J:linux-*-6.8 1/1] Ubuntu: SAUCE: ioprio: do not mask ioprio value before checking

Zixing Liu zixing.liu at canonical.com
Mon Sep 21 03:21:17 UTC 2026


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 at canonical.com>
---
 block/ioprio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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:
-- 
2.53.0




More information about the kernel-team mailing list