From patchwork Tue Apr 23 19:49:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10913679 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 8726C1515 for ; Tue, 23 Apr 2019 19:49:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A08A285BD for ; Tue, 23 Apr 2019 19:49:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D3AF2864A; Tue, 23 Apr 2019 19:49:32 +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=ham 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 15103285BD for ; Tue, 23 Apr 2019 19:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726342AbfDWTtb (ORCPT ); Tue, 23 Apr 2019 15:49:31 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:39356 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbfDWTtb (ORCPT ); Tue, 23 Apr 2019 15:49:31 -0400 Received: by mail-pl1-f193.google.com with SMTP id e92so6243041plb.6 for ; Tue, 23 Apr 2019 12:49:31 -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=JqAaK9I/spSaCaSg32F1HZpvpilgyAJuQuVGnfyCAUk=; b=JBKWk1tRiUbt/drJcZZK+fxAj/IFkPWCj8FaR1MO9kt0dOXEQzv6257cr/0W9JMMdu JgYJExvus7KrzfCeodCF129yTnA+C3n/iSQbYhzEwqaSTvTwg1EzYTxsTpUy2LGhWOPs zjEq/6qOTqLP9VHwdInOLb80Q8vNTRH8aWKis= 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=JqAaK9I/spSaCaSg32F1HZpvpilgyAJuQuVGnfyCAUk=; b=Do9B613Hj9FgAydkVO7HRs45kCQCYyAv2svqoDDBrKAEKHOdukZ/rDYbjwj8QJlxiT 1Uu5o5MHBgo76bcSO6xhQUXT8HTk5c11tQw1cnh1a82XCIb21BF54piCmmn4I7gsJMmS UFqU1ss8nEmJ8374jzqQC2IVgSYtn6hirrlHK57lP8tALYVyn6KYMb8DOlAhvgwg4JUv Q4HQ8tGOdgVNG9kWy3f3Ezc4j/roOMhTYtJfkb1WkCT5QWbZbgXMNqvIMITD8s2c9Idt bIBN6aA4DXHoKS8KSyZ3JywtRk/yLXC68HE+0r64wtThHc6OhDCKyp6N2zQhTx+eVTTV cpTw== X-Gm-Message-State: APjAAAWJGPGDXQBvJwFBzFY4u2y266rfDLvTpsN6D0baAt27/nEMgYEE 1PVBSihgAN9HWX3OQuPWRB4LIg== X-Google-Smtp-Source: APXvYqyHP29unDWinUcnH+Ag9bS8LYObT2ApmXeIFunfZPXS4hb87Bbahe9vbDP2ng987BuDqNPVDg== X-Received: by 2002:a17:902:7883:: with SMTP id q3mr27909874pll.60.1556048970907; Tue, 23 Apr 2019 12:49:30 -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 17sm30947814pfw.65.2019.04.23.12.49.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 12:49:29 -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 , linux-security-module , Linux Kbuild mailing list , Linux Kernel Mailing List Subject: [PATCH v3 0/3] Refactor memory initialization hardening Date: Tue, 23 Apr 2019 12:49:22 -0700 Message-Id: <20190423194925.32151-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 refactors the stack memory initialization configs in order to keep things together when adding Clang stack initialization, and in preparation for future heap memory initialization configs. 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 v3: - clean up menu/if with a merged "depends on" (masahiro) - add CONFIG_COMPILE_TEST defaults (masahiro) 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 | 126 ++------------------------- security/Kconfig | 2 + security/Kconfig.hardening | 164 ++++++++++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+), 120 deletions(-) create mode 100644 security/Kconfig.hardening Acked-by: Masahiro Yamada