From 4a19e33326a45a820f8d9860eb5086b86c456dcd Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 28 Feb 2018 10:56:33 +0100 Subject: [PATCH] 4.15-stable patches added patches: vsprintf-avoid-misleading-null-for-px.patch --- queue-4.15/series | 1 + ...sprintf-avoid-misleading-null-for-px.patch | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 queue-4.15/series create mode 100644 queue-4.15/vsprintf-avoid-misleading-null-for-px.patch diff --git a/queue-4.15/series b/queue-4.15/series new file mode 100644 index 00000000000..40f36c3ec0d --- /dev/null +++ b/queue-4.15/series @@ -0,0 +1 @@ +vsprintf-avoid-misleading-null-for-px.patch diff --git a/queue-4.15/vsprintf-avoid-misleading-null-for-px.patch b/queue-4.15/vsprintf-avoid-misleading-null-for-px.patch new file mode 100644 index 00000000000..d35bf23c748 --- /dev/null +++ b/queue-4.15/vsprintf-avoid-misleading-null-for-px.patch @@ -0,0 +1,45 @@ +From 3a129cc2151425e5aeb69aeb25fbc994ec738137 Mon Sep 17 00:00:00 2001 +From: Adam Borowski +Date: Sun, 4 Feb 2018 18:45:21 +0100 +Subject: vsprintf: avoid misleading "(null)" for %px + +From: Adam Borowski + +commit 3a129cc2151425e5aeb69aeb25fbc994ec738137 upstream. + +Like %pK already does, print "00000000" instead. + +This confused people -- the convention is that "(null)" means you tried to +dereference a null pointer as opposed to printing the address. + +Link: http://lkml.kernel.org/r/20180204174521.21383-1-kilobyte@angband.pl +To: Sergey Senozhatsky +To: Steven Rostedt +To: linux-kernel@vger.kernel.org +Cc: Andrew Morton +Cc: Joe Perches +Cc: Kees Cook +Cc: "Roberts, William C" +Cc: Linus Torvalds +Cc: David Laight +Cc: Randy Dunlap +Cc: Geert Uytterhoeven +Signed-off-by: Adam Borowski +Signed-off-by: Petr Mladek +Signed-off-by: Greg Kroah-Hartman + +--- + lib/vsprintf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/vsprintf.c ++++ b/lib/vsprintf.c +@@ -1849,7 +1849,7 @@ char *pointer(const char *fmt, char *buf + { + const int default_width = 2 * sizeof(void *); + +- if (!ptr && *fmt != 'K') { ++ if (!ptr && *fmt != 'K' && *fmt != 'x') { + /* + * Print (null) with the same width as a pointer so it makes + * tabular output look nice. -- 2.47.3