[Linux-kernel-mentees] [PATCH] firewire: Prevent kernel-infoleak in ioctl_get_info()
yepeilin.cs at gmail.com
Mon Jul 27 15:40:33 UTC 2020
On Mon, Jul 27, 2020 at 05:35:12PM +0200, Arnd Bergmann wrote:
> On Mon, Jul 27, 2020 at 5:18 PM Peilin Ye <yepeilin.cs at gmail.com> wrote:
> > ioctl_get_info() is copying uninitialized stack memory to userspace due to
> > the compiler not initializing holes in statically allocated structures.
> > Fix it by initializing `event` using memset() in fill_bus_reset_event().
> > Cc: stable at vger.kernel.org
> > Suggested-by: Dan Carpenter <dan.carpenter at oracle.com>
> > Suggested-by: Arnd Bergmann <arnd at arndb.de>
> > Signed-off-by: Peilin Ye <yepeilin.cs at gmail.com>
> Acked-by: Arnd Bergmann <arnd at arndb.de>
> I would recommend always looking through the git history of the
> file to come up with an appropriate 'Fixes' tag. In this case
> $ git log -p --follow drivers/firewire/core-cdev.c
> searching for any mention of fill_bus_reset_event leads you to
> commit 344bbc4de14e.
> In my ~/.gitconfig I have this alias:
> abbrev = 12
> fixes = show --format='Fixes: %h (\"%s\")' -s
> With something like that, calling 'git fixes 344bbc4de14e' produces
> the line to copy:
> Fixes: 344bbc4de14e ("firewire: Generalize get_config_rom to get_info.")
Thank you for the advice! Actually I did all of that (manually...) but
wasn't sure whether I should add it on. I will send a v2 soon, and do so
for future patches.
More information about the Linux-kernel-mentees