Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1135028rwb; Tue, 4 Oct 2022 16:12:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4kCo29JncAaEbHC4fDrEjBGLy2mH+NvS9EOJGs8ljnvcuhHu9nzRg8nkT4AqXa7b4+1AqE X-Received: by 2002:a17:907:1ca6:b0:78c:5bd6:4bac with SMTP id nb38-20020a1709071ca600b0078c5bd64bacmr7743888ejc.732.1664925173182; Tue, 04 Oct 2022 16:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664925173; cv=none; d=google.com; s=arc-20160816; b=YE47Uy7GgLWLONFIchSdelqk6St1zuPABxkrRnfa9a7j2iLrDzyJSGuWG8TUOQMJ8b e4Wg19Xggu2T1YvQiDwJDR/IoZKwhR3Su8mISk3g9hD9qX6j9oOMDO6+xf5z5j6rg78/ p0h+vJqrVsH/E02QVWHf6LymPHOidmU9U9wC0q5s5VGXUSnqyr7nimJZmU8p3pNMWfYr 1oiZoASlX1FjOafqhAjpQkBwW5ahVCKedbPhnBWVDGLxNjgi6xvBfruAEi/2i6dFoBIN +SwrRfppetFNWbt/9O3E/Vq+75CNWCNFDSuRhEQeAlQtVmyTPaQHYHMxVKF4qhkLj0q+ 37hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=FmRYiMqfekn9AN8DpzCa2by7y35Y1eEzLukhmKFSTy8=; b=Ey8uE16FO9ESCNB3EZdub3p2f4Me4qzcwq9KSgpMEFmpLXBDDYz4ebJ4mWL8N4m4YH 3hlBI4D+KMCAXRjLy8U0W5z6OJsGUgMS9PGjETUcR+qOPUM5ji7/ejD3Gp55esebpYbz 27ShAYjb+eVoR77diNppl1/tna9GqdB8eNLt1y+Njg0/52ROCxs34lJ1itjknL9LKaRs gxMaXxaLBTGXOncD175Bf9QVGYut2LEhO4/WcyawGICsgwJP0Mqa+KrxETzo1dVOnpEy sKwYpX9+GK4XWql2cmeXp6SRIVRWQJ+D9MnD1lK6QKcrbbFMvFb1x/P9ZRU2k+2r1hHh LZng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=uzTZTyPO; dkim=pass header.i=@codewreck.org header.s=2 header.b=uzTZTyPO; 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=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a056402190b00b0044eab363b67si13982262edz.130.2022.10.04.16.12.26; Tue, 04 Oct 2022 16:12:53 -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=@codewreck.org header.s=2 header.b=uzTZTyPO; dkim=pass header.i=@codewreck.org header.s=2 header.b=uzTZTyPO; 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=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230121AbiJDWFn (ORCPT + 99 others); Tue, 4 Oct 2022 18:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230413AbiJDWFc (ORCPT ); Tue, 4 Oct 2022 18:05:32 -0400 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586983C8C1 for ; Tue, 4 Oct 2022 15:05:24 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id DB9BEC01C; Wed, 5 Oct 2022 00:05:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1664921121; bh=FmRYiMqfekn9AN8DpzCa2by7y35Y1eEzLukhmKFSTy8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uzTZTyPOXplk/lQKI5nszSC+A58/lowiQxhIE/DrvVRYLmw9NMGFSjZRbqR1zUm/b Wlq3SnqYnkGHypf5BTaeN0Wei7nQrn4JmEqsudZ8N+nK+gFdEy7GaCcah2vNyac1mh gtIiaKyzP/ZRHjYediSHLHBNIExSpDyG7wOh8OWpHh2uyMYY6gFj+atY51Ggx6Mzf9 D7GMTr3Xi07D/rTb8+6p3q4UjBXDaSJ2b7umU3+cmL3TnjocD1Yn38VRBHGujHyuuJ wh+7rG3DVQOf8mi06r/Wa/omBeDmFys01BkGfk4hNBi0Ab0fmOGzwFotIJzCAjXNxJ 8U/Juw+hjDNNw== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 87FD9C009; Wed, 5 Oct 2022 00:05:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1664921121; bh=FmRYiMqfekn9AN8DpzCa2by7y35Y1eEzLukhmKFSTy8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uzTZTyPOXplk/lQKI5nszSC+A58/lowiQxhIE/DrvVRYLmw9NMGFSjZRbqR1zUm/b Wlq3SnqYnkGHypf5BTaeN0Wei7nQrn4JmEqsudZ8N+nK+gFdEy7GaCcah2vNyac1mh gtIiaKyzP/ZRHjYediSHLHBNIExSpDyG7wOh8OWpHh2uyMYY6gFj+atY51Ggx6Mzf9 D7GMTr3Xi07D/rTb8+6p3q4UjBXDaSJ2b7umU3+cmL3TnjocD1Yn38VRBHGujHyuuJ wh+7rG3DVQOf8mi06r/Wa/omBeDmFys01BkGfk4hNBi0Ab0fmOGzwFotIJzCAjXNxJ 8U/Juw+hjDNNw== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id ddebc26d; Tue, 4 Oct 2022 22:05:17 +0000 (UTC) Date: Wed, 5 Oct 2022 07:05:02 +0900 From: Dominique Martinet To: Christian Schoenebeck Cc: v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Dan Carpenter , Leon Romanovsky , syzbot+67d13108d855f451cafc@syzkaller.appspotmail.com Subject: Re: [PATCH 1/2] 9p: client_create/destroy: only call trans_mod->close after create Message-ID: References: <20221004215114.1850991-1-asmadeus@codewreck.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221004215114.1850991-1-asmadeus@codewreck.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dominique Martinet wrote on Wed, Oct 05, 2022 at 06:51:13AM +0900: > destroy code would incorrectly call close() if trans_mod exists after some > hasty code cleanup: we need to make sure we only call close after create > > The new bool added to track this has been added in a hole of the struct > and will not increase p9_client's size. > It might be possible to do better with a bit more work, but that will > have to do for now. > > Link: https://lkml.kernel.org/r/00000000000015ac7905e97ebaed@google.com > Reported-by: syzbot+67d13108d855f451cafc@syzkaller.appspotmail.com > Reported-by: Leon Romanovsky > Fixes: 3ff51294a055 ("9p: p9_client_create: use p9_client_destroy on failure") Oh... Fixing tags for stable made me notice this actually wasn't merged into 5.19 unlike what I thought, so we only have the original bug of potentially freeing the idr with tags still in it. That's a much smaller bug and I'll just remove the first p9_client_destroy on failure patch for this merge window (small leak that requires root on error) ; then we can take time to properly fix this one way or another for next cycle. -- Dominique