Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4857663imm; Tue, 9 Oct 2018 06:21:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV63vCWItxr8jciiRMMjJoBrWjih521JyLdzvEAc/K+MaJhSanSGzQ2B5URl1z8e8ASu+w3p5 X-Received: by 2002:a62:6f43:: with SMTP id k64-v6mr29147695pfc.87.1539091319080; Tue, 09 Oct 2018 06:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539091319; cv=none; d=google.com; s=arc-20160816; b=EkKARdb+L6WhHhncBIQ9o3kekhrapgtoGPTPfoUd5Khkj1q/KCZWRZU5B7VlHWCeg3 HQU9x2aHc3VQhhWYE+b/x6FRtvHKXS65ejnqoK7KfMDsrw5/Kn//ZuaDr6OP+W7JTkxg NfUxara+R7aMrdjRVCDreHfEZNiioAIatrwemxxXYpj2xZeT9oGgPMooVFsXO7ENJiMy CqbaH9J2P3VN6S9VNpNtwlFNcwUZUFD0UIrZ03AdtLeW0Lhzx3nz7HDsh4VQfSC5FvX3 6IkBOhRhTrSl93C02BlmNMnpMh1Qhw+gFB8yG6wZytlj6WSg3nrbQ4xYDiwtIb0N/cZ3 s/4w== 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=L5nkQDF61tD+oN0Jh1oODSDLvjM8xXjuRj5bYr8Sk/0=; b=kYdP7vozzGgjo2p20Lt77ljwiZMxwQHBE0HdPTIG2KNFEGu+o464ZkMoU33Uses/c0 z5mQPR+ag581nSt2T5O3NOgt6LekywzJjRuwwrg49hVnoM2jRZ7cCpd6lRoVCXy8UNjc iD4kuW6VxNWkpPSAhJn849MUcswLxXgSGFY+eXM8x9XbbjnR821n8DJ0eMNsqgz/+E81 pk9N3LhTmQSnCt4Zf2Foi/FZ7GziN4/qojPPvLXbW6f0Y6bC2mqZCP+a9pD/P0kdcvWk g2qUstlKfLhEmxCXR2qEU71NLtuNMyz8OiZyOe8FW46egXvi22X2fjM3+AzYgBIM1wGe bC+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hUO3mH6x; 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 q1-v6si23656671pfb.258.2018.10.09.06.21.43; Tue, 09 Oct 2018 06:21:59 -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=hUO3mH6x; 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 S1726616AbeJIUgt (ORCPT + 99 others); Tue, 9 Oct 2018 16:36:49 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:35934 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbeJIUgt (ORCPT ); Tue, 9 Oct 2018 16:36:49 -0400 Received: by mail-vs1-f65.google.com with SMTP id c205so1451723vsd.3; Tue, 09 Oct 2018 06:19:54 -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=L5nkQDF61tD+oN0Jh1oODSDLvjM8xXjuRj5bYr8Sk/0=; b=hUO3mH6xtNRDA4C0FxnzSnEgnPLncLlFqtfyobx8MzrVwjv8mZbl1d7qeHH8iPABmc XAHOmcjduZ0WeBo7CD2jxFhKVBNlrnrAVgL2+DK4Ze31eboFXJm2Px7f8bByPNH6+Y+T h5EwjTaPhZH/8yNPg8j8DYb2LN4pKyCjHZho2reqCXn+k2SjZ17OlVD2inj6Sil1p3DN Iwl7Onco1mJnrtPvIyXcFCdgA5Whl9HUURFDEigooqEzJTCS0reI6rRf652mfVbCWOno r3Viv3X4cn7lYzxOzWVoviTIvh+fSWsSo4QxS+KiBqSf4P3nNEbwLE9Hwq48vJjKdxSU a0qQ== 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=L5nkQDF61tD+oN0Jh1oODSDLvjM8xXjuRj5bYr8Sk/0=; b=R6KBSbRn0VEtrxwH00UsmnL/JmyAQme6p0Bk1hzi/39UtFPz2MUxrMHtazexDiXObc tzd+LqKJKWjzd6gOHT+hNU06AycyaJF5xNJXltts58kudFBuIrnoPt15+jxcCkFMh2f2 Mgo5369hghoqM0ZfegUfsy/8Sy2v0+G3jjuf//B15jvBI6gum+jBeWBYPZOz3xe+ebV5 9wcE713AtzEz1BP6UC2n7nuCccpztqnCqbQVzGXy3sRm5aPIbFBq4XF6FZNMDu6djYNO Z/vBz5JQf/eBzDxQNm8GyIn+7oQstPikmu9xePKFhcF1H71fn+BNlypfb0F8nrw6ZaoY lnMA== X-Gm-Message-State: ABuFfoiLc3MBRYGyVdtGDQWCeLn3VLWbODvQmuy7KkwbnYprbPnnqxG4 6lni0QLODZAnJYk8xaUsDtPkPT3QeiNBugAVELxNi+k4wD8= X-Received: by 2002:a67:3bc9:: with SMTP id l70mr7457063vsi.44.1539091193546; Tue, 09 Oct 2018 06:19:53 -0700 (PDT) MIME-Version: 1.0 References: <20181009020949.GA29622@nautica> <1539057956-23741-1-git-send-email-asmadeus@codewreck.org> <1539057956-23741-2-git-send-email-asmadeus@codewreck.org> In-Reply-To: <1539057956-23741-2-git-send-email-asmadeus@codewreck.org> From: Tomas Bortoli Date: Tue, 9 Oct 2018 15:19:42 +0200 Message-ID: Subject: Re: [PATCH 2/2] 9p/trans_fd: put worker reqs on destroy To: Dominique Martinet Cc: Dominique Martinet , v9fs-developer@lists.sourceforge.net, netdev , LKML , Eric Van Hensbergen , Latchesar Ionkov 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 Il giorno mar 9 ott 2018 alle ore 06:06 Dominique Martinet ha scritto: > > From: Dominique Martinet > > p9_read_work/p9_write_work might still hold references to a req after > having been cancelled; make sure we put any of these to avoid potential > request leak on disconnect. > > Fixes: 728356dedeff8 ("9p: Add refcount to p9_req_t") > Signed-off-by: Dominique Martinet > Cc: Eric Van Hensbergen > Cc: Latchesar Ionkov > Cc: Tomas Bortoli Reviewed-by: Tomas Bortoli > --- > Noticed we could leak a ref while looking at the syzbot report, > this should be safe enough after the work has been cancelled... > Probably. > > net/9p/trans_fd.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c > index a0317d459cde..f868cf6fba79 100644 > --- a/net/9p/trans_fd.c > +++ b/net/9p/trans_fd.c > @@ -876,7 +876,15 @@ static void p9_conn_destroy(struct p9_conn *m) > > p9_mux_poll_stop(m); > cancel_work_sync(&m->rq); > + if (m->rreq) { > + p9_req_put(m->rreq); > + m->rreq = NULL; > + } > cancel_work_sync(&m->wq); > + if (m->wreq) { > + p9_req_put(m->wreq); > + m->wreq = NULL; > + } > > p9_conn_cancel(m, -ECONNRESET); > > -- > 2.19.1 > LGTM -- Tomas