lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250429082934.GA3896701@bytedance>
Date: Tue, 29 Apr 2025 16:29:34 +0800
From: Aaron Lu <ziqianlu@...edance.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: Damien Le Moal <dlemoal@...nel.org>, Kexin Wei <ys.weikexin@....com>,
	linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] block: remove test of io priority level

Ever since commit eca2040972b4("scsi: block: ioprio: Clean up interface
definition"), the io priority level is masked and can no longer be larger
than IOPRIO_NR_LEVELS so remove this now useless test.

The actual test of io prio level is done in ioprio_value() where any
invalid input of class/level/hint will result in an invalid class being
passed to the syscall, this is introduced in commit 01584c1e2337("scsi: 
block: Improve ioprio value validity checks").

Reported-by: Kexin Wei <ys.weikexin@....com>
Cc: Damien Le Moal <dlemoal@...nel.org>
Signed-off-by: Aaron Lu <ziqianlu@...edance.com>
---
Kexin reported a LTP/ioprio_set03 case failure, where the test would
pass IOPRIO_CLASS_BE with priority level 8 and see if kernel would
return error. Turned out she is using an old kernel header where the
change introduced in commit 01584c1e2337("scsi: block: Improve ioprio
value validity checks") isn't available. During troubleshooting, I find
this priority level test confusing and misleading so I think it should
be removed.

 block/ioprio.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/block/ioprio.c b/block/ioprio.c
index 73301a261429f..60364d3faf800 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -46,11 +46,8 @@ int ioprio_check_cap(int ioprio)
 			 */
 			if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_NICE))
 				return -EPERM;
-			fallthrough;
-			/* rt has prio field too */
+			break;
 		case IOPRIO_CLASS_BE:
-			if (level >= IOPRIO_NR_LEVELS)
-				return -EINVAL;
 			break;
 		case IOPRIO_CLASS_IDLE:
 			break;
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ