Subject: Re: [PATCH] genetlink: free the skb on 'group >= family->n_mcgrps'

From: Alice Ryhl <[email-masked]>
Date: Mon, 4 May 2026 10:45:22 +0000

On Mon, May 04, 2026 at 03:20:25AM -0700, Eric Dumazet wrote:
> On Mon, May 4, 2026 at 2:17 AM Alice Ryhl <[email-masked]> wrote:
> >
> > These methods generally consume ownership of the provided skb, so even
> > if an error path is encountered, the skb is freed. This is because the
> > very first thing they do after some initial setup is to unconditionally
> > consume the skb via consume_skb(skb). Any subsequent errors lead to the
> > core netlink layer freeing the skb.
> >
> > However, there is one check that occurs before ownership is passed,
> > which is the check for the group index. So if this error condition is
> > encountered, then the skb is leaked. This error condition is generally
> > considered a violation of the netlink API, so it's not expected to occur
> > under normal circumstances. For the same reason, no callers check for
> > this error condition, and no callers need to be adjusted. However, we
> > should still follow the same ownership semantics of the rest of the
> > function. Thus, free the skb in this codepath.
> >
> > Assisted-by: Antigravity:gemini
> > Suggested-by: Andrew Lunn <[email-masked]>
> > Suggested-by: Matthew Maurer <[email-masked]>
> > Link: https://lore.kernel.org/r/[email-masked]
> > Signed-off-by: Alice Ryhl <[email-masked]>
> 
> 1) This looks like a fix meant for net tree ?
> 
> 2) We require a Fixes: tag for bug fixes.
> 
> For more details I highly recommend reading at least the tl;dr part of:
> 
> Documentation/process/maintainer-netdev.rst

Sorry I forgot that the net subsystem has special rules.

I do not believe any callers actually excercise this codepath, but I
will add a Fixes: tag and indicate 'net' tree for the next version in a
few days.

Alice