All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v3 5/6] netlink: specs: rt-route: describe lwt BPF program options
Date: Sat, 3 Oct 2026 14:09:06 +0800	[thread overview]
Message-ID: <asCcAgEz7gzg34Dy@fedora> (raw)
In-Reply-To: <20261001015135.488BE1F00899@smtp.kernel.org>

On Thu, Oct 01, 2026 at 01:51:34AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] netlink: missing max-len validation constraint for string attribute
> --
> 
> commit f56da32d0f53d2458e2f20c65435e7f6e11b64a4
> Author: Hangbin Liu <liuhangbin@kylinos.cn>
> 
> netlink: specs: rt-route: describe lwt BPF program options
> 
> This patch replaces binary BPF attributes with a nested lwt-bpf-prog to
> support lwt bpf prog options in the rt-route netlink specification.
> 
> > diff --git a/Documentation/netlink/specs/rt-route.yaml b/Documentation/netlink/specs/rt-route.yaml
> > index 7649797602eb7..afec0375661f5 100644
> > --- a/Documentation/netlink/specs/rt-route.yaml
> > +++ b/Documentation/netlink/specs/rt-route.yaml
> [ ... ]
> > @@ -621,6 +624,16 @@ attribute-sets:
> >        -
> >          name: hwid
> >          type: u8
> > +  -
> > +    name: lwt-bpf-prog
> > +    name-prefix: lwt-bpf-prog-
> > +    attributes:
> > +      -
> > +        name: fd
> > +        type: u32
> > +      -
> > +        name: name
> > +        type: string
> 
> [Severity: Low]
> Does this string attribute need a maximum length validation constraint?
> 
> The kernel's LWT_BPF_PROG_NAME policy restricts the length to MAX_PROG_NAME
> (which is 256). For netlink string specifications, this usually means adding
> a checks section with max-len: 255.

Why we should use 255 here? The bpf_encap_nlsize() alloc size
nla_total_size(MAX_PROG_NAME).

Hangbin
> 
> Without this declarative constraint, the generated userspace tooling will not
> restrict the string length prior to constructing the netlink message, forcing
> the kernel to reject over-sized strings. This bypasses client-side validation.
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260930-ynl_rt_encap-v3-0-4106c21b9ee7@kylinos.cn?part=5

  reply	other threads:[~2026-10-03  6:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30  1:50 [PATCH net-next v3 0/6] netlink: add lwtunnel encap sub-message support to rt-route Hangbin Liu
2026-09-30  1:50 ` [PATCH net-next v3 1/6] net: lwtunnel: change encap fill order Hangbin Liu
2026-10-01 14:09   ` Ido Schimmel
2026-09-30  1:50 ` [PATCH net-next v3 2/6] tools: ynl: convert enum selector to string for sub-message parsing Hangbin Liu
2026-10-01  1:51   ` sashiko-bot
2026-10-03  6:23     ` Hangbin Liu
2026-10-05 22:33       ` Jakub Kicinski
2026-09-30  1:50 ` [PATCH net-next v3 3/6] netlink: specs: rt-route: add lwtunnel encap sub-message support Hangbin Liu
2026-09-30  1:50 ` [PATCH net-next v3 4/6] netlink: specs: rt-route: describe lwtunnel IP options Hangbin Liu
2026-09-30  1:50 ` [PATCH net-next v3 5/6] netlink: specs: rt-route: describe lwt BPF program options Hangbin Liu
2026-10-01  1:51   ` sashiko-bot
2026-10-03  6:09     ` Hangbin Liu [this message]
2026-09-30  1:50 ` [PATCH net-next v3 6/6] netlink: specs: rt-route: describe seg6-local attrs Hangbin Liu
2026-10-01  1:51   ` sashiko-bot
2026-10-03  6:17     ` Hangbin Liu

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=asCcAgEz7gzg34Dy@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.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.