public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Sun Jian" <sun.jian.kdev@gmail.com>, <ast@kernel.org>,
	<daniel@iogearbox.net>, <andrii@kernel.org>, <eddyz87@gmail.com>,
	<memxor@gmail.com>, <bpf@vger.kernel.org>
Cc: <john.fastabend@gmail.com>, <martin.lau@linux.dev>,
	<song@kernel.org>, <yonghong.song@linux.dev>, <jolsa@kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf] bpf: reject ERR_PTR map->record in map_check_btf
Date: Thu, 16 Apr 2026 08:42:40 -0700	[thread overview]
Message-ID: <DHUOZVP8JZ80.28GPGA99P0ORD@gmail.com> (raw)
In-Reply-To: <20260416144808.149543-1-sun.jian.kdev@gmail.com>

On Thu Apr 16, 2026 at 7:48 AM PDT, Sun Jian wrote:
> btf_parse_fields() returns an ERR_PTR() when it encounters an invalid
> special field in map value BTF.
>
> For example, an invalid kptr-annotated field whose tagged pointee is not
> a full struct type can make btf_parse_fields() fail with -EINVAL.
>
> map_check_btf() stores the result in map->record, but currently only
> handles the successful non-NULL case explicitly. ERR_PTR() results are
> not rejected immediately before proceeding with the rest of map BTF
> setup.

yes. So ?

> Handle IS_ERR(map->record) explicitly in map_check_btf() and return the
> underlying error code immediately.

why ?

pw-bot: cr

  reply	other threads:[~2026-04-16 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 14:48 [PATCH bpf] bpf: reject ERR_PTR map->record in map_check_btf Sun Jian
2026-04-16 15:42 ` Alexei Starovoitov [this message]
2026-04-16 16:41   ` sun jian

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=DHUOZVP8JZ80.28GPGA99P0ORD@gmail.com \
    --to=alexei.starovoitov@gmail.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=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=song@kernel.org \
    --cc=sun.jian.kdev@gmail.com \
    --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