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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <AM6PR03MB5080B3CF92374D617347BC5299F12@AM6PR03MB5080.eurprd03.prod.outlook.com>
Date: Fri, 7 Feb 2025 00:02:08 +0000
From: Juntong Deng <juntong.deng@...look.com>
To: Andrea Righi <arighi@...dia.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 2025/2/6 23:39, Andrea Righi wrote:
> 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?
> 

Thanks for your reply.

I think I misunderstood SCX_KF_REST.

I incorrectly thought that all but SCX_KF_UNLOCKED belonged to
SCX_KF_REST (including SCX_KF_CPU_RELEASE, SCX_KF_DISPATCH, etc.).

I will remove scx_kfunc_ids_other_rqlocked_filter in the next version.

If you find any other mistakes, please let me know.

> -Andrea


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ