linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: bcm: Move a couple of __counted_by initializations
@ 2024-04-25 16:55 Nathan Chancellor
  2024-04-25 16:55 ` [PATCH 1/2] clk: bcm: dvp: Assign ->num before accessing ->hws Nathan Chancellor
  2024-04-25 16:55 ` [PATCH 2/2] clk: bcm: rpi: " Nathan Chancellor
  0 siblings, 2 replies; 9+ messages in thread
From: Nathan Chancellor @ 2024-04-25 16:55 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Florian Fainelli
  Cc: Kees Cook, Gustavo A. R. Silva, bcm-kernel-feedback-list,
	linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-hardening,
	patches, llvm, stable, Nathan Chancellor

Hi all,

This series addresses two UBSAN warnings I see on my Raspberry Pi 4 with
recent releases of clang that support __counted_by by moving the
initializations of the element count member before any accesses of the
flexible array member.

I marked these for stable because more distributions are enabling the
bounds sanitizer [1][2], so the warnings will show up when the kernel is
built with a compiler that supports __counted_by, so it seems worth
fixing this for future users.

[1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1914685
[2]: https://src.fedoraproject.org/rpms/kernel/c/79a2207963b8fea452acfc5dea13ed54bd36c7e1

---
Nathan Chancellor (2):
      clk: bcm: dvp: Assign ->num before accessing ->hws
      clk: bcm: rpi: Assign ->num before accessing ->hws

 drivers/clk/bcm/clk-bcm2711-dvp.c | 3 ++-
 drivers/clk/bcm/clk-raspberrypi.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
base-commit: ed30a4a51bb196781c8058073ea720133a65596f
change-id: 20240424-cbl-bcm-assign-counted-by-val-before-access-cf19d630f2b4

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

end of thread, other threads:[~2024-04-30  0:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 16:55 [PATCH 0/2] clk: bcm: Move a couple of __counted_by initializations Nathan Chancellor
2024-04-25 16:55 ` [PATCH 1/2] clk: bcm: dvp: Assign ->num before accessing ->hws Nathan Chancellor
2024-04-25 17:15   ` Kees Cook
2024-04-25 21:26   ` Florian Fainelli
2024-04-30  0:04   ` Stephen Boyd
2024-04-25 16:55 ` [PATCH 2/2] clk: bcm: rpi: " Nathan Chancellor
2024-04-25 17:15   ` Kees Cook
2024-04-25 21:26   ` Florian Fainelli
2024-04-30  0:04   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).