From patchwork Tue Feb 12 18:04:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10808455 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 5692313BF for ; Tue, 12 Feb 2019 18:05:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 421022C365 for ; Tue, 12 Feb 2019 18:05:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 331132C3B2; Tue, 12 Feb 2019 18:05:07 +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=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 67F7D2C361 for ; Tue, 12 Feb 2019 18:05:06 +0000 (UTC) Received: (qmail 25940 invoked by uid 550); 12 Feb 2019 18:05:03 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 25914 invoked from network); 12 Feb 2019 18:05:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=5RL/uims0dzv6hgVjpHlDAiv61sh4MWVmBGXV5JulH8=; b=lB8/ch13db9Egk5T5wRC8GehSg+qyyjSPpSLRlcZijx8k3auSzek/Fh+CVdkW+y4ce hFxNafX3BTH+ie82QVOsCkrfmociqSMMTFssPTNzl8MPtor2AU3mFoXJFs/h6Kg7aqO3 GwKJHkueWtIWH3Q/CpiBTy+soQ+ojN2hUcM7w= 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=5RL/uims0dzv6hgVjpHlDAiv61sh4MWVmBGXV5JulH8=; b=Vw5036eDrJugGmfWxU3hKNfFwzkw/79tHAGOAbAuKd6WLL/B4wo6dTqhiVxQ8SXbTB kVL9O2TfT6lbEjbye1iNrSKtOelK9K3ekbdJEGzHxoB0wkArBLbd4FZPSf81Rnb9uXGJ Khl9rKaVIjGXzxQO1fcqOy1a2ajAdYIXy4Jmm4MKZOsYfzCqajjp1021x7FRi2DLtzPu +flwcZx8Rj4a3PYNKUYkDdGMXU2EopEjFVClEdxrbwyzdTiOAqU6RFH8dqvdUTqGdpCJ G5PxqlIZ1RwRlzu86SWgtK4rgA/piEGDt38Jts8PwSTom2DsyoxY3679c+8kwecKiR3J 0LMg== X-Gm-Message-State: AHQUAub3zRQTJlvCfVEplJOXdQkrhCcF1CvrWMEEaS+4OnMylNSbPFvc C6Usu5wIgZEblqrbc/im/Wn3QQ== X-Google-Smtp-Source: AHgI3IaZQbO/YwHeT/78fiLag+0976Gh9N2AvcOlucjqpNoMgwQVu09NPWySOCiXUPRy2xCp42rpQw== X-Received: by 2002:a65:424c:: with SMTP id d12mr4752306pgq.126.1549994690641; Tue, 12 Feb 2019 10:04:50 -0800 (PST) From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Kees Cook , Emese Revfy , Alexander Popov , Ard Biesheuvel , Laura Abbott , Jann Horn , Alexander Potapenko , kernel-hardening@lists.openwall.com Subject: [PATCH 0/2] gcc-plugins: structleak: Generalize to all variable types Date: Tue, 12 Feb 2019 10:04:39 -0800 Message-Id: <20190212180441.15340-1-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Instead of a new plugin for stack initialization[1], this improves structleak to handle initialization of all variable types. Since the instrumentation happens at a different point, the "switch" statement changes from the earlier posting[2] are no longer needed. As before, this also introduces a stack initialization regression testing module to validate various kinds of stack variable usage vs compiler instrumentation for initialization. See the individual patches for more details. Thanks! -Kees [1] https://lkml.kernel.org/r/CA+55aFykZL+cSBJjBBts7ebEFfyGPdMzTmLSxKnT_29=j942dA@mail.gmail.com [2] https://lkml.kernel.org/r/20190123110349.35882-1-keescook@chromium.org Kees Cook (2): gcc-plugins: structleak: Generalize to all variable types lib: Introduce test_stackinit module lib/Kconfig.debug | 10 + lib/Makefile | 1 + lib/test_stackinit.c | 378 ++++++++++++++++++++++++ scripts/Makefile.gcc-plugins | 2 + scripts/gcc-plugins/Kconfig | 58 +++- scripts/gcc-plugins/structleak_plugin.c | 36 ++- 6 files changed, 463 insertions(+), 22 deletions(-) create mode 100644 lib/test_stackinit.c Reviewed-by: Ard Biesheuvel