Commit 17637d8
committed
genetlink: free the skb on 'group >= family->n_mcgrps'
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 protected]>
Suggested-by: Matthew Maurer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alice Ryhl <[email protected]>1 parent 3293723 commit 17637d8
2 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
| 493 | + | |
493 | 494 | | |
| 495 | + | |
494 | 496 | | |
495 | 497 | | |
496 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1972 | 1972 | | |
1973 | 1973 | | |
1974 | 1974 | | |
1975 | | - | |
| 1975 | + | |
| 1976 | + | |
1976 | 1977 | | |
| 1978 | + | |
1977 | 1979 | | |
1978 | 1980 | | |
1979 | 1981 | | |
| |||
1986 | 1988 | | |
1987 | 1989 | | |
1988 | 1990 | | |
1989 | | - | |
| 1991 | + | |
| 1992 | + | |
1990 | 1993 | | |
| 1994 | + | |
1991 | 1995 | | |
1992 | 1996 | | |
1993 | 1997 | | |
| |||
0 commit comments