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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 3 Nov 2023 13:11:02 +0100
From:   Daniel Wagner <dwagner@...e.de>
To:     Keith Busch <kbusch@...nel.org>
Cc:     linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Christoph Hellwig <hch@....de>,
        Niklas Cassel <Niklas.Cassel@....com>,
        Kenji Tomonaga <tkenbo@...il.com>
Subject: Re: [PATCH v3] nvme: update firmware version after commit

On Tue, Oct 31, 2023 at 10:08:53AM -0600, Keith Busch wrote:
> On Mon, Oct 30, 2023 at 05:00:44PM +0100, Daniel Wagner wrote:
> > The firmware version sysfs entry needs to be updated after a successfully
> > firmware activation.
> > 
> > nvme-cli stopped issuing an Identify Controller command to list the
> > current firmware information and relies on sysfs showing the current
> > firmware version.
> > 
> > Reported-by: Kenji Tomonaga <tkenbo@...il.com>
> > Signed-off-by: Daniel Wagner <dwagner@...e.de>
> 
> Thanks, applied for nvme-6.7.

I've got negative feedback from one of our customer. I've annotate the
code with

	dev_info(ctrl->device, "afi: %#x\n", log->afi);
	for (i = 0; i < 7; i++) {
		dev_info(ctrl->device, "frs%d: %.*s\n", i + 1,
			 nvme_strlen((char *)&log->frs[i], sizeof(ctrl->subsys->firmware_rev)),
			 (char *)&log->frs[i]);
	}


[  124.824812] nvme nvme8: afi: 0x3
[  124.824824] nvme nvme8: frs1: 0.4.0
[  124.824828] nvme nvme8: frs2: 0.3.0
[  124.824832] nvme nvme8: frs3: 0.4.0
[  124.824835] nvme nvme8: frs4:
[  124.824837] nvme nvme8: frs5:
[  124.824840] nvme nvme8: frs6:
[  124.824842] nvme nvme8: frs7:


This particular firmware seem to interpret afi one based, while
the this patch assumes it is zero based


	memcpy(ctrl->subsys->firmware_rev, &log->frs[log->afi & 0x7],
		sizeof(ctrl->subsys->firmware_rev));


The spec says


  Active Firmware Info (AFI): Specifies information about the active
                              firmware revision.

  Bit 7    is reserved.
  Bits 6:4 indicates the firmware slot that is going to be activated
           at the next Controller Level Reset. If this field is 0h,
           then the controller does not indicate the firmware slot that
           is going to be activated at the next Controller Level Reset.
  Bit 3    is reserved.
  Bits 2:0 indicates the firmware slot from which the actively running
           firmware revision was loaded.


It's not clear to me if afi bits 2:0 is zero or one based. Bits 6:4
indicate to be 1 based.

Any ideas how to handle this?

Thanks,
Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ