Skip to content

Commit cde9f49

Browse files
committed
i2c/designware: Fix an initialization issue
jira LE-4076 cve CVE-2025-38380 Rebuild_History Non-Buildable kernel-6.12.0-55.29.1.el10_0 commit-author Michael J. Ruhl <[email protected]> commit 3d30048 The i2c_dw_xfer_init() function requires msgs and msg_write_idx from the dev context to be initialized. amd_i2c_dw_xfer_quirk() inits msgs and msgs_num, but not msg_write_idx. This could allow an out of bounds access (of msgs). Initialize msg_write_idx before calling i2c_dw_xfer_init(). Reviewed-by: Andy Shevchenko <[email protected]> Fixes: 17631e8 ("i2c: designware: Add driver support for AMD NAVI GPU") Cc: <[email protected]> # v5.13+ Signed-off-by: Michael J. Ruhl <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit 3d30048) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 9c864bb commit cde9f49

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/i2c/busses/i2c-designware-master.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ static int amd_i2c_dw_xfer_quirk(struct i2c_adapter *adap, struct i2c_msg *msgs,
345345

346346
dev->msgs = msgs;
347347
dev->msgs_num = num_msgs;
348+
dev->msg_write_idx = 0;
348349
i2c_dw_xfer_init(dev);
349350

350351
/* Initiate messages read/write transaction */

0 commit comments

Comments
 (0)