Re: [PATCH sched_ext/for-6.13 1/2] sched_ext: Rename CFI stubs to names that are recognized by BPF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

For both patches:

Acked-by: David Vernet <void@xxxxxxxxxxxxx>

Here's the selftest output for posterity / FYI:

[root@virtme-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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux