+13
−1
Loading
tipc_msg_validate() can potentially reallocate the skb it is validating, freeing the old one. In tipc_buf_append(), it was being called with a pointer to a local variable which was a copy of the caller's skb pointer. If the skb was reallocated and validation subsequently failed, the error handling path would free the original skb pointer, which had already been freed, leading to double-free. Fix this by checking if head now points to a newly allocated reassembled skb. If it does, reassign *headbuf for later freeing operations. Fixes: d618d09a ("tipc: enforce valid ratio between skb truesize and contents") Suggested-by:Tung Nguyen <tung.quang.nguyen@est.tech> Signed-off-by:
Lee Jones <lee@kernel.org> Reviewed-by:
Tung Nguyen <tung.quang.nguyen@est.tech> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>