public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Feng Yang <yangfeng59949@163.com>
To: olsajiri@gmail.com
Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org,
	daniel@iogearbox.net, eddyz87@gmail.com,
	john.fastabend@gmail.com, kpsingh@kernel.org,
	linux-kernel@vger.kernel.org, martin.lau@linux.dev,
	mattbobrowski@google.com, memxor@gmail.com, song@kernel.org,
	yangfeng59949@163.com, yonghong.song@linux.dev
Subject: Re: [PATCH bpf] bpf: Fix Null-Pointer Dereference in kernel_clone() via BPF fmod_ret on security_task_alloc
Date: Thu,  9 Apr 2026 18:24:18 +0800	[thread overview]
Message-ID: <20260409102418.258397-1-yangfeng59949@163.com> (raw)
In-Reply-To: <adZBzjB8bcX344LY@krava>

On Wed, 8 Apr 2026 13:53:50 +0200 Jiri Olsa wrote:

[...]

> > +void bpf_security_get_retval_range(const struct bpf_prog *prog,
> > +				   struct bpf_retval_range *retval_range)
> > +{
> > +	if (btf_id_set_contains(&bool_security_hooks, prog->aux->attach_btf_id)) {
> > +		retval_range->minval = 0;
> > +		retval_range->maxval = 1;
> > +	} else {
> > +		retval_range->minval = -MAX_ERRNO;
> > +		retval_range->maxval = 0;
> > +	}
> > +}
> 
> ai has a point that fmod_ret can attach to other than security functions 
> 
> https://sashiko.dev/#/patchset/20260408094816.228322-1-yangfeng59949%40163.com
> 
> most of them seem to return errno (ERRNO), but there's also few with
> 'TRUE' and one with 'NULL' ..  we could check if the function is on
> the injection list and check the return value accordingly?
> 
> jirka

Oh right, I missed that. I'm also setting the correct return values for the error injection cases and will submit after testing.


  reply	other threads:[~2026-04-09 10:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08  9:48 [PATCH bpf] bpf: Fix Null-Pointer Dereference in kernel_clone() via BPF fmod_ret on security_task_alloc Feng Yang
2026-04-08 11:53 ` Jiri Olsa
2026-04-09 10:24   ` Feng Yang [this message]
2026-04-08 12:16 ` Jiayuan Chen
2026-04-09 10:25   ` Feng Yang

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=20260409102418.258397-1-yangfeng59949@163.com \
    --to=yangfeng59949@163.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mattbobrowski@google.com \
    --cc=memxor@gmail.com \
    --cc=olsajiri@gmail.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox