Skip to content

Commit ba233b3

Browse files
edumazetdavem330
authored andcommitted
tcp: fix tcp_send_syn_data()
syn_data was allocated by sk_stream_alloc_skb(), meaning its destructor and _skb_refdst fields are mangled. We need to call tcp_skb_tsorted_anchor_cleanup() before calling kfree_skb() or kernel crashes. Bug was reported by syzkaller bot. Fixes: e208007 ("tcp: new list for sent but unacked skbs for RACK recovery") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Dmitry Vyukov <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 27188af commit ba233b3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/tcp_output.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,6 +3383,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn)
33833383
int copied = copy_from_iter(skb_put(syn_data, space), space,
33843384
&fo->data->msg_iter);
33853385
if (unlikely(!copied)) {
3386+
tcp_skb_tsorted_anchor_cleanup(syn_data);
33863387
kfree_skb(syn_data);
33873388
goto fallback;
33883389
}

0 commit comments

Comments
 (0)