From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 5 May 2017 21:07:37 -0700 From: Greg KH Message-ID: <20170506040737.GE32707@kroah.com> References: <20170506040641.GA32707@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170506040641.GA32707@kroah.com> Subject: [kernel-hardening] [RFC 4/6] lib: vsprintf: default kptr_restrict to the maximum value To: kernel-hardening@lists.openwall.com, Petr Mladek , Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Steven Rostedt , William Roberts , Chris Fries , Dave Weinstein List-ID: From: Dave Weinstein 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. Cc: William Roberts Cc: Chris Fries Signed-off-by: Dave Weinstein Signed-off-by: Greg Kroah-Hartman --- lib/vsprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 75a49795fcae..404d477d4bd2 100644 --- 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 -- 2.12.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932961AbdEFEHy (ORCPT ); Sat, 6 May 2017 00:07:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50896 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932944AbdEFEHq (ORCPT ); Sat, 6 May 2017 00:07:46 -0400 Date: Fri, 5 May 2017 21:07:37 -0700 From: Greg KH To: kernel-hardening@lists.openwall.com, Petr Mladek , Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Steven Rostedt , William Roberts , Chris Fries , Dave Weinstein Subject: [RFC 4/6] lib: vsprintf: default kptr_restrict to the maximum value Message-ID: <20170506040737.GE32707@kroah.com> References: <20170506040641.GA32707@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170506040641.GA32707@kroah.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Weinstein 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. Cc: William Roberts Cc: Chris Fries Signed-off-by: Dave Weinstein Signed-off-by: Greg Kroah-Hartman --- lib/vsprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 75a49795fcae..404d477d4bd2 100644 --- 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 -- 2.12.2