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: <Z6VIFPucwML5YLSJ@gpd3>
Date: Fri, 7 Feb 2025 00:39:00 +0100
From: Andrea Righi <arighi@...dia.com>
To: Juntong Deng <juntong.deng@...look.com>
Cc: ast@...nel.org, daniel@...earbox.net, john.fastabend@...il.com,
	andrii@...nel.org, martin.lau@...ux.dev, eddyz87@...il.com,
	song@...nel.org, yonghong.song@...ux.dev, kpsingh@...nel.org,
	sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org,
	memxor@...il.com, tj@...nel.org, void@...ifault.com,
	changwoo@...lia.com, bpf@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH bpf-next 2/8] sched_ext: Add filter for
 scx_kfunc_ids_select_cpu

On Wed, Feb 05, 2025 at 07:30:14PM +0000, Juntong Deng wrote:
...
> +static int scx_kfunc_ids_other_rqlocked_filter(const struct bpf_prog *prog, u32 kfunc_id)
> +{
> +	u32 moff = prog->aux->attach_st_ops_member_off;
> +
> +	if (moff == offsetof(struct sched_ext_ops, runnable) ||
> +	    moff == offsetof(struct sched_ext_ops, dequeue) ||
> +	    moff == offsetof(struct sched_ext_ops, stopping) ||
> +	    moff == offsetof(struct sched_ext_ops, quiescent) ||
> +	    moff == offsetof(struct sched_ext_ops, yield) ||
> +	    moff == offsetof(struct sched_ext_ops, cpu_acquire) ||
> +	    moff == offsetof(struct sched_ext_ops, running) ||
> +	    moff == offsetof(struct sched_ext_ops, core_sched_before) ||
> +	    moff == offsetof(struct sched_ext_ops, set_cpumask) ||
> +	    moff == offsetof(struct sched_ext_ops, update_idle) ||
> +	    moff == offsetof(struct sched_ext_ops, tick) ||
> +	    moff == offsetof(struct sched_ext_ops, enable) ||
> +	    moff == offsetof(struct sched_ext_ops, set_weight) ||
> +	    moff == offsetof(struct sched_ext_ops, disable) ||
> +	    moff == offsetof(struct sched_ext_ops, exit_task) ||
> +	    moff == offsetof(struct sched_ext_ops, dump_task) ||
> +	    moff == offsetof(struct sched_ext_ops, dump_cpu))
> +		return 0;
> +
> +	return -EACCES;

Actually, do we need this filter at all?

I think the other filters in your patch set should be sufficient to
establish the correct permissions for all kfuncs, as none of them need to
be called from any rq-locked operations. Or am I missing something?

-Andrea

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ