Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp643232rdb; Fri, 17 Nov 2023 08:38:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWsE0HtN9E0rlZROUayQw1qeRvAOmYpvn7LmgC9Rfh7cS/ovW4t7Wffw821664OJbkuSDE X-Received: by 2002:a05:6830:1388:b0:6b9:c49f:1af7 with SMTP id d8-20020a056830138800b006b9c49f1af7mr12036535otq.20.1700239118364; Fri, 17 Nov 2023 08:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700239118; cv=none; d=google.com; s=arc-20160816; b=HjoA43pV7RygA/s8VvXbs1TUrmODLi5tv6vwrHaKUCKGFOzFsZg1x5KX32GHmEuOTU /sSgDKv50omcdN6gxQhz3omMSQ/ZS/vHaz4IHiVd+0YSNjpbPSucSWoXOqUlNsu10x8k 1YgRya5R2qxsNkaWp/1LJ+z9Suuap/IgKNrSfs9BVPd8b+Eb8WxEmHavECz9FyXLuP8s kkXjXYpuLvg4E4saWO4NtI+kw6+sNmod92mzW3aAA1GGPqoS9mA6PPgh1xDgwjmhJLud aaQQaFZXLDhPkxRUDudah4n8+90ZEYPVKkNdBNUnsnXs/fiZyHVnrhzs25TIaGd0zMA/ lk2A== 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; bh=BrMevhEC+HBsYKCclRMK+YLRfR26OsglMgWcETLYBFU=; fh=uIsKaVkBAhtrRztjYTGOUq2EHANe6EQS2BujhJdH3ug=; b=zf0f6teD0o8DhHn6bbwCGeil4sN/aallnLFR3+hI7zMjeWl//8ye3hilQIkLakLYae E1s+HqIDrepjWJc+73X22UEtrP/DV369SF2taswWKlM0R7gpXP2MNU9X+6EEzEw4hSND fnaco1/W2oS9RHPoV7sTBaPpDWP3l987jTgJrj5oeF4DAxN5lcSWPu6dcajkjHmnXqgO AIvYGqxMqESjWDM7ViQG6uc3LCKypFkYYDvhStl4Hh46R8T0sMk+cQelp6uToJw1NWnb JflsI74tTrAnG68g1NqGfAJLHHNtXbqjB9MbvyW7Q3L8AuwdZ8Gf3cMR2eLKNlsKq5qi RbwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VI8dahV4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id 33-20020a631061000000b005be3683ec6asi2185685pgq.184.2023.11.17.08.38.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:38:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VI8dahV4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 855DD82291B8; Fri, 17 Nov 2023 08:38:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231589AbjKQQi1 (ORCPT + 99 others); Fri, 17 Nov 2023 11:38:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbjKQQi0 (ORCPT ); Fri, 17 Nov 2023 11:38:26 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34ABAA4 for ; Fri, 17 Nov 2023 08:38:23 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5364FC433C7; Fri, 17 Nov 2023 16:38:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700239102; bh=3MM1YohxYnrQgmM0ptEo/aF7UCmmakmOqrWmEGOq100=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VI8dahV4Mt0aY7x/ngOvr+2O7q+DqJZgFPITlqGN6kga6t4ypIugxms7RHZOhxEv1 JkDYnVg2PVDJyIUEv2y/Ii0A8sqySjXpSII87E+YfOhcKCMM0vlaF1lUGVFGWmXtrU PcDpF0ZJrghl4yYSN30/cNQjnW25ejKQDt/j8d0vctLksqV1wKj7VyzgwIgRQW70wR K/DUNX+GHW1ueSkLasPnQVMvJbsKAUM+MvCC/9yr7CehEEkJQEgcZr0Gu9FmZegk9E +ZS9hlCxcpv30PbAfASky84LZCztOoFsfg3eWzlJl2qLlPMhY11MRdrSL4DzIYqcwl O0gtb5ivexILg== Date: Fri, 17 Nov 2023 09:38:19 -0700 From: Keith Busch To: Christoph Hellwig Cc: Yuanyuan Zhong , Jens Axboe , sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, randyj@purestorage.com, hcoutinho@purestorage.com Subject: Re: [PATCH] nvme-core: remove head->effects to fix use-after-free Message-ID: References: <20231115185439.2616073-1-yzhong@purestorage.com> <69218380-45f0-41cc-8a65-50878d44219e@kernel.dk> <20231117132846.GB7867@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117132846.GB7867@lst.de> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 08:38:32 -0800 (PST) On Fri, Nov 17, 2023 at 02:28:46PM +0100, Christoph Hellwig wrote: > On Wed, Nov 15, 2023 at 10:52:01PM -0500, Keith Busch wrote: > > > > Yes, in section 5.16.1.6, "Commands Supported and Effects": > > > > This log page is used to describe the commands that the controller > > supports and the effects of those commands on the state of the NVM > > subsystem. > > > > Oddly enough, Figure 202 says the scope of the log page is "Controller" > > rather than "Subsystem". Sounds like ECN potential. You can memcmp the > > effects log from each controller for a sanity check if you think some > > subsystem controllers messed that up. > > If we really want to be 111% sure we could read the effects for all > controllers and do a logical OR of them, but I think the reason for the > per-controller scope is that for odd subsystems where different > controllers don't actually access the same namespaces these flags > could be different, i.e. one that only does KV, one that does ZNS, > one that does NVM and one that is just an administrative controller. The effects log is per-CSI so different command sets won't create conflicts. Namespaces that are not shared don't really matter here because this problem is unique to mulitpath. It doesn't make sense for effects logs to be different per-controller for the same shared namespace. The spec doesn't seem to explicitly prevent that, but hints that all hosts should be seeing the same thing no matter which controller they're connected to: " If the namespace is attached to multiple controllers, the host(s) associated with those controllers should coordinate their commands to meet the Command Submission and Execution requirements " That couldn't be a reliable suggestion if the hosts observe diverging effects. For the controllers that a host does see, though, I agree we should use the most cautious effects reported with logical OR of them.