All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Daniel Borkmann <daniel@iogearbox.net>, bpf@vger.kernel.org
Cc: Yinhao Hu <dddddd@hust.edu.cn>,
	Kaiyan Mei <M202472210@hust.edu.cn>,
	Dongliang Mu <dzm91@hust.edu.cn>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf] bpf: Fix use-after-free in offloaded map/prog info fill
Date: Thu, 9 Apr 2026 10:20:30 +0800	[thread overview]
Message-ID: <2034cfa0-839a-4ce8-bc67-89daf4089bce@linux.dev> (raw)
In-Reply-To: <1eccd7fc-8a1c-4499-ae81-a63fc8d0ff26@iogearbox.net>


On 4/9/26 5:49 AM, Daniel Borkmann wrote:
> On 4/8/26 12:47 PM, Jiayuan Chen wrote:
>> When querying info for an offloaded BPF map or program,
>>
[...]
>> zero, which causes ns_get_path_cb() to fail and the caller to return
>> -ENODEV -- the correct behavior when the netns is being destroyed.
>
> nit: -ENOENT
>
>> Fixes: 675fc275a3a2d ("bpf: offload: report device information for 
>> offloaded programs")
>> Fixes: 52775b33bb507 ("bpf: offload: report device information about 
>> offloaded maps")
>> Reported-by: Yinhao Hu <dddddd@hust.edu.cn>
>> [...]
>> +        net = maybe_get_net(dev_net(aux->offload->netdev));
>> +        if (net) {
>> +            ns = &net->ns;
>> +        } else {
>> +            ns = NULL;
>> +        }
>
> nit: ns = net ? &net->ns : NULL;
>
>>
[...]
>> +        }
>
> ditto, otherwise looks good to me
>
>>       } else {
>>           args->info->ifindex = 0;
>>           ns = NULL;
>

  Thanks for the review!

  Both nits are valid -- will fix the commit message to say -ENOENT and
  simplify to ternary in the next version.


  reply	other threads:[~2026-04-09  2:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 10:47 [PATCH bpf] bpf: Fix use-after-free in offloaded map/prog info fill Jiayuan Chen
2026-04-08 21:49 ` Daniel Borkmann
2026-04-09  2:20   ` Jiayuan Chen [this message]
2026-04-09  1:16 ` bot+bpf-ci

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=2034cfa0-839a-4ce8-bc67-89daf4089bce@linux.dev \
    --to=jiayuan.chen@linux.dev \
    --cc=M202472210@hust.edu.cn \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dddddd@hust.edu.cn \
    --cc=dzm91@hust.edu.cn \
    --cc=eddyz87@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@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 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.