From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 34425B3D for ; Mon, 24 Aug 2015 16:35:52 +0000 (UTC) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9CCE6E5 for ; Mon, 24 Aug 2015 16:35:51 +0000 (UTC) Received: by iodt126 with SMTP id t126so155572574iod.2 for ; Mon, 24 Aug 2015 09:35:51 -0700 (PDT) MIME-Version: 1.0 Sender: keescook@google.com In-Reply-To: References: Date: Mon, 24 Aug 2015 09:35:50 -0700 Message-ID: From: Kees Cook To: Linus Walleij Content-Type: text/plain; charset=UTF-8 Cc: "ksummit-discuss@lists.linuxfoundation.org" , Emily Ratliff Subject: Re: [Ksummit-discuss] [TECH TOPIC] Kernel Hardening List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Aug 24, 2015 at 5:29 AM, Linus Walleij wrote: > On Mon, Aug 24, 2015 at 6:20 AM, James Morris wrote: > >> There are also potentially promising approaches to mitigation with other >> technologies such as KASan and gcc plugins, as well as evolving hardware >> features. > > What I've discovered when running KASan the last few weeks is that > this points back to the question of tests ... I've been using Trinity > to find bugs, but it is more likely to kill itself or cause OOM than > trigger any boundary overrun bugs. > > Kselftest may be helpful, but basically any loads that heavily > exercise the kernel internals are helpful to harden the kernel. > Some of these are custom test suites I suspect. Any good hints > for a simple embedded developer like me? I agree with the sentiment here, but not with the language. Finding flaws (which is what selftests, KASan, Trinity, etc do) isn't hardening. Hardening is stopping the exploitation of flaws. The hardening the kernel needs is about taking away exploitation tools, not killing bugs. (Though killing bugs is still great.) As an example, making the kernel code memory read-only means an attacker cannot just directly change the kernel's execution path when they use an arbitrary memory-writing flaw. (This feature is mostly enabled via CONFIG_DEBUG_RODATA, and was very recently added to ARM, though isn't at 100% coverage for all the physical memory aliases.) -Kees -- Kees Cook Chrome OS Security