[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241024152849.GA140253@maniforge>
Date: Thu, 24 Oct 2024 10:28:49 -0500
From: David Vernet <void@...ifault.com>
To: Tejun Heo <tj@...nel.org>
Cc: bpf@...r.kernel.org, Martin KaFai Lau <martin.lau@...nel.org>,
Alexei Starovoitov <ast@...nel.org>, kernel-team@...a.com,
sched-ext@...a.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH sched_ext/for-6.13 1/2] sched_ext: Rename CFI stubs to
names that are recognized by BPF
On Wed, Oct 23, 2024 at 02:54:41PM -1000, Tejun Heo wrote:
> CFI stubs can be used to tag arguments with __nullable (and possibly other
> tags in the future) but for that to work the CFI stubs must have names that
> are recognized by BPF. Rename them.
>
> Signed-off-by: Tejun Heo <tj@...nel.org>
For both patches:
Acked-by: David Vernet <void@...ifault.com>
Here's the selftest output for posterity / FYI:
[root@...tme-ng sched_ext]# ./runner -t maybe_null
===== START =====
TEST: maybe_null
DESCRIPTION: Verify if PTR_MAYBE_NULL work for .dispatch
OUTPUT:
libbpf: prog 'maybe_null_fail_dispatch': BPF program load failed: Permission denied
libbpf: prog 'maybe_null_fail_dispatch': -- BEGIN PROG LOAD LOG --
Global function maybe_null_fail_dispatch() doesn't return scalar. Only those are supported.
0: R1=ctx() R10=fp0
; void BPF_STRUCT_OPS(maybe_null_fail_dispatch, s32 cpu, struct task_struct *p) @ maybe_null_fail_dsp.bpf.c:15
0: (79) r1 = *(u64 *)(r1 +8) ; R1_w=trusted_ptr_or_null_task_struct(id=1)
; vtime_test = p->scx.dsq_vtime; @ maybe_null_fail_dsp.bpf.c:17
1: (79) r1 = *(u64 *)(r1 +848)
R1 invalid mem access 'trusted_ptr_or_null_'
processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
-- END PROG LOAD LOG --
libbpf: prog 'maybe_null_fail_dispatch': failed to load: -13
libbpf: failed to load object 'maybe_null_fail_dsp'
libbpf: failed to load BPF skeleton 'maybe_null_fail_dsp': -13
libbpf: prog 'maybe_null_fail_yield': BPF program load failed: Permission denied
libbpf: prog 'maybe_null_fail_yield': -- BEGIN PROG LOAD LOG --
0: R1=ctx() R10=fp0
; bool BPF_STRUCT_OPS(maybe_null_fail_yield, struct task_struct *from, @ maybe_null_fail_yld.bpf.c:15
0: (b7) r2 = 2328 ; R2_w=2328
1: (79) r1 = *(u64 *)(r1 +8) ; R1_w=trusted_ptr_or_null_task_struct(id=1)
2: (bf) r3 = r1 ; R1_w=trusted_ptr_or_null_task_struct(id=1) R3_w=trusted_ptr_or_null_task_struct(id=1)
3: (0f) r3 += r2
R3 pointer arithmetic on trusted_ptr_or_null_ prohibited, null-check it first
processed 4 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
-- END PROG LOAD LOG --
libbpf: prog 'maybe_null_fail_yield': failed to load: -13
libbpf: failed to load object 'maybe_null_fail_yld'
libbpf: failed to load BPF skeleton 'maybe_null_fail_yld': -13
ok 1 maybe_null #
===== END =====
=============================
RESULTS:
PASSED: 1
SKIPPED: 0
FAILED: 0
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists