]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: core: use sysfs_emit() instead of sprintf()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Tue, 8 Feb 2022 12:02:15 +0000 (15:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:25 +0000 (13:57 +0200)
commitc4ab65738ab3e21fe519ee46b2051222bc8e32ef
tree55f5045ca0e30b767dde0b730cdcb81a496bd5ba
parent67f7bd9ff9079c1ee2de58e024fb582905c74c16
mmc: core: use sysfs_emit() instead of sprintf()

commit f5d8a5fe77ce933f53eb8f2e22bb7a1a2019ea11 upstream.

sprintf() (still used in the MMC core for the sysfs output) is vulnerable
to the buffer overflow.  Use the new-fangled sysfs_emit() instead.

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/717729b2-d65b-c72e-9fac-471d28d00b5a@omp.ru
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/core/bus.c
drivers/mmc/core/bus.h
drivers/mmc/core/mmc.c
drivers/mmc/core/sd.c
drivers/mmc/core/sdio.c
drivers/mmc/core/sdio_bus.c