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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250811212150.85759-4-christian.loehle@arm.com>
Date: Mon, 11 Aug 2025 22:21:50 +0100
From: Christian Loehle <christian.loehle@....com>
To: tj@...nel.org,
	arighi@...dia.com,
	void@...ifault.com
Cc: linux-kernel@...r.kernel.org,
	sched-ext@...ts.linux.dev,
	changwoo@...lia.com,
	hodgesd@...a.com,
	mingo@...hat.com,
	peterz@...radead.org,
	jake@...lion.co.uk,
	Christian Loehle <christian.loehle@....com>
Subject: [PATCH v4 3/3] sched_ext: deprecation warn for scx_bpf_cpu_rq()

scx_bpf_cpu_rq() works on an unlocked rq which generally isn't safe.
For the common use-cases scx_bpf_cpu_rq_locked() and
scx_bpf_task_acquire_remote_curr() work, so add a deprecation warning
to scx_bpf_cpu_rq() so it can eventually be removed.

Signed-off-by: Christian Loehle <christian.loehle@....com>
---
 kernel/sched/ext.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index ded4ace36090..7d2d88e8dd59 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -7423,6 +7423,9 @@ __bpf_kfunc struct rq *scx_bpf_cpu_rq(s32 cpu)
 	if (!kf_cpu_valid(cpu, NULL))
 		return NULL;
 
+	pr_warn_once("%s() is deprecated in favor of scx_bpf_cpu_rq_locked() or "
+		     "scx_bpf_task_acquire_remote_curr() for unlocked remote curr\n",
+		     __func__);
 	return cpu_rq(cpu);
 }
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ