Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp46688rdb; Wed, 29 Nov 2023 19:36:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFUnEigYAgEcuU6VbTKc04svYb7DRniz1YpAslJv7usuuYOrR60L4vguu+etMB2enPiaRQ X-Received: by 2002:a05:6808:1710:b0:3b6:da98:437c with SMTP id bc16-20020a056808171000b003b6da98437cmr25259195oib.0.1701315370232; Wed, 29 Nov 2023 19:36:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701315370; cv=none; d=google.com; s=arc-20160816; b=M6hksOX8jJ7VuBViBtHcLYBjHc4An568RHB3ygQSe1746G8ToKhQsLvPOF3w+uqxj/ FGPJEnqix5j/J6lkh2WgoqOqTroWzdUngpmTbSTL0jE7O6w6/bx/04+6/MIRj5X4u9Te G7KrKqRbsDKB4kGCenaxjBB6csbLc0O0EGHyPvz5ucO436yJy1OpBPaNIxDLlJvvNjOF ZNPFWriU3X7keNtgNsXHrmXOfKGMvweWGCvghZC4XhkPBI5eDY6F+VmrZku5Bmr13tdA +aadCHkfvn+tQIhanjn7Nw6MUcNJvGl2wIJsoLnHF29xW0499Ds8aJOr5a+sOxn+oElP d8TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:user-agent :in-reply-to:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=/WaH6IK/Rfh6jZJ/G83i6v0SV3kGzQkyWCRANtlqumo=; fh=fb/ewYt++C2l/vHXl5gHJA9HV3n01+XxJZvNUZgBSJU=; b=Lk44lg8Rqx6MX7mdwVWzWc/WHf6SfYVpYAYrFhhslUZ0uX/9nJqztZn/aMCKQGvjwO z7AFzvFUnzg4Kji6NK2zNr4JKTLjbTt9exk8lR72CAaMs2xsQpyNtJ90DV+GW8DS+Gw9 cSvN7RcVSwBrXDdtSladgfg1saidJOzaKUfgDUSW/LWFMJEY6wvHbLtaAmZlFkGMOYgk 75gR0bx8snzPc4dumhsfAv+Ysh20zqA0+cXeaCy+yIPl0kgrJQiuRu4yCdMVzN8MOoXP 8Nx9ztMtlYTYRL0nvFFC9hCUKZhE5gsc9/h6wbAsR4rBX1eydFi7z8vI423QVWe0Q1d5 xrEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WK3PKD1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k18-20020a6568d2000000b005b86142ee56si358202pgt.277.2023.11.29.19.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 19:36:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WK3PKD1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6570C80C7AED; Wed, 29 Nov 2023 19:36:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231640AbjK3Dfv (ORCPT + 99 others); Wed, 29 Nov 2023 22:35:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbjK3Dfu (ORCPT ); Wed, 29 Nov 2023 22:35:50 -0500 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 160071B4 for ; Wed, 29 Nov 2023 19:35:55 -0800 (PST) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20231130033548epoutp03ac2a06eb413b440b48429ab6beb5f02e~cSUu9lLMU3074830748epoutp03t for ; Thu, 30 Nov 2023 03:35:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20231130033548epoutp03ac2a06eb413b440b48429ab6beb5f02e~cSUu9lLMU3074830748epoutp03t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1701315348; bh=/WaH6IK/Rfh6jZJ/G83i6v0SV3kGzQkyWCRANtlqumo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WK3PKD1BItYWEZ9tb3goSwLB/aAEd68CWvqMkPiUe6/jOGqx6JxLkNxZsbTcdvjYM iNxq/yznUP3ipWavOp1prGTbSbkskMrveRDwWOzg/n6PzQNvM6zQguWFiPtubh34/d wbkUcHBxRgjRDZ13F06Cng9pJ60Oh7hDX1ggE0wA= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20231130033548epcas5p18300b72735a92bf19048b3756f643cf0~cSUuMUTBk0076600766epcas5p1z; Thu, 30 Nov 2023 03:35:48 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.180]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Sghfp5Z1Jz4x9Q0; Thu, 30 Nov 2023 03:35:46 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 6D.B5.09634.21308656; Thu, 30 Nov 2023 12:35:46 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20231129160110epcas5p4913da50d344becbe1fde0c076d1e1c3d~cI2O8sIA51449514495epcas5p4y; Wed, 29 Nov 2023 16:01:10 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231129160110epsmtrp22fa9234405d24364f4660074cf38c6bc~cI2O72s1D2435724357epsmtrp2K; Wed, 29 Nov 2023 16:01:10 +0000 (GMT) X-AuditID: b6c32a49-eebff700000025a2-33-65680312b377 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 9E.7A.18939.64067656; Thu, 30 Nov 2023 01:01:10 +0900 (KST) Received: from green245 (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231129160108epsmtip15276ccd6c632ab09a58b12fdc7bba6fe~cI2NPSQPe2199321993epsmtip1c; Wed, 29 Nov 2023 16:01:08 +0000 (GMT) Date: Wed, 29 Nov 2023 21:24:51 +0530 From: Nitesh Shetty To: Dan Carpenter Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , James Smart , Chaitanya Kulkarni , error27@gmail.com, gost.dev@samsung.com, nitheshshetty@gmail.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] nvme: prevent potential spectre v1 gadget Message-ID: <20231129155451.ropb4udx6w4xmytb@green245> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20171215 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAJsWRmVeSWpSXmKPExsWy7bCmlq4Qc0aqwZ0DQhar7/azWXyY18pu 8WiZn8XNAzuZLFauPspksXvhRyaLSYeuMVo8vTqLyeLyrjlsFvOXPWW32PGkkdFi3ev3LA48 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9u//NXygvbTLr5+x/SZnezLUTlWOXuXzRMj5+ 6VfNqY9Rtd+f++/bsJBV6IOJk+wJt54Lz9fYPti6IPPJV4mKfwaV5kdmGimxFGckGmoxFxUn AgCMvymGHwMAAA== X-CMS-MailID: 20231129160110epcas5p4913da50d344becbe1fde0c076d1e1c3d X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----E2FLEX3VNKXZtTxXMF9-IQsaSIEoxQsaU5Vw1-qQHlNadj4Z=_1b44d_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231128123634epcas5p201af168ff4ef4a8a129e5448bccca1a6 References: <20231128122958.2235-1-nj.shetty@samsung.com> <20231128122958.2235-2-nj.shetty@samsung.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 19:36:07 -0800 (PST) ------E2FLEX3VNKXZtTxXMF9-IQsaSIEoxQsaU5Vw1-qQHlNadj4Z=_1b44d_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline On 29/11/23 12:27PM, Dan Carpenter wrote: >On Tue, Nov 28, 2023 at 05:59:57PM +0530, Nitesh Shetty wrote: >> This patch fixes the smatch warning, "nvmet_ns_ana_grpid_store() warn: >> potential spectre issue 'nvmet_ana_group_enabled' [w] (local cap)" >> Prevent the contents of kernel memory from being leaked to user space >> via speculative execution by using array_index_nospec. >> >> Signed-off-by: Nitesh Shetty >> --- > >When it comes to adding array_index_nospec(), then I don't know enough >about it to comment. > Upon smatch's warning, I referred to kernel documentation[1]. Using array_index_nospec should avoid memory leak. Thank you, Nitesh Shetty [1] https://www.kernel.org/doc/Documentation/speculation.txt ------E2FLEX3VNKXZtTxXMF9-IQsaSIEoxQsaU5Vw1-qQHlNadj4Z=_1b44d_ Content-Type: text/plain; charset="utf-8" ------E2FLEX3VNKXZtTxXMF9-IQsaSIEoxQsaU5Vw1-qQHlNadj4Z=_1b44d_--