From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbdJAAIG (ORCPT ); Sat, 30 Sep 2017 20:08:06 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:51577 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbdJAAHV (ORCPT ); Sat, 30 Sep 2017 20:07:21 -0400 X-ME-Sender: X-Sasl-enc: Xgav9KujZV25RtW+exQS0+iRN4QRVA5t4Sfgp/b4Nuc3 1506816440 From: "Tobin C. Harding" To: Greg KH , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky Cc: "Tobin C. Harding" , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Steven Rostedt , William Roberts , Chris Fries , Dave Weinstein Subject: [kernel-hardening] [RFC V2 4/6] lib: vsprintf: default kptr_restrict to the maximum value Date: Sun, 1 Oct 2017 11:06:48 +1100 Message-Id: <1506816410-10230-5-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506816410-10230-1-git-send-email-me@tobin.cc> References: <1506816410-10230-1-git-send-email-me@tobin.cc> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Tobin C. Harding --- lib/vsprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 0271223..e009325 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -396,7 +396,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; /* maximum setting */ /* * return non-zero if we should cleanse pointers for %p and %pK specifiers. -- 2.7.4