[PATCH] ASoC: cros_ec_codec: fix uninitialized memory read

Tzung-Bi Shih tzungbi at google.com
Fri Dec 4 10:05:37 CET 2020


On Fri, Dec 4, 2020 at 4:28 PM Arnd Bergmann <arnd at kernel.org> wrote:
>
> On Fri, Dec 4, 2020 at 3:56 AM Tzung-Bi Shih <tzungbi at google.com> wrote:
> >
> > On Fri, Dec 4, 2020 at 6:55 AM Arnd Bergmann <arnd at kernel.org> wrote:
> >
> > In the case in i2s_rx_event(), only the "cmd" member is used.  But it
> > is fine to please the compiler.
>
> I wouldn't do it just to please the compiler. I sent this patch since
> the code clearly copies the uninitialized data here. If only
> one byte is meant to be copied, then we should change the
> function call to not pass the entire structure. I'll send a new
> patch for that.

My sentence may confuse you.  But I mean: the uninitialized data
doesn't introduce any bugs because it only uses the first byte in the
case.

Instead of your v2
(https://patchwork.kernel.org/project/alsa-devel/patch/20201204083624.2711356-1-arnd@kernel.org/),
I prefer this version v1.


More information about the Alsa-devel mailing list