BPF List
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "MahnurA" <s.mahnur.a@gmail.com>, <daniel@iogearbox.net>,
	<andrii@kernel.org>, <eddyz87@gmail.com>, <memxor@gmail.com>,
	<bpf@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<emil@etsalapatis.com>, <ihor.solodrai@linux.dev>,
	<john.fastabend@gmail.com>, <jolsa@kernel.org>,
	<martin.lau@linux.dev>, <sdf@fomichev.me>, <song@kernel.org>,
	<yonghong.song@linux.dev>
Subject: Re: [BUG] KASAN: slab-use-after-free in bpf_skc_to_* via fexit on sk_common_release
Date: Fri, 04 Dec 2026 18:39:44 +0000	[thread overview]
Message-ID: <DNC61UH34HBC.3SM71DFQL7LQJ@gmail.com> (raw)
In-Reply-To: <20261204141902.605584-1-s.mahnur.a@gmail.com>

On Fri, Dec 04, 2026 at 06:19 AM MahnurA <s.mahnur.a@gmail.com> wrote:
> This plugs the hole temporarily. Not sure if this is the right way or
> what could be a better way.

Pls wrap your emails to ~80 char per line.

imo the list is the least bad way.
raw_tp_null_args[], untrusted_lsm_hooks and noreturn_deny are manual
lists too.

> The verifier is correctly rejecting the program, but now the error
> message is not clear enough I think to highlight that this is an
> attachment point issue specifically.

Fair enough. btf_ctx_access() can say why, right after the "has btf_id" line.
This goes on top of the diff. I didn't compile it:

 	bpf_log(log, "func '%s' arg%d has btf_id %d type %s '%s'\n",
 		tname, arg, info->btf_id, btf_type_str(t),
 		__btf_name_by_offset(btf, t->name_off));
+	if (bpf_prog_args_freed(prog))
+		bpf_log(log, "func '%s' can free arg%d, marking it as untrusted\n",
+			tname, arg);

Then the log has:

  func 'sk_common_release' arg0 has btf_id 145052 type STRUCT 'sock'
  func 'sk_common_release' can free arg0, marking it as untrusted

      reply	other threads:[~2026-12-04 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 15:12 [BUG] KASAN: slab-use-after-free in bpf_skc_to_* via fexit on sk_common_release MahnurA
2026-12-01  3:20 ` Alexei Starovoitov
2026-12-04 14:19   ` MahnurA
2026-12-04 18:39     ` Alexei Starovoitov [this message]

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=DNC61UH34HBC.3SM71DFQL7LQJ@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=s.mahnur.a@gmail.com \
    --cc=sdf@fomichev.me \
    --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