From patchwork Thu Apr 11 18:01:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10896577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4149D17E0 for ; Thu, 11 Apr 2019 18:01:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35E8A28D22 for ; Thu, 11 Apr 2019 18:01:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 297E928D7E; Thu, 11 Apr 2019 18:01:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D603828D7D for ; Thu, 11 Apr 2019 18:01:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbfDKSB1 (ORCPT ); Thu, 11 Apr 2019 14:01:27 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40013 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbfDKSB0 (ORCPT ); Thu, 11 Apr 2019 14:01:26 -0400 Received: by mail-pf1-f194.google.com with SMTP id c207so3823905pfc.7 for ; Thu, 11 Apr 2019 11:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=LnXY2JQ+AvT2TeKIyUF3DHjJXBSRjqaNrPZu85aDqX4=; b=DEWG5OrdS7RnpwpCQdS8YfVJrZd6LZ/hLP5o2cAEJFMNg77rhhRSIF99CALXU0t4Nw b61UA/0mK5HXbDxjxt7jndpUYbmVs1gGAk/DbGgrivMNtpbgX6uuvLvpnp4m/5ro2mol lW4mnnZ2qu9RJ5/EAW4wqLEAhFw4CNdzaeq8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LnXY2JQ+AvT2TeKIyUF3DHjJXBSRjqaNrPZu85aDqX4=; b=MJkAH2uyngkOb3wuFA7fr91V6K8AGrVAA4wigT+1Jz8Lhn4+p0OeryITGEpekM+DuH w2jkV0qlPeP9FlZO8ilh1m1GM4LxTKLJoMsAlS4HIpdv8E828icweSmyeY7HWfBDPRf9 bua7sD5Fw1EVegsko9Jf4WcrttDb30XUnG7nyIwZq68jnZZ2MvwRQZhmGN1AfEdjZ/x7 w+0oAKbuV783HVUWhWbf7I6uozlmS0MS2qwFjhIW+9YMxB9X5Q9Cm3vcSnaqdy4e/CJ+ //sVlLW5t1RTK2gvNc4Yz2m7Q1Apm4CT0+3m+lOtSEHp9Wj/xxZRMYCD+yAA4dBnDFmz sh7g== X-Gm-Message-State: APjAAAUgKFZrub+ObaLaQFVf06KKg8SGhh+z0/PbMyHUUfe3suSzCD5l BI7Q7gWmgujCwc6QDCiQ+nlxtQ== X-Google-Smtp-Source: APXvYqzlUv4V4sPs10niFMNU7nfZb2ZRwYswecBl5RhG/CFnIB5027ab+KFPG1dObeIJ7ZNBKSFhmQ== X-Received: by 2002:a63:1d26:: with SMTP id d38mr44965807pgd.357.1555005686261; Thu, 11 Apr 2019 11:01:26 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id v12sm52331660pfe.148.2019.04.11.11.01.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2019 11:01:25 -0700 (PDT) From: Kees Cook To: Alexander Potapenko Cc: Kees Cook , Masahiro Yamada , James Morris , Alexander Popov , Nick Desaulniers , Kostya Serebryany , Dmitry Vyukov , Sandeep Patil , Laura Abbott , Randy Dunlap , Michal Marek , Emese Revfy , "Serge E. Hallyn" , kernel-hardening@lists.openwall.com, linux-security-module@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] Refactor memory initialization hardening Date: Thu, 11 Apr 2019 11:01:14 -0700 Message-Id: <20190411180117.27704-1-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a proposed alternative for the memory initialization series, which refactoring the existing gcc plugins into a separate Kconfig file and collects all the related options together with some more language to describe their differences. The last patch adds the Clang auto init option, as done by Alexander Potapenko. Since there isn't really a good way to "select" with dependencies, I've left out CONFIG_INIT_ALL_MEMORY for the moment... I intend to carry this in the gcc-plugins tree, but I'd really like to get Acks from Masahiro (Kconfig changes, Makefile change), and from James (adding the new Kconfig.hardening to security/Kconfig). Thanks! -Kees v2: - add plugin menu (masahiro) - adjust patch subject prefixes (masahiro) - drop redundent "depends" (masahiro) - fixed early use of CC_HAS_AUTO_VAR_INIT (masahiro) - dropped default-enabled for STACK_INIT_ALL (masahiro) Kees Cook (3): security: Create "kernel hardening" config area security: Move stackleak config to Kconfig.hardening security: Implement Clang's stack initialization Makefile | 5 ++ scripts/gcc-plugins/Kconfig | 125 ++------------------------- security/Kconfig | 2 + security/Kconfig.hardening | 163 ++++++++++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+), 118 deletions(-) create mode 100644 security/Kconfig.hardening