Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3362064ybh; Mon, 16 Mar 2020 21:54:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsvBBlDKu2a2LK+Ja4+E4NDQESsp+1G7kGZDWB3OgWHgFT1fB+fmzJjjtpPGSCNePkzKjtr X-Received: by 2002:a9d:12cc:: with SMTP id g70mr2082503otg.115.1584420873936; Mon, 16 Mar 2020 21:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584420873; cv=none; d=google.com; s=arc-20160816; b=a18lTTbbuWh21lo+1XuQS9GsSie0/4fp0ZsBtGDZmxsqXZWHXLf8HbEHiIHLmTzGq1 prsw06hlOXj1Q0ux5jPLZvuWcnxnNjgcpsoAZUhgsLviI9zKCSfT5huJND28GKbF47WS HzJ47vtpX9OEHpvRBW1hxwwOWTJiJJOLMtB5qASQbB3cHP1WzTRckdQ9Ay7Hyvf/Akzm VT9eudPwLPwexIVcCcMDESDU/xelpgQvoLL1cM+lc/PyjXVBR4mgJebPkkh1HvjbVcuf 4w1NIqvHJiQ8s8A27CoYUdulvoSzdZvsfP3GPbWxDtHG2YBDpHYVfiyWpKLDtz1t51xE QjYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LLh9WEkB9hCvNCPoVrwAAYggf2WFsHcOiqOg9CycRzk=; b=zwmmq4NRD8uw0tlLuZ0MUIwCqnXzY0A6c7M9gvFocKBQGqlwkIcjLNyYo1fMhseo5A nACiUkgjXKXvnbR6V3iyZKwNJ0TF5ps6o3gAmyvrxl3eD2Bk/B6aLoEMgTt6YLAsOsmf 7md8QEU01QWALwIsBwNRV+vkHhiOgkWMJosfInURoN1hPm6qkBUJdXpCG1LxmUK4xEls owYcgUh+EvOZTyjGJvrOoOll2HUAtr0l3PfOO+UegAwN/2bmgOw1KMLQpWAG1wJQ1ilZ ZwsZ/NmHRaG7Kh65xef3InkA5turB2od2EZJRUHMNLveh7Nvz2NcAFZ2d6NvcgWD8r1a CWKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AK6tEpD+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si1181950oih.136.2020.03.16.21.54.21; Mon, 16 Mar 2020 21:54:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AK6tEpD+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726701AbgCQEoX (ORCPT + 99 others); Tue, 17 Mar 2020 00:44:23 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:39555 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbgCQEoW (ORCPT ); Tue, 17 Mar 2020 00:44:22 -0400 Received: by mail-io1-f67.google.com with SMTP id c19so18546586ioo.6; Mon, 16 Mar 2020 21:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LLh9WEkB9hCvNCPoVrwAAYggf2WFsHcOiqOg9CycRzk=; b=AK6tEpD+luiz5pKN/vp4AchiO1ciwHPnVwAYZBNXvLtBr2NhUCzLZ86fj19Ocx869y khKh2G6PLuehKagz6NeSHeohensCduAB/1vUaS06oQ9zUnbwKnj10DIG9yQK2b/uqBOi mNMNoMNZefrukNCgWPYBru+1b3f9MOJLm/OB3L8dOPsrGyqEbZI5ixn8Pb0YT0YBKJoL T2f8KEK4LpIJTzrQETT/pLuiUDMLfoXWAKfCnMTNFIai4cEQ5PfVqzydjcDd8A47/h7Q sm7kVJwqCSkUlWFZaokIsrxeULrzjspKzvfN3p03tvM6sAn668mfGt/Jg9BXT1KAwGtv vAaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LLh9WEkB9hCvNCPoVrwAAYggf2WFsHcOiqOg9CycRzk=; b=ZdqdlJQUMXhPD6+UDcRiiByCkDdDVY5U4zHC23uqVZME+vHqKN1Q8FfLZfFx5pOnbI PuSYnam+BKc5H5jSjBObzm9ZyBDVm+7hSGTEeJnmKO7y6xLB/EzfvC9dXF8XBjP3EOTv uBOmcNGKI++IIBuIcujCwsTS7vSrr3y+wOLNr7tY8FlDJK0k6UZjTVuMn0h13o5RIsQ6 6+6iRRpiMlQmu3I5o97xg8PFL6eP9Wgruyb1htg9VXCKmqzeyXrPR65TqKz6kvd3eCbk Komq3rBp6bagBMPlVZsxSHj5bCXfRRO9efDpI05tZxlxAhtig8MC7h9bCSztIrObADgj 8guQ== X-Gm-Message-State: ANhLgQ0hkEWafqlj4dyz0SjIdtcZKHwPMhzTUGgkrr1m+dPxIB3OgqzQ F9gWA909Z/4HYgxWKAzCM5byl55R71eqpJeHbAc= X-Received: by 2002:a6b:f404:: with SMTP id i4mr2243728iog.175.1584420259614; Mon, 16 Mar 2020 21:44:19 -0700 (PDT) MIME-Version: 1.0 References: <1584330804-18477-1-git-send-email-hqjagain@gmail.com> <20200317041523.GB3756@localhost.localdomain> In-Reply-To: <20200317041523.GB3756@localhost.localdomain> From: Qiujun Huang Date: Tue, 17 Mar 2020 12:44:10 +0800 Message-ID: Subject: Re: [PATCH] sctp: fix refcount bug in sctp_wfree To: Marcelo Ricardo Leitner Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, "David S. Miller" , Jakub Kicinski , linux-sctp@vger.kernel.org, netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2020 at 12:15 PM Marcelo Ricardo Leitner wrote: > > On Mon, Mar 16, 2020 at 11:53:24AM +0800, Qiujun Huang wrote: > > Do accounting for skb's real sk. > > In some case skb->sk != asoc->base.sk. > > This is a too simple description. Please elaborate how this can > happen in sctp_wfree. Especially considering the construct for > migrating the tx queue on sctp_sock_migrate(), as both sockets are > locked while moving the chunks around and the asoc itself is only > moved in between decrementing and incrementing the refcount: > > lock_sock_nested(newsk, SINGLE_DEPTH_NESTING); > sctp_for_each_tx_datachunk(assoc, sctp_clear_owner_w); > sctp_assoc_migrate(assoc, newsk); > sctp_for_each_tx_datachunk(assoc, sctp_set_owner_w); > ... Yeah, the description is too simple. I'll send v2. > > > > > Reported-and-tested-by: syzbot+cea71eec5d6de256d54d@syzkaller.appspotmail.com > > I can't see a positive test result, though. If I didn't loose any > email, your last test with a patch similar to this one actually > failed. > I'm talking about syzbot test result at Message-ID: <000000000000e7736205a0e041f5@google.com> I told with syzbot privately avoiding noise :p Thanks!