]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Tue, 25 Jan 2022 11:05:32 +0000 (12:05 +0100)
commitca66640bc48acde783fe714c7a7d524bbc213ae8
tree716455096ed07b02f3d510453caf6e82adfe1ba4
parent4fe2da759e9eb51e3e92cc5294f430cec0641024
firmware: qemu_fw_cfg: fix sysfs information leak

BugLink: https://bugs.launchpad.net/bugs/1958977
commit 1b656e9aad7f4886ed466094d1dc5ee4dd900d20 upstream.

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: 75f3e8e47f38 ("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: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/firmware/qemu_fw_cfg.c