Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v4 0/2] nvmem-reboot-mode: support small reboot mode magic
@ 2025-02-28 18:03 Jennifer Berringer
  2025-02-28 18:03 ` [PATCH v4 1/2] nvmem: core: add nvmem_cell_size() Jennifer Berringer
  2025-02-28 18:03 ` [PATCH v4 2/2] power: reset: nvmem-reboot-mode: support smaller magic Jennifer Berringer
  0 siblings, 2 replies; 5+ messages in thread
From: Jennifer Berringer @ 2025-02-28 18:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Sebastian Reichel
  Cc: linux-kernel, linux-pm, Jennifer Berringer

Hi all,

These patches allow nvmem-reboot-mode to handle devices with a
reboot-mode cell smaller than 4 bytes, such as Qualcomm SA8775P. Without
this change, nvmem_reboot_mode_write() tries to write 4 bytes to a
1-byte nvmem cell and fails with the message "update reboot mode bits
failed" on affected devices.

This issue previously resulted in an out-of-bounds heap write but, after
one of my patches from v3 of this series was accepted, it results in
that error message instead.

[1]
https://lore.kernel.org/all/20241104152312.3813601-2-jberring@redhat.com/

v4:
- Excluded one patch which was accepted from v3 [1]:
	"nvmem: core: improve range check for nvmem_cell_write()"
- Handle truncation of the reboot mode magic in nvmem-reboot-mode
  instead of in nvmem core.
- Introduced nvmem_cell_size().

v3:
- Accepted suggestion for changing nvmem_cell_write bounds check

v2:
- Added missing function definition for CONFIG_NVMEM=n

Jennifer Berringer (2):
  nvmem: core: add nvmem_cell_size()
  power: reset: nvmem-reboot-mode: support smaller magic

 drivers/nvmem/core.c                    | 18 ++++++++++++++++++
 drivers/power/reset/nvmem-reboot-mode.c |  9 ++++++++-
 include/linux/nvmem-consumer.h          |  6 ++++++
 3 files changed, 32 insertions(+), 1 deletion(-)


base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
-- 
2.47.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-08  4:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 18:03 [PATCH v4 0/2] nvmem-reboot-mode: support small reboot mode magic Jennifer Berringer
2025-02-28 18:03 ` [PATCH v4 1/2] nvmem: core: add nvmem_cell_size() Jennifer Berringer
2025-03-07 17:42   ` Srinivas Kandagatla
2025-03-08  4:38     ` Jennifer Berringer
2025-02-28 18:03 ` [PATCH v4 2/2] power: reset: nvmem-reboot-mode: support smaller magic Jennifer Berringer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox