From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753608AbcEWJaH (ORCPT ); Mon, 23 May 2016 05:30:07 -0400 Received: from tundra.namei.org ([65.99.196.166]:47324 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbcEWJaF (ORCPT ); Mon, 23 May 2016 05:30:05 -0400 Date: Mon, 23 May 2016 19:29:46 +1000 (AEST) From: James Morris To: Kees Cook cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [PATCH] doc: self-protection: provide initial details In-Reply-To: <20160517022728.GA2821@www.outflux.net> Message-ID: References: <20160517022728.GA2821@www.outflux.net> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 May 2016, Kees Cook wrote: > +#### Segregation of kernel memory from userspace memory > + > +The kernel must never execute userspace memory. The kernel must also never > +access userspace memory without explicit expectation to do so. These > +rules can be enforced either by support of hardware-based restrictions > +(x86's SMEP/SMAP, ARM's PXN/PAN) or via emulation (ARM's Memory Domains). > +By blocking userspace memory in this way, execution and data parsing > +cannot be passed to trivially-controlled userspace memory, forcing > +attacks to operate entirely in kernel memory. One caveat is that there may be ways to bypass these protections, e.g. via aliased (direct mapped) memory. I'd also note that some platforms have separate kernel and memory spaces, like Sparc. > +To protect against even privileged users, systems may need to either > +disable module loading entirely (e.g. monolithic kernel builds or > +modules_disabled sysctl), or provide signed modules (e.g. > +CONFIG_MODULE_SIG_FORCE, or dm-crypt with LoadPin), to keep from having > +oot load arbitrary kernel code via the module loader interface. Or utilize an appropriate MAC policy. -- James Morris