Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tipc: fix the skb_unshare() in tipc_buf_append()
skb_unshare() drops a reference count on the old skb unconditionally, so in the failure case, we end up freeing the skb twice here. And because the skb is allocated in fclone and cloned by caller tipc_msg_reassemble(), the consequence is actually freeing the original skb too, thus triggered the UAF by syzbot. Fix this by replacing this skb_unshare() with skb_cloned()+skb_copy(). Fixes: ff48b62 ("tipc: use skb_unshare() instead in tipc_buf_append()") Reported-and-tested-by: [email protected] Cc: Jon Maloy <[email protected]> Cc: Ying Xue <[email protected]> Signed-off-by: Cong Wang <[email protected]> Reviewed-by: Xin Long <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
- Loading branch information