From patchwork Mon Jul 29 19:19:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 170027 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp1670391ile; Mon, 29 Jul 2019 12:45:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGw3XSkg+JT0zHp3tQ8+799XHtMyywTsmVnEVuAbsQD2vFIR4AoXdFpc2Fpj5aHxIpqFpT X-Received: by 2002:a17:902:830c:: with SMTP id bd12mr113972756plb.237.1564429554406; Mon, 29 Jul 2019 12:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429554; cv=none; d=google.com; s=arc-20160816; b=yxT405ut6X/xPfbUzncOFl+Kp6nVPzvwI8kT+douALn8t3nCSZIsHwnaM7S8kNbZlc 3cWN16Dh/CN0kuhwysLW3KRcmPHFwmUyMC8Mru6q2Rde5bEy1XJeWP5ogLLGXy/hO+ER sIyHnW5a96fgbO5PksXfYxjDqGaIqlAedxvq8oCL72q6CV68Kn5Twhc2ThsuRavrrtOs XzTt8jH+3zj77tqkvrNWYL4Rwu0yLHfpolCXdImFxkA8J1WQ7nQQtRjfbb95j0ke6gtU tAknW3RU4IANxKzwaty2HQq9rLii1lztQLWGCfef1DrJlp9RuNwatHhv4XYOY+CxGOIQ Lv8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q5pDL0nmbUNEsHQfm4tMs79e9ZE1gU3gMWa4IY1Wfk0=; b=PGj+bZA5yNm3voqllYnvWQ7iQhFeQdBVbVFpmzFHpRfrFC1NlKPNC77FctUwGg+HER Pa538jzloPmcFTYfWRU7zke/fRE5gljfTN3nBLbhoN9/SzHQMiDsmjt5tmmcg0VW86q+ V6bn3JJfF6iqrfaWFXdBjYvNcXiL+kQRmVVsavpDq4g4nQy4Tm4oYEoxAyEQsFnHbEGC PJVkK/Bj/cKv+N5zYzVVmscR4xO92o5f8AVixYIruLQ+XPFNPbqpgI0RdbnAYAk8aAp2 V9h6UBzAaT0Ak2fqyMXXlVMnYwEXtkRLqpCjuvRIljpPeWM+LZsJvuhDA28nAtEyYzy6 9Ucw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sXBz1ZV/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si24568025plr.103.2019.07.29.12.45.54; Mon, 29 Jul 2019 12:45:54 -0700 (PDT) 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=@kernel.org header.s=default header.b="sXBz1ZV/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390030AbfG2Tpw (ORCPT + 29 others); Mon, 29 Jul 2019 15:45:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:34878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389209AbfG2Tpu (ORCPT ); Mon, 29 Jul 2019 15:45:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41771217D4; Mon, 29 Jul 2019 19:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429549; bh=FM6vvuUXPW62pbJVaulANSqvApoEDIWBFygeeUxo9vU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sXBz1ZV/J8hYaNsmjdlgIy8DBtDCv7RgkemA53zs2ZUTKdvON/YCSxsCYcP0sS6pQ +qlHKmydFdPLgOOSQjnh44tLZ+Zarh77rXUMOOcElXsFi17W2xk1H88KovzaQGifOg NbacBk5a3TNepSAl8gLm/Kca4UNigOpxeaTxDmuY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anders Roxell , Philipp Zabel , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 5.2 002/215] media: drivers: media: coda: fix warning same module names Date: Mon, 29 Jul 2019 21:19:58 +0200 Message-Id: <20190729190740.264792750@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anders Roxell commit 1296987d2baf7f56748359b8dd42c425b9e7ee3a upstream. When building with CONFIG_VIDEO_CODA and CONFIG_CODA_FS enabled as loadable modules, we see the following warning: fs/coda/coda.ko drivers/media/platform/coda/coda.ko Rework so media/platform/coda is named coda-vpu. Leaving CODA_FS as is since that's a well known module. Signed-off-by: Anders Roxell Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/coda/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/media/platform/coda/Makefile +++ b/drivers/media/platform/coda/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only ccflags-y += -I$(src) -coda-objs := coda-common.o coda-bit.o coda-gdi.o coda-h264.o coda-jpeg.o +coda-vpu-objs := coda-common.o coda-bit.o coda-gdi.o coda-h264.o coda-jpeg.o -obj-$(CONFIG_VIDEO_CODA) += coda.o +obj-$(CONFIG_VIDEO_CODA) += coda-vpu.o obj-$(CONFIG_VIDEO_IMX_VDOA) += imx-vdoa.o From patchwork Mon Jul 29 19:19:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 170028 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp1670926ile; Mon, 29 Jul 2019 12:46:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxePhcOswjmf96kuFB+34dy2W1x8wmc8RMWglOJz4vdj1/gzXvTvzMux7rSJh+Eb9J6ea1E X-Received: by 2002:a17:90a:c58e:: with SMTP id l14mr112860790pjt.104.1564429589732; Mon, 29 Jul 2019 12:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429589; cv=none; d=google.com; s=arc-20160816; b=VU/nNTgRlExsXIldF6kwThMBeyqJcNgdwyV48aqHP30U9nA1yhy39O9mP3CTXLtGlV jR9ZOgAVLNPvciDhheLA1efBBKpdvHzeeEQ4f/iRF61N74VwCfmA7+jtmQe5i4jmNFj3 avQ6R0sYUopOGL14i18ZlZQ/7AEsBRkPgOACHD++xiQZuipwhFrVgA3crB9AXJ0UawVd fFsE6UIvQz91C35OpP7Q18e7GGGr2agWPheU/gq6O9rt2/cTo4CALm/JnJTfcIBK76kH QfUbXs4atr1u5F39ITVIHC3J4dhQafRvwhuVEwr4iBL0B7954iV7sywN/3vs+kqxk+nj WJ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8KCPiAWmr6tJGaqvsowBqC/zw395PNFkPWO/olXHhq4=; b=eezzZj00NqpdPAElX73GTZwLIPyiqTn0UDtnQPSH4ym5tGta+zUe/xvKJVVQhxaCH7 MMfisGiV6K2QHhrouBx9TcicTA17massAZC9vqc3OWMVJS7f4xTmqZ5Y1vvLuhUJD7ol WPYdm/oP4YdWyDmU0cwOt+zqf5P7/Ww5aJ1yT4HdMJtFiD3lc8fpOglhWkdt3BDDVKMn 0GfF21Ox98mU2/rXN/KUxRLyM4qLlfwfUZ1BHaeH1csTFBjUCNzsc3MuhQHyuv/1CWQF IdCROiSrxwaMRbF20spB05+P85OfJl20+TwHVf9OpUf0ahZ+s/s6ymKjhHL89SLREQNi 2k1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JN5bQkNM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14si31426141pgk.45.2019.07.29.12.46.29; Mon, 29 Jul 2019 12:46:29 -0700 (PDT) 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=@kernel.org header.s=default header.b=JN5bQkNM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390178AbfG2Tq1 (ORCPT + 29 others); Mon, 29 Jul 2019 15:46:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:35692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389627AbfG2TqZ (ORCPT ); Mon, 29 Jul 2019 15:46:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7A3F217D7; Mon, 29 Jul 2019 19:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429584; bh=3N7p1PM00csEyJLS9KFJaSXdvGKRGzUML6K5QMs3g8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JN5bQkNMVIjDdseKsNfoJiTLpdeDYrDSdAQybnliHKR7cmybrsO0tm2I00hD9Zlb4 d1OYFCTctnPbOscnNIjmVNJNY1mYUYiv0ar4kXqb/lI6Ay3U8ND1QO+pPp0tzr9RsR CpqUu+KMZ9P4j9Z8SMnsbThhpnxTfuA0flpV6mlg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , David Sterba Subject: [PATCH 5.2 003/215] btrfs: shut up bogus -Wmaybe-uninitialized warning Date: Mon, 29 Jul 2019 21:19:59 +0200 Message-Id: <20190729190740.374967721@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 6c64460cdc8be5fa074aa8fe2ae8736d5792bdc5 upstream. gcc sometimes can't determine whether a variable has been initialized when both the initialization and the use are conditional: fs/btrfs/props.c: In function 'inherit_props': fs/btrfs/props.c:389:4: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized] btrfs_block_rsv_release(fs_info, trans->block_rsv, This code is fine. Unfortunately, I cannot think of a good way to rephrase it in a way that makes gcc understand this, so I add a bogus initialization the way one should not. Signed-off-by: Arnd Bergmann Reviewed-by: David Sterba [ gcc 8 and 9 don't emit the warning ] Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/props.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/props.c +++ b/fs/btrfs/props.c @@ -337,7 +337,7 @@ static int inherit_props(struct btrfs_tr for (i = 0; i < ARRAY_SIZE(prop_handlers); i++) { const struct prop_handler *h = &prop_handlers[i]; const char *value; - u64 num_bytes; + u64 num_bytes = 0; if (!h->inheritable) continue; From patchwork Mon Jul 29 19:23:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 170029 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp1678600ile; Mon, 29 Jul 2019 12:55:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiDWZHg8/fYjxlBAqfFAdolLD+ShejjUfzQO9tElotgHKt9v+uIBpMXZahxZucDQBWvjFh X-Received: by 2002:a17:90a:346c:: with SMTP id o99mr111135478pjb.20.1564430143636; Mon, 29 Jul 2019 12:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430143; cv=none; d=google.com; s=arc-20160816; b=zHKlg/RQDJdPxXsbiRQf45vvobGp3cgkS7ashZWi4DIp2FjRAvExkISN1gcTMRScN2 hQBMinNszk163nMFlIfAMBA6wUkllUervw0gSl6kVDYEIiY21lZxfkozK2UIy89+wjyp UtV8/4slumKfJDy/9j3oFXDe6uYzmSR2YNkzexu9fDHYoEcf1LqIgV8389OOMqk08bWy dBaavWrN5b08yGSOn9O9GZ6QJwrL5C7YKKxfyNbKg1B46yHo3E4188yT0NcWaSV4n0SN 2c9oZ7HyBWRGPt5PJZnZlocvZlrT14Z5MZRnFe9m9sPpvF/JiUOBMe2iA43nVCtsdEFk 6GVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GZvaUzJYENo+PnLekUq/uOygk300PfjuNBmi7fpaYs4=; b=LztPY6zSzT9AGZK20YosODZcacEkHWNyQwwtc9oU+N1q8oN6WX5SSGFdKurZHyvqrr xm36vYhs6awGyJEq4B1y/rWmAwKWFWvE+Gw6fZoens7TNguDEnyLam73h9SWmbb+x0QR pxVrq0dl+aQ24qye5l8QjuhYcts62gAE8aXz+f6UdTBT0gGs+OO9/U3Q84a7Ahx37usU +kv5xFmAk/C9TxfuiTEWr8WnI6hEnv/vaFl8aD8UH+2N+ZMvGyKIIMJmgLBL5yHFunUX Zoh/VI7Y4KpbYe+SGkRUG7L26NkAwE3N/nUSbx78tk2xouDmsN1j3+VWj9ba0//Uzx7w 2dYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pHJCkmnX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si26907310pgj.171.2019.07.29.12.55.43; Mon, 29 Jul 2019 12:55:43 -0700 (PDT) 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=@kernel.org header.s=default header.b=pHJCkmnX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404223AbfG2Tzl (ORCPT + 29 others); Mon, 29 Jul 2019 15:55:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:48466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391047AbfG2Tzi (ORCPT ); Mon, 29 Jul 2019 15:55:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E62C2204EC; Mon, 29 Jul 2019 19:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564430137; bh=T2jjRL4C0aJe4QicyVoBE1EXvP3PYDkgBDX+2pELYFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pHJCkmnXXCETsgb65XnfDzFMr0PVuZcJpkGGo4i74OcWM069VSU33/dCTvwc1Hy8A pyOIXpdCDvGCinvBMTolzsix5fCpsYxfBDFwx1HWusf5Kx5guRh4SnN9/EnxOT3SG9 qYzdZUEadLL6ewJn2MeqUvcFF1fZ1uF9FHJooLLw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Kees Cook Subject: [PATCH 5.2 209/215] structleak: disable STRUCTLEAK_BYREF in combination with KASAN_STACK Date: Mon, 29 Jul 2019 21:23:25 +0200 Message-Id: <20190729190816.215884327@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 173e6ee21e2b3f477f07548a79c43b8d9cfbb37d upstream. The combination of KASAN_STACK and GCC_PLUGIN_STRUCTLEAK_BYREF leads to much larger kernel stack usage, as seen from the warnings about functions that now exceed the 2048 byte limit: drivers/media/i2c/tvp5150.c:253:1: error: the frame size of 3936 bytes is larger than 2048 bytes drivers/media/tuners/r820t.c:1327:1: error: the frame size of 2816 bytes is larger than 2048 bytes drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c:16552:1: error: the frame size of 3144 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] fs/ocfs2/aops.c:1892:1: error: the frame size of 2088 bytes is larger than 2048 bytes fs/ocfs2/dlm/dlmrecovery.c:737:1: error: the frame size of 2088 bytes is larger than 2048 bytes fs/ocfs2/namei.c:1677:1: error: the frame size of 2584 bytes is larger than 2048 bytes fs/ocfs2/super.c:1186:1: error: the frame size of 2640 bytes is larger than 2048 bytes fs/ocfs2/xattr.c:3678:1: error: the frame size of 2176 bytes is larger than 2048 bytes net/bluetooth/l2cap_core.c:7056:1: error: the frame size of 2144 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] net/bluetooth/l2cap_core.c: In function 'l2cap_recv_frame': net/bridge/br_netlink.c:1505:1: error: the frame size of 2448 bytes is larger than 2048 bytes net/ieee802154/nl802154.c:548:1: error: the frame size of 2232 bytes is larger than 2048 bytes net/wireless/nl80211.c:1726:1: error: the frame size of 2224 bytes is larger than 2048 bytes net/wireless/nl80211.c:2357:1: error: the frame size of 4584 bytes is larger than 2048 bytes net/wireless/nl80211.c:5108:1: error: the frame size of 2760 bytes is larger than 2048 bytes net/wireless/nl80211.c:6472:1: error: the frame size of 2112 bytes is larger than 2048 bytes The structleak plugin was previously disabled for CONFIG_COMPILE_TEST, but meant we missed some bugs, so this time we should address them. The frame size warnings are distracting, and risking a kernel stack overflow is generally not beneficial to performance, so it may be best to disallow that particular combination. This can be done by turning off either one. I picked the dependency in GCC_PLUGIN_STRUCTLEAK_BYREF and GCC_PLUGIN_STRUCTLEAK_BYREF_ALL, as this option is designed to make uninitialized stack usage less harmful when enabled on its own, but it also prevents KASAN from detecting those cases in which it was in fact needed. KASAN_STACK is currently implied by KASAN on gcc, but could be made a user selectable option if we want to allow combining (non-stack) KASAN with GCC_PLUGIN_STRUCTLEAK_BYREF. Note that it would be possible to specifically address the files that print the warning, but presumably the overall stack usage is still significantly higher than in other configurations, so this would not address the full problem. I could not test this with CONFIG_INIT_STACK_ALL, which may or may not suffer from a similar problem. Fixes: 81a56f6dcd20 ("gcc-plugins: structleak: Generalize to all variable types") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20190722114134.3123901-1-arnd@arndb.de Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- security/Kconfig.hardening | 7 +++++++ 1 file changed, 7 insertions(+) --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening @@ -61,6 +61,7 @@ choice config GCC_PLUGIN_STRUCTLEAK_BYREF bool "zero-init structs passed by reference (strong)" depends on GCC_PLUGINS + depends on !(KASAN && KASAN_STACK=1) select GCC_PLUGIN_STRUCTLEAK help Zero-initialize any structures on the stack that may @@ -70,9 +71,15 @@ choice exposures, like CVE-2017-1000410: https://git.kernel.org/linus/06e7e776ca4d3654 + As a side-effect, this keeps a lot of variables on the + stack that can otherwise be optimized out, so combining + this with CONFIG_KASAN_STACK can lead to a stack overflow + and is disallowed. + config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL bool "zero-init anything passed by reference (very strong)" depends on GCC_PLUGINS + depends on !(KASAN && KASAN_STACK=1) select GCC_PLUGIN_STRUCTLEAK help Zero-initialize any stack variables that may be passed