lib/vsprintf: Call might_sleep() during restrictred pointer formatting

Depending on the system configuration, the restricted pointer formatting
might call into the security subsystem which might sleep.
As %pK is intended to be only used from read handlers of virtual files,
which always run in task context, this should never happen in practice.
However, developers have used %pK before from atomic context without
realizing this restriction. While all existing user of %pK through
printk() have been removed, new ones might be reintroduced accidentally
in the future.

Add a might_sleep(), so that misuse of %pK from atomic context is
detected right away.

Link: https://lore.kernel.org/lkml/20250113171731-dc10e3c1-da64-4af0-b767-7c7070468023@linutronix.de/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
1 file changed