Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935225AbcJFV0J (ORCPT ); Thu, 6 Oct 2016 17:26:09 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36379 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934930AbcJFV0A (ORCPT ); Thu, 6 Oct 2016 17:26:00 -0400 MIME-Version: 1.0 In-Reply-To: <1475788788.1820.4.camel@perches.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> <1475788788.1820.4.camel@perches.com> From: Kees Cook Date: Thu, 6 Oct 2016 14:25:57 -0700 X-Google-Sender-Auth: VKAJFwCm7LJ5Dm-FxdDG6bTf9VU Message-ID: Subject: Re: [PATCH] printk: introduce kptr_restrict level 3 To: Joe Perches Cc: Christoph Hellwig , "Roberts, William C" , "kernel-hardening@lists.openwall.com" , "corbet@lwn.net" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 866 Lines: 25 On Thu, Oct 6, 2016 at 2:19 PM, Joe Perches wrote: > On Thu, 2016-10-06 at 14:00 -0700, Kees Cook wrote: > >> And based on my read of this thread, we all appear to be in violent >> agreement. :) "always protect %p" is absolutely the goal, and we can >> figure out the best way to get there. > > I proposed emitting pointers from the const and text sections by default > and using NULL for data pointers. > > https://lkml.org/lkml/2016/8/5/380 Leaks of const and text (while not useful for write-attacks) can leak KASLR offset (though yes, yes, there are many existing leaks -- but we should avoid adding a new one regardless). I think the logic of "is this destined for userspace" is likely the cleanest approach. There still may be many things this breaks, though. (I expect perf. Everything breaks perf. ;) -Kees -- Kees Cook Nexus Security