From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755685AbcJFPAG convert rfc822-to-8bit (ORCPT ); Thu, 6 Oct 2016 11:00:06 -0400 Received: from mga06.intel.com ([134.134.136.31]:43363 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752227AbcJFO75 (ORCPT ); Thu, 6 Oct 2016 10:59:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,454,1473145200"; d="scan'208";a="769582769" From: "Roberts, William C" To: Christoph Hellwig CC: "kernel-hardening@lists.openwall.com" , "corbet@lwn.net" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] printk: introduce kptr_restrict level 3 Thread-Topic: [PATCH] printk: introduce kptr_restrict level 3 Thread-Index: AQHSHzL4SKECDv3ohUe9odM8/3/liaCb4uuA//+NOECAAHmaAP//mnMw Date: Thu, 6 Oct 2016 14:59:54 +0000 Message-ID: <476DC76E7D1DF2438D32BFADF679FC561CD14812@ORSMSX103.amr.corp.intel.com> References: <1475690686-16138-1-git-send-email-william.c.roberts@intel.com> <20161006133147.GA20206@infradead.org> <476DC76E7D1DF2438D32BFADF679FC561CD14651@ORSMSX103.amr.corp.intel.com> <20161006135612.GA21342@infradead.org> In-Reply-To: <20161006135612.GA21342@infradead.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjcxZDVhODUtMTQ5Yi00YzkyLWE3YmMtNzhlNjBmZjExMzgwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImdmbFc3T05oS1JEeHFpWnVOWkNBYVN6Y2hGZlZvM2ZuWnVIbmFPU2lwRnc9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Christoph Hellwig [mailto:hch@infradead.org] > Sent: Thursday, October 6, 2016 9:56 AM > To: Roberts, William C > Cc: Christoph Hellwig ; kernel- > hardening@lists.openwall.com; corbet@lwn.net; linux-doc@vger.kernel.org; > linux-kernel@vger.kernel.org > Subject: Re: [PATCH] printk: introduce kptr_restrict level 3 > > On Thu, Oct 06, 2016 at 01:47:47PM +0000, Roberts, William C wrote: > > Out of tree modules still affect core kernel security. > > So don't use them. > > > I would also bet money, that somewhere In-tree someone has put a %p > > when they wanted a %pK. > > So fix them. As Jann Horn points out, "And in total, there are 13578 matches for %p[^FfSsBRrhbMmIiEUVKNadCDgG] throughout the kernel. Reviewing all of those manually would suck." > > > So this method is just quite error > > prone. We currently have a blacklist approach versus whitelist. > > Or fix the entire thing, get rid of %pK and always protect %p if you can show that > it doesn't break anything. > > But stop posting patches with bullshit arguments like out of tree modules. Ok perhaps the commit message sucks, and I should have included the large spread usages of %p throughout the kernel, I assumed those would just be known, I shouldn't have made that assumption. We should care about out-of-tree modules wrt security as they affect the security of the whole system, especially when the modules are linking to core symbols like printing and string routines. There are tons of %p usages throughout the kernel as noted above. This is pretty low hanging fruit and we should fix this, as Kees points out.