um: Don't use vfprintf() for os_info()
authorBenjamin Berg <benjamin@sipsolutions.net>
Fri, 10 Nov 2023 11:03:41 +0000 (12:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:31 +0000 (20:14 +0000)
commita4378abcbb8c42a8f54db7759beac55ea13c1b7f
tree967ac7c5fe1c10c42172677eab9c35c9f0753f4e
parent976c46e6964ceb70e0786d5491665c65a24f48a3
um: Don't use vfprintf() for os_info()

[ Upstream commit 236f9fe39b02c15fa5530b53e9cca48354394389 ]

The threads allocated inside the kernel have only a single page of
stack. Unfortunately, the vfprintf function in standard glibc may use
too much stack-space, overflowing it.

To make os_info safe to be used by helper threads, use the kernel
vscnprintf function into a smallish buffer and write out the information
to stderr.

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/os-Linux/util.c