Commit 5788527
net-shapers: don't free reply skb after genlmsg_reply()
genlmsg_reply() hands the reply skb to netlink, and
netlink_unicast() consumes it on all return paths, whether the
skb is queued successfully or freed on an error path.
net_shaper_nl_get_doit() and net_shaper_nl_cap_get_doit()
currently jump to free_msg after genlmsg_reply() fails and call
nlmsg_free(msg), which can hit the same skb twice.
Return the genlmsg_reply() error directly and keep free_msg
only for pre-reply failures.
Fixes: 4b623f9 ("net-shapers: implement NL get operation")
Fixes: 553ea9f ("net: shaper: implement introspection support")
Cc: stable@vger.kernel.org
Signed-off-by: Paul Moses <p@1g4.org>
Link: https://patch.msgid.link/20260309173450.538026-2-p@1g4.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent f441b48 commit 5788527
1 file changed
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 762 | + | |
767 | 763 | | |
768 | 764 | | |
769 | 765 | | |
| |||
1313 | 1309 | | |
1314 | 1310 | | |
1315 | 1311 | | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
| 1312 | + | |
1320 | 1313 | | |
1321 | 1314 | | |
1322 | 1315 | | |
| |||
0 commit comments