]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: qemu_fw_cfg: fix sysfs information leak
authorJohan Hovold <johan@kernel.org>
Wed, 1 Dec 2021 13:25:27 +0000 (14:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Dec 2021 09:14:52 +0000 (10:14 +0100)
commitf3cf471d0982ff8991f3c9fb5d1acb144dde18fe
tree3bfe692bdd9e3d13aae9916b19ec7e7f1782c401
parent8530392e9f92c8118d2603ec2aa0dceb1bff64a2
firmware: qemu_fw_cfg: fix sysfs information leak

Make sure to always NUL-terminate file names retrieved from the firmware
to avoid accessing data beyond the entry slab buffer and exposing it
through sysfs in case the firmware data is corrupt.

Fixes: 020051851d65 ("firmware: introduce sysfs driver for QEMU's fw_cfg device")
Cc: stable@vger.kernel.org # 4.6
Cc: Gabriel Somlo <somlo@cmu.edu>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20211201132528.30025-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/qemu_fw_cfg.c