public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* Recent i2c-designware initialization fix
@ 2025-09-17 11:04 Jean Delvare
  2025-09-17 12:46 ` Ruhl, Michael J
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2025-09-17 11:04 UTC (permalink / raw)
  To: Michael J. Ruhl
  Cc: Andy Shevchenko, Andi Shyti, Jarkko Nikula, Mika Westerberg,
	Jan Dabros, linux-i2c

Hello Michael,

I have been looking into your kernel commit 3d30048958e0
("i2c/designware: Fix an initialization issue"), as it received a CVE
number (CVE-2025-38380), I was asked to evaluate the severity of the
bug.

I was not familiar with the i2c-designware driver so it took me some
reading time to form an opinion on the matter. But after a careful
review, my conclusion is that there was no actual bug in the first
place. If I'm correct then CVE-2025-38380 is invalid.

My reasoning is as follows:
* struct dw_i2c_dev is allocated per-PCI device in i2c_dw_pci_probe()
  using devm_kzalloc(), therefore all its members, including
  dev->msg_write_idx, are initialized to 0.
* The supposedly problematic code path is only taken if (dev->flags &
  MODEL_MASK) == MODEL_AMD_NAVI_GPU.
* The only place where dev->msg_write_idx is set to a non-zero value is
  in i2c_dw_xfer_msg(). This function is only called by i2c_dw_isr(),
  which in turn is only called if the device is not in polling mode.
* The flags set for the AMD Navi GPU devices are:
  dev->flags |= MODEL_AMD_NAVI_GPU | ACCESS_POLLING
  so these devices are always in polling mode and never use an
  interrupt so i2c_dw_isr() is never called for them.

If my reasoning is correct, then for the AMD Navi GPU devices,
dev->msg_write_idx is implicitly initialized to 0 at allocation time
and its value is never changed after that, so the explicit
initialization to 0 which has been added in amd_i2c_dw_xfer_quirk() is
a no-op.

What do you think? Am I missing something?

Thanks,
-- 
Jean Delvare
SUSE L3 Support

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

end of thread, other threads:[~2025-09-17 13:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 11:04 Recent i2c-designware initialization fix Jean Delvare
2025-09-17 12:46 ` Ruhl, Michael J
2025-09-17 13:07   ` Jean Delvare

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