lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <BY5PR04MB68493E6146C3C1A9ADB6525FBC5CA@BY5PR04MB6849.namprd04.prod.outlook.com>
Date: Tue, 22 Jul 2025 20:57:40 +0000
From: Kamaljit Singh <Kamaljit.Singh1@....com>
To: Hannes Reinecke <hare@...e.de>, "kbusch@...nel.org" <kbusch@...nel.org>,
	"axboe@...nel.dk" <axboe@...nel.dk>, hch <hch@....de>, "sagi@...mberg.me"
	<sagi@...mberg.me>, "linux-nvme@...ts.infradead.org"
	<linux-nvme@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
CC: "cassel@...nel.org" <cassel@...nel.org>, "dlemoal@...nel.org"
	<dlemoal@...nel.org>
Subject: Re: [PATCH v3 2/2] nvme: prevent admin controller from smart log
 fetch (LID 2)

Hi Hannes,

From: Hannes Reinecke <hare@...e.de>
Date: Tuesday, July 22, 2025 at 00:07
>> Similar to a discovery ctrl, prevent an admin-ctrl from getting a smart
>> log. LID 2 is optional for admin controllers to support.
>>
>> In the future when support for LID=0 (supported log pages) is added,
>> GLP accesses can be made smarter by basing such calls on response
>> from LID=0 reads.
>>
>> Reference: NVMe Base rev 2.2, sec 3.1.3.5, fig 31.
>> Signed-off-by: Kamaljit Singh <kamaljit.singh1@....com>
>> ---
>>   drivers/nvme/host/core.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 105127638c31..6e5c9871b76d 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -3705,7 +3705,7 @@ int nvme_init_ctrl_finish(struct nvme_ctrl *ctrl, bool was_suspended)
>>
>>       nvme_configure_opal(ctrl, was_suspended);
>>
>> -     if (!ctrl->identified && !nvme_discovery_ctrl(ctrl)) {
>> +     if (!ctrl->identified && !nvme_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl)) {
>>               /*
>>                * Do not return errors unless we are in a controller reset,
>>                * the controller works perfectly fine without hwmon.
>
>And to go with my suggestion for the previous patch, maybe it's
>an idea to have a helper 'nvme_io_queues_supported()' which could be
>used here (and in the previous patch)?

That's kinda where I was going with nvme_override_prohibited_io_queues().
But now that its flattened into direct code, that function doesn't exist
in v4 of this patch-set anymore.

In general, I do like the idea of a helper like nvme_io_queues_supported()
which can be applied to any controller type. But I'm not sure how it could
be used in this case, i.e. for a GLP LID=2 holdback.

We will also need to apply it at the right point so a user requested
parameter is also taken into account.

Regards,
Kamaljit

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ