Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4118885imj; Tue, 12 Feb 2019 10:05:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IbuUrGmKp2iw6t6iXbtHBAzCgA0fzmETzTUsZ+cL84eAEvKnhmfBo26mrbfICqwbUrWcNBZ X-Received: by 2002:a63:e742:: with SMTP id j2mr4846622pgk.172.1549994731844; Tue, 12 Feb 2019 10:05:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549994731; cv=none; d=google.com; s=arc-20160816; b=Dkfo2qahskLix9PGmKjND781KmfjBPw7u35s71sDGQ8fKTxnMnHrjtVLnIoqQOcnak kjB6Qoh0VpSV+3gL5Iz/hlEqHtcVXJcUbO0wPUk6U6OOTUWO7cqN+AC02dNEN8WnY2Z6 6J/ITLJqHV1JJ8nfocJIXRdxihoHQWQSAOa32hRxctmL6dopH9X2JKIXXLv5LcZdbQ5+ m4gMAplk+bT6wIlLhkZyRly/ZRZtJUGujDpvRMfNwqje5kuXB2vv+G8Ktf/5f9QmQo7l qWwqGpljH3yH+XbiEK8nCnTtQYhhZ+qYrywz3ByeTIzPjDQx7JebCIjbjitzwaBi8cVz 6XVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5RL/uims0dzv6hgVjpHlDAiv61sh4MWVmBGXV5JulH8=; b=RfyRiLtY62EV/0XEEn6jPc+Mcw0GAvgeAl7kwsu98X0z3HRcjqLoCoicwMCL+pPqEP nJm8Ry2piJpRZwtVar5U3oylEoLfsFQt7DHoybnJE8Hw9zwUu7+SEANZEQ0ra2XfG7gD x/8uSLk5f1BOnHvCF4WtGjoY8/KX079oHjxwX6j83P00lhR5kK7zVhit3dl2/GZTIk5a Klm95xtr7YoDpEW9M81l+3N/q+5+Rz9JBvbsB6IklmDlNnKO/I0aRRAufhq9Z8E+DTRN WdIDezmiFYrGWxVdBlRi8VFGa6auPEwXTOwVhAjPeGOVOWWmmPPoefejxb/2A3O5cjhv 7ZCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="lB8/ch13"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l81si7207394pfj.230.2019.02.12.10.05.15; Tue, 12 Feb 2019 10:05:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="lB8/ch13"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731289AbfBLSEx (ORCPT + 99 others); Tue, 12 Feb 2019 13:04:53 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33986 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726975AbfBLSEv (ORCPT ); Tue, 12 Feb 2019 13:04:51 -0500 Received: by mail-pf1-f196.google.com with SMTP id j18so1670312pfe.1 for ; Tue, 12 Feb 2019 10:04:51 -0800 (PST) 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=YwuDWYGE7du7EbppFkbD2zYzNwLv0mcy8jsvdViBlhWducOxMbpPaZlKd01bNpQXvY Feg8cT0NI3siU2DwKu0a+2he3Yp6rPew4JoZLVK1hX0WqQieDgOz8fvRNw6n5PsLOVoc MWnYfMO/7z/XopqL0PGEAPlP38rpxBnaaqpVj5nBqdALhNztiCyeTe7yqWfM4Ytcyz1A DseaE8WwfOMUX4PbFsz9Fk/tbb6vCtKXIaOTsOzuWrRHR3QS1lvbs28KgNglZqitvokg +LBiFq0je45IbIvu9IiRG2HH/AzDPhET6/T3vGSEtWbLb5cYou/QsGgPGw2d6u6crsED DWxg== X-Gm-Message-State: AHQUAuYn4r6Wzgm4RAgtKCpMzh/5oN5mTFW9lAGA5TpwTRSawtqhzNUV G3aOTeuAtPlXDAkq7plgq+1lSg== X-Received: by 2002:a65:424c:: with SMTP id d12mr4752306pgq.126.1549994690641; Tue, 12 Feb 2019 10:04:50 -0800 (PST) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id h128sm19370649pgc.15.2019.02.12.10.04.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Feb 2019 10:04:49 -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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.17.1