linux/net/shaper
Paul Moses 8738dcc844 net-shapers: don't free reply skb after genlmsg_reply()
commit 57885276cc upstream.

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: 4b623f9f0f ("net-shapers: implement NL get operation")
Fixes: 553ea9f1ef ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-03-19 16:08:42 +01:00
..
Makefile netlink: spec: add shaper YAML spec 2024-10-10 08:30:21 -07:00
shaper.c net-shapers: don't free reply skb after genlmsg_reply() 2026-03-19 16:08:42 +01:00
shaper_nl_gen.c netlink: spec: add shaper introspection support 2024-10-10 08:30:22 -07:00
shaper_nl_gen.h netlink: spec: add shaper introspection support 2024-10-10 08:30:22 -07:00