aboutsummaryrefslogtreecommitdiffstats
path: root/lib-vsprintf-default-kptr_restrict-to-the-maximum-value.patch
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-05 16:55:52 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-05 16:55:52 -0700
commit93273f5d8ace9bc03f0dc35ea98d229ed40f7860 (patch)
treecb13bf3e1cb0189be87387f7ac5ed45b638a1e5f /lib-vsprintf-default-kptr_restrict-to-the-maximum-value.patch
parentaeb7d5ed8d98be6d0ea91cbb4b5ee8d52538a14e (diff)
downloadpatches-93273f5d8ace9bc03f0dc35ea98d229ed40f7860.tar.gz
patches
Diffstat (limited to 'lib-vsprintf-default-kptr_restrict-to-the-maximum-value.patch')
-rw-r--r--lib-vsprintf-default-kptr_restrict-to-the-maximum-value.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib-vsprintf-default-kptr_restrict-to-the-maximum-value.patch b/lib-vsprintf-default-kptr_restrict-to-the-maximum-value.patch
new file mode 100644
index 00000000000000..e247b29c635926
--- /dev/null
+++ b/lib-vsprintf-default-kptr_restrict-to-the-maximum-value.patch
@@ -0,0 +1,26 @@
+From: Dave Weinstein <olorin@google.com>
+Date: Wed, 11 Jan 2017 16:27:59 -0800
+Subject: lib: vsprintf: default kptr_restrict to the maximum value
+
+Set the initial value of kptr_restrict to the maximum
+setting rather than the minimum setting, to ensure that
+early boot logging is not leaking information.
+
+Signed-off-by: Dave Weinstein <olorin@google.com>
+---
+
+---
+ lib/vsprintf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/vsprintf.c
++++ b/lib/vsprintf.c
+@@ -395,7 +395,7 @@ struct printf_spec {
+ #define FIELD_WIDTH_MAX ((1 << 23) - 1)
+ #define PRECISION_MAX ((1 << 15) - 1)
+
+-int kptr_restrict __read_mostly;
++int kptr_restrict __read_mostly = 4;
+
+ /*
+ * Always cleanse %p and %pK specifiers