linux-stable/net/mctp
Jeremy Kerr 3773d65ae5 net: mctp: take ownership of skb in mctp_local_output
Currently, mctp_local_output only takes ownership of skb on success, and
we may leak an skb if mctp_local_output fails in specific states; the
skb ownership isn't transferred until the actual output routing occurs.

Instead, make mctp_local_output free the skb on all error paths up to
the route action, so it always consumes the passed skb.

Fixes: 833ef3b91d ("mctp: Populate socket implementation")
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240220081053.1439104-1-jk@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-02-22 19:21:11 -08:00
..
test Networking changes for 5.19. 2022-05-25 12:22:58 -07:00
Kconfig mctp: Add flow extension to skb 2021-10-29 13:23:51 +01:00
Makefile mctp: Add test utils 2021-10-03 14:35:41 +01:00
af_mctp.c sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES) 2023-06-24 15:50:13 -07:00
device.c mctp: Remove device type check at unregister 2022-12-19 17:20:22 -08:00
neigh.c mctp: replace mctp_address_ok with more fine-grained helpers 2022-02-18 21:24:28 -08:00
route.c net: mctp: take ownership of skb in mctp_local_output 2024-02-22 19:21:11 -08:00