]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
visorbus: fix uninitialized variable access
authorArnd Bergmann <arnd@arndb.de>
Tue, 7 Jan 2020 20:29:40 +0000 (21:29 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:50:48 +0000 (10:50 +0200)
commitb85fcda3679e3ceafc6744525d32b1f319d1dc3e
tree2b25baca392e68db9b8c66ba966a1eb3d0731916
parentf21189ade6e7935f019eceb9bd01066ffd973177
visorbus: fix uninitialized variable access

BugLink: https://bugs.launchpad.net/bugs/1867837
[ Upstream commit caf82f727e69b647f09d57a1fc56e69d22a5f483 ]

The setup_crash_devices_work_queue function only partially initializes
the message it sends to chipset_init, leading to undefined behavior:

drivers/visorbus/visorchipset.c: In function 'setup_crash_devices_work_queue':
drivers/visorbus/visorchipset.c:333:6: error: '((unsigned char*)&msg.hdr.flags)[0]' is used uninitialized in this function [-Werror=uninitialized]
  if (inmsg->hdr.flags.response_expected)

Set up the entire structure, zero-initializing the 'response_expected'
flag.

This was apparently found by the patch that added the -O3 build option
in Kconfig.

Fixes: 12e364b9f08a ("staging: visorchipset driver to provide registration and other services")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200107202950.782951-1-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/unisys/visorbus/visorchipset.c