diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2021-04-23 12:45:29 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-11 15:47:40 +0300 |
commit | 051dd0681ce13e15aec4201f0b9cdfc8f5fda631 (patch) | |
tree | ce9a64608e8b6348d9727a15ec8ba7103db88963 /lib/vsprintf.c | |
parent | 1cb02dc76f4c0a2749a02b26469512d6984252e9 (diff) | |
download | linux-051dd0681ce13e15aec4201f0b9cdfc8f5fda631.tar.xz |
lib/vsprintf.c: remove leftover 'f' and 'F' cases from bstr_printf()
commit 84696cfaf4d90945eb2a8302edc6cf627db56b84 upstream.
Commit 9af7706492f9 ("lib/vsprintf: Remove support for %pF and %pf in
favour of %pS and %ps") removed support for %pF and %pf, and correctly
removed the handling of those cases in vbin_printf(). However, the
corresponding cases in bstr_printf() were left behind.
In the same series, %pf was re-purposed for dealing with
fwnodes (3bd32d6a2ee6, "lib/vsprintf: Add %pfw conversion specifier
for printing fwnode names").
So should anyone use %pf with the binary printf routines,
vbin_printf() would (correctly, as it involves dereferencing the
pointer) do the string formatting to the u32 array, but bstr_printf()
would not copy the string from the u32 array, but instead interpret
the first sizeof(void*) bytes of the formatted string as a pointer -
which generally won't end well (also, all subsequent get_args would be
out of sync).
Fixes: 9af7706492f9 ("lib/vsprintf: Remove support for %pF and %pf in favour of %pS and %ps")
Cc: stable@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210423094529.1862521-1-linux@rasmusvillemoes.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 14c9a6af1b23..fd0fde639ec9 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -3102,8 +3102,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) switch (*fmt) { case 'S': case 's': - case 'F': - case 'f': case 'x': case 'K': case 'e': |