lkml.org 
[lkml]   [2022]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [syzbot] WARNING in sk_stream_kill_queues (8)
On Thu, Jul 7, 2022 at 11:39 AM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> On Wed, Jul 6, 2022 at 9:40 AM Cong Wang <xiyou.wangcong@gmail.com> wrote:
> >
> > I will look into this tonight.
>
> The following patch could work. It uncharges the sk mem before passing skb
> to recv actor but still keeps skb->sk.

This seems to make syzkaller happy.

Tested-by: Stanislav Fomichev <sdf@google.com>

> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 9d2fd3ced21b..c6b1effb2afd 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -1749,6 +1749,7 @@ int tcp_read_skb(struct sock *sk,
> skb_read_actor_t recv_actor)
> int used;
>
> __skb_unlink(skb, &sk->sk_receive_queue);
> + WARN_ON(!skb_set_owner_sk_safe(skb, sk));
> used = recv_actor(sk, skb);
> if (used <= 0) {
> if (!copied)

\
 
 \ /
  Last update: 2022-07-07 20:52    [W:0.706 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site