mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nitesh Shetty <nj.shetty@samsung.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	James Smart <james.smart@broadcom.com>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	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
Date: Wed, 29 Nov 2023 21:24:51 +0530	[thread overview]
Message-ID: <20231129155451.ropb4udx6w4xmytb@green245> (raw)
In-Reply-To: <b94b300b-8c09-4246-bd98-95f7b4291c49@suswa.mountain>

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

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 <nj.shetty@samsung.com>
>> ---
>
>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

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2023-11-30  3:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20231128123622epcas5p4940679fbbafdf0da802deea3e531f850@epcas5p4.samsung.com>
2023-11-28 12:29 ` [PATCH 1/2] nvme: Update type from size_t to u16 for opts->queue_size Nitesh Shetty
     [not found]   ` <CGME20231128123634epcas5p201af168ff4ef4a8a129e5448bccca1a6@epcas5p2.samsung.com>
2023-11-28 12:29     ` [PATCH 2/2] nvme: prevent potential spectre v1 gadget Nitesh Shetty
2023-11-29  9:20       ` Sagi Grimberg
2023-11-29  9:27       ` Dan Carpenter
2023-11-29 15:54         ` Nitesh Shetty [this message]
2023-12-04  7:42       ` Christoph Hellwig
2023-12-04 16:40       ` Keith Busch
2023-11-29  9:22   ` [PATCH 1/2] nvme: Update type from size_t to u16 for opts->queue_size Sagi Grimberg
2023-11-29  9:26   ` Dan Carpenter
2023-11-29 10:48     ` Nitesh Shetty
2023-11-30  7:07       ` Dan Carpenter
2023-11-30  9:57         ` Nitesh Shetty
2023-11-29 12:15     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231129155451.ropb4udx6w4xmytb@green245 \
    --to=nj.shetty@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=dan.carpenter@linaro.org \
    --cc=error27@gmail.com \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nitheshshetty@gmail.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®