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: 10913681 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 A82D11708 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 99F5C2862C for ; Tue, 23 Apr 2019 19:49:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DFB7285BD; 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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 461B02862C for ; Tue, 23 Apr 2019 19:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726136AbfDWTtb (ORCPT ); Tue, 23 Apr 2019 15:49:31 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36659 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfDWTtb (ORCPT ); Tue, 23 Apr 2019 15:49:31 -0400 Received: by mail-pl1-f193.google.com with SMTP id ck15so8039809plb.3 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=ONHoihFDgHb62IS/rM2ggxrbbdJX3X4/i7OBOd7JtZlnoJ/YAswuGNuDDvdkMjpzDy pvu0Vxu4Q30QrHCZZEk9LC7BFBBut4bh45CHyQ0bfwW4trBV05tkChWLDglTqSTL8txh 9r2IXUa1730R2knp0POO3i/n9SVkxPMR0w64S13sV/+rK61m7gzCVLTX77JNWYiRUcWl 8NYutU8Hst/ey0C2Rhhmk+R1N7yaxUezxG7kjYmhZcsPH23vTcwGs++hguZTYvMcXlNP x1afpsZBcDDVgsDHIcvCvLJHJze4RUbjRy5yszZXSBUhXt/izn9pHfufEuLUTcN+Eh1f t+6g== X-Gm-Message-State: APjAAAUTfeNPwJbPrgGo3ZFE8GKc2PrnVXiJC4BWq7D8pgA5bbJgfV9k 3PTa4Evwf7o0nxV5MfOyYPDsuA== 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: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: 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