summaryrefslogtreecommitdiff
path: root/scripts/basic/split-include.c
diff options
context:
space:
mode:
authorJoas Antonio dos Santos <joasantonio108@gmail.com>2026-10-24 19:04:28 -0300
committerPaolo Abeni <pabeni@redhat.com>2026-10-29 10:48:51 +0100
commitd2bfe74a8fe219a86b86c1f126e1d722a5001790 (patch)
treedeba0478f43aba21c90624b068ca3bd1e6ace175 /scripts/basic/split-include.c
parentfa503935c2d6603856dafff0a0852631ab6e9503 (diff)
downloadlinux-d2bfe74a8fe219a86b86c1f126e1d722a5001790.tar.gz
linux-d2bfe74a8fe219a86b86c1f126e1d722a5001790.zip
net: mctp: free reassembly head skb when key_add fails on SOM
When a start-of-message fragment creates a new reassembly key on the broadcast/bind path, mctp_frag_queue() stores the skb as key->reasm_head before the key is made observable with mctp_key_add(). If mctp_key_add() fails (a race with another SOM packet for the same source/dest/tag, or the receiving socket going away), the error path only drops the key reference via mctp_key_unref(). The final key destructor frees the key itself but not key->reasm_head, and since the key was never added to any list, neither the expiry worker nor socket teardown can reach it to release the queued fragment. The skb is leaked. Free key->reasm_head on the key_add failure path before releasing the key. Other teardown paths (__mctp_key_done_in(), EOM delivery) already clear reasm_head before the final unref, so this only affects the failure path. Fixes: 4a992bbd3650 ("mctp: Implement message fragmentation & reassembly") Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com> Reported-by: Guikun Yang <yangguikun19@qq.com> Closes: https://lore.kernel.org/all/tencent_43A65D51143E18518EA968DF9323694EFD08@qq.com/ Acked-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/179287946888.17431.11219154409333681184@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions