All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google.com>
To: Eduard Zingerman <eddyz87@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	 syzbot <syzbot+291100dcb32190ec02a8@syzkaller.appspotmail.com>,
	andrii@kernel.org,  ast@kernel.org, bpf@vger.kernel.org,
	daniel@iogearbox.net,  davem@davemloft.net, haoluo@google.com,
	hawk@kernel.org,  john.fastabend@gmail.com, jolsa@kernel.org,
	kpsingh@kernel.org,  linux-kernel@vger.kernel.org,
	martin.lau@linux.dev, netdev@vger.kernel.org,  song@kernel.org,
	syzkaller-bugs@googlegroups.com, yonghong.song@linux.dev
Subject: Re: [syzbot] [bpf?] general protection fault in bpf_prog_offload_verifier_prep
Date: Wed, 6 Sep 2023 11:34:38 -0700	[thread overview]
Message-ID: <ZPjGPjbxazLkRkEW@google.com> (raw)
In-Reply-To: <c7f9db8879a9342080e74b9270e9925132b02f59.camel@gmail.com>

On 09/06, Eduard Zingerman wrote:
> On Wed, 2023-09-06 at 07:57 -0700, Jakub Kicinski wrote:
> > On Wed, 06 Sep 2023 16:50:23 +0300 Eduard Zingerman wrote:
> > > diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c
> > > index 3e4f2ec1af06..302e38bffffa 100644
> > > --- a/kernel/bpf/offload.c
> > > +++ b/kernel/bpf/offload.c
> > > @@ -199,12 +199,11 @@ static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *n
> > >         offload->netdev = netdev;
> > >  
> > >         ondev = bpf_offload_find_netdev(offload->netdev);
> > > +       if (bpf_prog_is_offloaded(prog->aux) && (!ondev || !ondev->offdev)) {
> > > +               err = -EINVAL;
> > > +               goto err_free;
> > > +       }
> > >         if (!ondev) {
> > > -               if (bpf_prog_is_offloaded(prog->aux)) {
> > > -                       err = -EINVAL;
> > > -                       goto err_free;
> > > -               }
> > > -
> > >                 /* When only binding to the device, explicitly
> > >                  * create an entry in the hashtable.
> > >                  */
> > 
> > LGTM, FWIW.
> 
> Thanks, I'll wrap it up as a proper patch with a test.

LGTM as well, thanks!

  reply	other threads:[~2023-09-06 18:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-03 19:55 [syzbot] [bpf?] general protection fault in bpf_prog_offload_verifier_prep syzbot
2023-09-06 12:40 ` Eduard Zingerman
2023-09-06 13:50   ` Eduard Zingerman
2023-09-06 13:54     ` Daniel Borkmann
2023-09-06 14:57     ` Jakub Kicinski
2023-09-06 18:00       ` Eduard Zingerman
2023-09-06 18:34         ` Stanislav Fomichev [this message]
2023-09-09 16:12 ` syzbot

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=ZPjGPjbxazLkRkEW@google.com \
    --to=sdf@google.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=syzbot+291100dcb32190ec02a8@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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 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.