Re: [PATCH RESEND] i2c: mt7621: fix copying uninitialized kernel stack with reduced page_len
From: Christian Marangi (Ansuel)
Date: Mon Oct 26 2026 - 19:05:13 EST
Il giorno lun 26 ott 2026 alle ore 23:59 Andi Shyti
<andi.shyti@xxxxxxxxxx> ha scritto:
>
> On Thu, Oct 22, 2026 at 09:38:51PM +0200, Christian Marangi wrote:
> > When a page_len is less than 5 bytes in mtk_i2c_xfer, uninitialized kernel
> > stack data is copied and written to REG_SM0D1_REG. Equally on the read
> > part, an unnecessary read is done.
> >
> > Guard these extra copy/write and read for the page_len to fix leaking
> > uninitialized stack memory.
> >
> > Fixes: d04913ec5f89 ("i2c: mt7621: Add MediaTek MT7621/7628/7688 I2C driver")
> > Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
> > ---
>
> BTW, this is not a RESEND, this is a V2 because the patch is
> completely different from the supposed first send.
>
> Next time, please version it properly and add the changelog.
>
I used the RESEND tag for this as the first submission was
completely wrong and didn't reflect the actual changes.
(file got mixed on saving and committing)
Had to be more clear and maybe just say ignore the previous patch?
(a v2 implied that i made changes to that patch but there weren't)
Anyway corner case... sorry won't happen again :(