Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4064976imw; Thu, 7 Jul 2022 12:07:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sjp/tQ3qeUvv6BK0z3n+W+r9owB0PtZSmu3TIhtLuPuXe8ncbINB/7f6DpS5orr8MLUUG5 X-Received: by 2002:a05:6402:5215:b0:43a:8a94:f514 with SMTP id s21-20020a056402521500b0043a8a94f514mr14401200edd.22.1657220830293; Thu, 07 Jul 2022 12:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657220830; cv=none; d=google.com; s=arc-20160816; b=PLctNGNw/k2L8ya22piLPOEQG/lKMzRZBnv83Jko/OS3a4oZjrHj8E+bZ+jX9eLxlw sQ7n5xGaY20OVAbut9JZRjrv+C9uTB1GmzlKGH3g7ycSyyiNMZJJT2OsD0QHtURFqYCk IxTlVWIpi05gLm2m/LqiSSAdSVIPHt6ACUYz5/J3aF8pjYA60Gy7ic4P4uw/tPYpqvxb 2KOstyS+LZ+U7nfyOI4xEZ/VJUhrq6q0pn8UCViATxZajkQ9TNf6mx3HuqiegYtarHG4 lwVrXDuo9/OKfo5TuGylBSDUxj7iI7S2OZ+bMtoSZKTECEoIZlOWf8lv5ZKXuCZ2dM55 8Wkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Xk4jif5w/j4QtqfSLIsfZH63Xsd+XRgDGsOnmU7ibig=; b=nNq9j8+apT2zu9YNK90U45NFM0LcpR7nJl+S/1K0kSM9lLkQTD5ax5biDt6RPmvZyp aldVyF6pTLao3X4R+pWBngTIiUs5vRMcy17dhN0t1kJ6UIxwXAkafVqgt8iLQ7d/QPjN +wIekHldYMR4aWXKbF3Oxo2uiPc1Rp0fbGkwbBDOOtaZqvJhk2bSO2/3mKjMUoNuvwbu krCX+AkRpQF4vucmk8tbfcaQxcplXoRnChhtns+z+RyHyDD8PcbSnKakdq7lZvfpRHYc /hTsvlLfG8bUVx1C5oRkxPmWLM7u4Uxv/BZiebuAnnrcX/eLEp28zeM3+tehjlN1dGiZ w0sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RrW536JT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw14-20020a170906478e00b0070f509be43csi2097258ejc.874.2022.07.07.12.06.44; Thu, 07 Jul 2022 12:07:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RrW536JT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236158AbiGGSjM (ORCPT + 99 others); Thu, 7 Jul 2022 14:39:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbiGGSjL (ORCPT ); Thu, 7 Jul 2022 14:39:11 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF024271D; Thu, 7 Jul 2022 11:39:10 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id x184so7734503pfx.2; Thu, 07 Jul 2022 11:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xk4jif5w/j4QtqfSLIsfZH63Xsd+XRgDGsOnmU7ibig=; b=RrW536JT8xzuxyMjuf/Guz76azv1oh8lBOOlhG34EUvP2M12CHvP/fGsuUWkdf/nFl CHeRZf2jqrZWmE9IkG8pEEYDZ+AmzeocyG5RP9tx+k6kHd2co8EoUcwSDWVlmrcVCDb3 7UkgotkgXjdaRZe6l8WOIleiCaj6p3Tst4aaRV2o9ijt8PnmQ66MWHlZdcy1IoERhBTL e74xmi2JfuniNvTEc9LOGuHvkHsc0Y5E6NQkG4+F76mPR+lD3sfMvvd6O2t+C1TDpsjU WtrIlIgRAWHqpMu+dt5O9rCRv7duBonOn9z+/q0c6k+JHK0/rq00gVzMVSC72xfBcedO vzxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xk4jif5w/j4QtqfSLIsfZH63Xsd+XRgDGsOnmU7ibig=; b=HAOHtpmOVnPZZW2igb5FwLzmgfg9RqHD/x8Y8N2aOp51W8eq8Efo4ZVDmBouXG9MnK nCPDYXdgstIRiNixWDdZNicWiVWmpo3fK7pNWgH0RH+Mmto4BrFG8gdqEUNWm2nMKQXW ILjU8PNHb88mAfNhvEdz85gDWAsoh8/WGCW6Z2T+zInXtLciL82hCNxqzYhMBMBSuyzE ZxO37CxV6IHT3fdd2lhEQhTyieLoYpClMblXwESAs+7qWHONcMOylnun22l1N7jlmq74 S/8G/HCGzwcPTAdmaRXXAeahjiEcvgR5yvYoAg9N0dfda+pFnGCxqxsFkOIDvrQXzzjo qnDg== X-Gm-Message-State: AJIora834EWEr+4Nbw8kr3R6AsInKqzaPsKrNV/Fr5johsjdP4g276Et LOwkD+y8vOFbvzG+E20/NtWapekHvNJDBV69OhE= X-Received: by 2002:a17:903:1c4:b0:16a:73fd:3c6c with SMTP id e4-20020a17090301c400b0016a73fd3c6cmr53782275plh.115.1657219150361; Thu, 07 Jul 2022 11:39:10 -0700 (PDT) MIME-Version: 1.0 References: <000000000000b06e5505e299a9b6@google.com> In-Reply-To: From: Cong Wang Date: Thu, 7 Jul 2022 11:38:59 -0700 Message-ID: Subject: Re: [syzbot] WARNING in sk_stream_kill_queues (8) To: Eric Dumazet Cc: syzbot , Stanislav Fomichev , Cong Wang , Daniel Borkmann , John Fastabend , David Miller , Jakub Kicinski , LKML , netdev , Paolo Abeni , syzkaller-bugs , Wei Wang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 6, 2022 at 9:40 AM Cong Wang 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. 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)