All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vernet <void@manifault.com>
To: Tejun Heo <tj@kernel.org>
Cc: bpf@vger.kernel.org, Martin KaFai Lau <martin.lau@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	kernel-team@meta.com, sched-ext@meta.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-6.13 1/2] sched_ext: Rename CFI stubs to names that are recognized by BPF
Date: Thu, 24 Oct 2024 10:28:49 -0500	[thread overview]
Message-ID: <20241024152849.GA140253@maniforge> (raw)
In-Reply-To: <Zxma0Vt6kwWFe1hx@slm.duckdns.org>

[-- Attachment #1: Type: text/plain, Size: 2543 bytes --]

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@kernel.org>

For both patches:

Acked-by: David Vernet <void@manifault.com>

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2024-10-24 15:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24  0:54 [PATCH sched_ext/for-6.13 1/2] sched_ext: Rename CFI stubs to names that are recognized by BPF Tejun Heo
2024-10-24  0:55 ` [PATCH sched_ext/for-6.13 2/2] sched_ext: Replace set_arg_maybe_null() with __nullable CFI stub tags Tejun Heo
2024-10-24  1:04   ` Alexei Starovoitov
2024-10-24 16:19   ` Martin KaFai Lau
2024-10-24 15:28 ` David Vernet [this message]
2024-10-24 16:19 ` [PATCH sched_ext/for-6.13 1/2] sched_ext: Rename CFI stubs to names that are recognized by BPF Martin KaFai Lau
2024-10-24 16:59 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241024152849.GA140253@maniforge \
    --to=void@manifault.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=sched-ext@meta.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.