Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp359887rwb; Wed, 28 Sep 2022 03:51:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Qdm/2YnUqQxW7Oku4P1X528GQPI3Ysj2avEUFexafDdILJHM2arqpOWK2yM4y0qxFVA8F X-Received: by 2002:a05:6402:42c7:b0:451:e6a6:48b5 with SMTP id i7-20020a05640242c700b00451e6a648b5mr32911432edc.113.1664362302516; Wed, 28 Sep 2022 03:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664362302; cv=none; d=google.com; s=arc-20160816; b=bzN0sQSIVzzsb5DktAc3yeRkja93YT1Y5/1PBaVUYE6YzbpltDb8LQVSTkK/bbd3+3 VrxVRjhjZSPnUQmPfe8rd6lhS+zlmUrp1Ee0zxLVXmMqjv/qSlYtOWFanQEgOoe9hsLx NINkXOC15MMS7HboaLb7laE8u83Mge2W1IT5smvXs78nKhpgOcJjDqEMqyclRjGk3Xxu 2++MhghoNZrPLKax8OHSW9u8HNWjshBfwZxeBCZqInEUPPT47Z7dhg0Bl8+y9GO72sls lkEMm94Xf6yWvYI4ZojmyTQn0aSbr1yEMKLmAYr7aazQqWHloGSYxPOY7Dzbv/sBn6LC O+qA== 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=EvXbEFxQNdXNjXs7AJIIbkBlKOTDWURW3rNF1wbER1E=; b=hxK9iRssGuDSb1Wr6PRdJTeWHN5N0bsaABWSphYKBegHLvhZZb7hB9XlE4Eiy5Fbfq ITiX5LAQFZsuamcLumh7aVFA/ZRfZqMS9LrXSwkmrA+52NvOk+p580XWObcK8kwQP3LP gzuTgs35tGarQvIFAUC+QObSU+BuWzmWsVZGWFzwkP50CmYN/Db22/8fq6VHPsbAteUL koPFsIYkgU5I/IWytHko1CiPc7X5UDbOoVLF+DkDwORXQ85opkvAqtOxHKAoohNeSUvG nYqMp4C/iK8fabWeb8pB+m7F+7n5qDFKo7tCzNWPHpL/TQCBxiIkgxOXItylG/mSKV92 wnSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=vokmBuvK; dkim=pass header.i=@codewreck.org header.s=2 header.b=AXSJASx2; 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 l25-20020a056402231900b004577e83e9e7si4048698eda.121.2022.09.28.03.51.16; Wed, 28 Sep 2022 03:51:42 -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=vokmBuvK; dkim=pass header.i=@codewreck.org header.s=2 header.b=AXSJASx2; 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 S233638AbiI1KoM (ORCPT + 99 others); Wed, 28 Sep 2022 06:44:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233181AbiI1KoI (ORCPT ); Wed, 28 Sep 2022 06:44:08 -0400 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E4798FD4F; Wed, 28 Sep 2022 03:44:04 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id 7E4ADC023; Wed, 28 Sep 2022 12:44:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1664361841; bh=EvXbEFxQNdXNjXs7AJIIbkBlKOTDWURW3rNF1wbER1E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vokmBuvKdWBfIpUbwZ7i/3q2hrKrm2wEuzat92Z1AF/zj0D9kzGs09EGTskVFdcp5 RPctkXOosyC+QnxuVv7WYeNd3iV1fOi1S1z04oEABiRdNqGvKeIypr0AUEKcHcklGS U6Fn4YT6mTUbezR3aOe0sszkBSqEdaxHsKBirFEvegr40psAIcHiDGj2r1fhSb91Xj IeZoNjbpSsW3AsJEo1YNp8NSpG+dAtbGYSFRZodtaZqE2GQOrtxNAGyZvdsLUvefHu O/6qoNFdVSYuBnvkCIOjQaW1AGyX9mlDEqbnaETdilWVqY3cKtDnlHotEici9VIHKo DLb2U87rc5XmA== 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 0F6EFC009; Wed, 28 Sep 2022 12:43:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1664361839; bh=EvXbEFxQNdXNjXs7AJIIbkBlKOTDWURW3rNF1wbER1E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AXSJASx2rKt3OmXZHdDAhyLDgaBuDsRfjikOIp0W5tPVaAKfuxOGXlRUUw31K3qC4 PnF8Gi3tOFo8OMlC7gNyMRG6Lvx369KHzi2VkpJf0LNljef6nuKFHAEWkjTxMtdNY1 4D4ELzPTvgilOIqebWxX38SORBWA3xYRnzcOXNPCprhmYplTpH+pmjEZf9tmgl9BdQ yTeqVMQXOIgXz1vqdv+za4CjStU9IuuOBeCDMoUkj6h66u88a/pJPgajrUxe7uqVRM azi0lrDCSS5cxI2NKcLdJX/kd3dX0oNGxsWR8fBOuCjj39NJZktnx+OcrhrOmYCi0m PyiYOvvDBhJcA== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id 9a16ec6e; Wed, 28 Sep 2022 10:43:53 +0000 (UTC) Date: Wed, 28 Sep 2022 19:43:38 +0900 From: asmadeus@codewreck.org To: Leon Romanovsky Cc: syzbot , davem@davemloft.net, edumazet@google.com, ericvh@gmail.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux_oss@crudebyte.com, lucho@ionkov.net, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com, v9fs-developer@lists.sourceforge.net Subject: Re: [syzbot] KASAN: use-after-free Read in rdma_close Message-ID: References: <00000000000015ac7905e97ebaed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Leon Romanovsky wrote on Wed, Sep 28, 2022 at 01:07:23PM +0300: > The bug is in commit 3ff51294a055 ("9p: p9_client_create: use p9_client_destroy on failure"). Thanks for looking > It is wrong to call to p9_client_destroy() if clnt->trans_mod->create fails. hmm that's a bit broad :) But I agree I did get that wrong: trans_mod->close() wasn't called if create failed. We do want the idr_for_each_entry() that is in p9_client_destroy so rather than revert the commit (fix a bug, create a new one..) I'd rather split it out in an internal function that takes a 'bool close' or something to not duplicate the rest. (Bit of a nitpick, sure) I'll send a patch and credit you in Reported-by unless you don't want to. -- Dominique