mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Cen Zhang (Microsoft Security FORGE Labs)" <cenzhang@linux.microsoft.com>
To: alexei.starovoitov@gmail.com
Cc: AutonomousCodeSecurity@microsoft.com, andrii@kernel.org,
	ast@kernel.org, bpf@vger.kernel.org,
	cenzhang@linux.microsoft.com, daniel@iogearbox.net,
	davem@davemloft.net, dlebrun@google.com, eddyz87@gmail.com,
	edumazet@google.com, emil@etsalapatis.com, horms@kernel.org,
	ihor.solodrai@linux.dev, john.fastabend@gmail.com,
	jolsa@kernel.org, kuba@kernel.org, kys@microsoft.com,
	linux-kernel@vger.kernel.org, m.xhonneux@gmail.com,
	martin.lau@linux.dev, memxor@gmail.com, netdev@vger.kernel.org,
	pabeni@redhat.com, sdf@fomichev.me, song@kernel.org,
	tgopinath@linux.microsoft.com, xmei5@asu.edu,
	yonghong.song@linux.dev
Subject: Re: [PATCH bpf v3] bpf: Fix non-linear SRH access in bpf_update_srh_state()
Date: Tue, 22 Sep 2026 23:49:59 -0400	[thread overview]
Message-ID: <20260923035000.78489-1-cenzhang@linux.microsoft.com> (raw)
In-Reply-To: <CAADnVQJceTGftun8NfbyQdWe1FqLDsd6Ut5mrQFxuVkAvrAAEg@mail.gmail.com>

On Sun, Sep 13, 2026 at 9:56 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
> > +       srh = seg6_get_srh(skb, 0);
> > +       bpf_compute_data_pointers(skb);
> > +       srh_state->srh = srh;
> > +       if (!srh)
> > +               return;
> > +
> > +       srh_state->hdrlen = srh->hdrlen << 3;
> > +       srh_state->valid = true;
>
> This is not equivalent.

Thank you for pointing this out. seg6_get_srh() additionally
validates the header. I will revert to ipv6_find_hdr() in v4.

Thanks,
Cen


      reply	other threads:[~2026-09-23  3:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 14:25 Cen Zhang (Microsoft Security FORGE Labs)
2026-09-14  4:56 ` Alexei Starovoitov
2026-09-23  3:49   ` Cen Zhang (Microsoft Security FORGE Labs) [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=20260923035000.78489-1-cenzhang@linux.microsoft.com \
    --to=cenzhang@linux.microsoft.com \
    --cc=AutonomousCodeSecurity@microsoft.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dlebrun@google.com \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=emil@etsalapatis.com \
    --cc=horms@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.xhonneux@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=tgopinath@linux.microsoft.com \
    --cc=xmei5@asu.edu \
    --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

all inboxes | Powered by JetHome®