From patchwork Wed Jul 11 20:36:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10520445 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F37B2600CA for ; Wed, 11 Jul 2018 20:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3F9D298B8 for ; Wed, 11 Jul 2018 20:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C75DC298D5; Wed, 11 Jul 2018 20:37:01 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DE301298DA for ; Wed, 11 Jul 2018 20:36:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E439680F90; Wed, 11 Jul 2018 20:36:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF15060F93; Wed, 11 Jul 2018 20:36:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 730F218037F3; Wed, 11 Jul 2018 20:36:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6BKacbQ014903 for ; Wed, 11 Jul 2018 16:36:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 01CD95D9D6; Wed, 11 Jul 2018 20:36:38 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ECCC35D9CD for ; Wed, 11 Jul 2018 20:36:37 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F282C81DF7 for ; Wed, 11 Jul 2018 20:36:36 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id e6-v6so3222749pgv.2 for ; Wed, 11 Jul 2018 13:36:36 -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:in-reply-to:references; bh=Ck0rBXfaj7OBJNHlsB+wNQqwrCsF6ZBfskWdE1MC6Kk=; b=FfOz6yu8vl+0utBEOMCZeLDG2uzphgY9FsbSiDCFT3FDLnUqjLGdknW9DLFEakx/hH Vt9hS/nkoEZtzZBmxR2GLivwO5JP/j7FoNKMdjn8yaWKa0Jyhpeq5rvvuPrBjikwHozB bCeiH6Rq338FTmvVT2BFazeKPP0naw29ctnDQ= 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:in-reply-to :references; bh=Ck0rBXfaj7OBJNHlsB+wNQqwrCsF6ZBfskWdE1MC6Kk=; b=pJDIqFYY1747VcEGmyrt1kttKgxX30tzfP2OMu+Gj8scsv8lAq90XSxgaEkRfyOca2 gbIibTNI2RW1kjPU5eRDYz3noHhA5P7JFOoumgP01Pdz/qqSEifRGCAk5u3YUSxF5QWJ OqMFQpOXg+N07kepwD1F7/llSJSg4BqKKB6ZOrxLlT64/+KPQSGfju6MyoNlFqiqW6p3 yRjznC/+KgrwCRAVciUw5TS7KLDC9d5W5BKp8H2dQMXU0pAOfraQRaMv9dhsRM48y1wd TJyesjv9sN+rated/8NoQ/QHe8A7L0+EODb/MZuMqt01CoXKdFfZtLEmxjRW77NERPXj 1FJA== X-Gm-Message-State: AOUpUlFmdpHCt42rWKICVtdB6xsgvvtAbGQfEdo69MkB0vS7aUv5fioF di6F204qXOkydui769BVAwvXwg== X-Google-Smtp-Source: AAOMgpfaZRRCp4ZaGa4RlQsIqvNrbnWFiZMnxT5Pb5fwnjuZeg7Sxcacwt0QqX19Cly5jrg3LTphIA== X-Received: by 2002:a62:d1b:: with SMTP id v27-v6mr143740pfi.87.1531341396463; Wed, 11 Jul 2018 13:36:36 -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 u68-v6sm32582011pfb.159.2018.07.11.13.36.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 13:36:35 -0700 (PDT) From: Kees Cook To: Herbert Xu Date: Wed, 11 Jul 2018 13:36:16 -0700 Message-Id: <20180711203619.1020-12-keescook@chromium.org> In-Reply-To: <20180711203619.1020-1-keescook@chromium.org> References: <20180711203619.1020-1-keescook@chromium.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 11 Jul 2018 20:36:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 11 Jul 2018 20:36:37 +0000 (UTC) for IP:'209.85.215.193' DOMAIN:'mail-pg1-f193.google.com' HELO:'mail-pg1-f193.google.com' FROM:'keescook@chromium.org' RCPT:'' X-RedHat-Spam-Score: -0.131 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.215.193 mail-pg1-f193.google.com 209.85.215.193 mail-pg1-f193.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com Cc: Giovanni Cabiddu , Kees Cook , Arnd Bergmann , Eric Biggers , Mike Snitzer , "Gustavo A. R. Silva" , qat-linux@intel.com, linux-kernel@vger.kernel.org, Masahiro Yamada , dm-devel@redhat.com, linux-crypto@vger.kernel.org, Lars Persson , Tim Chen , "David S. Miller" , Alasdair Kergon , Rabin Vincent Subject: [dm-devel] [PATCH v4 11/14] treewide: Prepare to remove VLA usage for AHASH_REQUEST_ON_STACK X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 11 Jul 2018 20:36:59 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Several uses of AHASH_REQUEST_ON_STACK() will trigger FRAME_WARN warnings (when less than 2048) once the VLA is no longer hidden from the check: drivers/block/drbd/drbd_worker.c:325:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=] drivers/block/drbd/drbd_worker.c:352:1: warning: the frame size of 1120 bytes is larger than 1024 bytes [-Wframe-larger-than=] crypto/ccm.c:235:1: warning: the frame size of 1184 bytes is larger than 1024 bytes [-Wframe-larger-than=] drivers/md/dm-crypt.c:353:1: warning: the frame size of 1096 bytes is larger than 1024 bytes [-Wframe-larger-than=] drivers/net/ppp/ppp_mppe.c:158:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=] net/wireless/lib80211_crypt_tkip.c:537:1: warning: the frame size of 1136 bytes is larger than 1024 bytes [-Wframe-larger-than=] drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:528:1: warning: the frame size of 1136 bytes is larger than 1024 bytes [-Wframe-larger-than=] drivers/staging/rtl8192e/rtllib_crypt_tkip.c:531:1: warning: the frame size of 1136 bytes is larger than 1024 bytes [-Wframe-larger-than=] This bumps the affected objects by 20% to silence the warnings while still providing coverage is anything grows even more. Signed-off-by: Kees Cook --- crypto/Makefile | 1 + drivers/block/drbd/Makefile | 2 ++ drivers/md/Makefile | 1 + drivers/net/ppp/Makefile | 1 + drivers/staging/rtl8192e/Makefile | 1 + drivers/staging/rtl8192u/Makefile | 1 + drivers/staging/rtl8192u/ieee80211/Makefile | 1 + net/wireless/Makefile | 1 + 8 files changed, 9 insertions(+) diff --git a/crypto/Makefile b/crypto/Makefile index 6d1d40eeb964..a4487b61ac4e 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -85,6 +85,7 @@ obj-$(CONFIG_CRYPTO_CTR) += ctr.o obj-$(CONFIG_CRYPTO_KEYWRAP) += keywrap.o obj-$(CONFIG_CRYPTO_GCM) += gcm.o obj-$(CONFIG_CRYPTO_CCM) += ccm.o +CFLAGS_ccm.o += $(FRAME_WARN_BUMP_FLAG) obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o obj-$(CONFIG_CRYPTO_AEGIS128L) += aegis128l.o diff --git a/drivers/block/drbd/Makefile b/drivers/block/drbd/Makefile index 8bd534697d1b..9b6184487cb4 100644 --- a/drivers/block/drbd/Makefile +++ b/drivers/block/drbd/Makefile @@ -7,3 +7,5 @@ drbd-y += drbd_nla.o drbd-$(CONFIG_DEBUG_FS) += drbd_debugfs.o obj-$(CONFIG_BLK_DEV_DRBD) += drbd.o + +CFLAGS_drbd_worker.o += $(FRAME_WARN_BUMP_FLAG) diff --git a/drivers/md/Makefile b/drivers/md/Makefile index 822f4e8753bc..639ff6599846 100644 --- a/drivers/md/Makefile +++ b/drivers/md/Makefile @@ -47,6 +47,7 @@ obj-$(CONFIG_DM_UNSTRIPED) += dm-unstripe.o obj-$(CONFIG_DM_BUFIO) += dm-bufio.o obj-$(CONFIG_DM_BIO_PRISON) += dm-bio-prison.o obj-$(CONFIG_DM_CRYPT) += dm-crypt.o +CFLAGS_dm-crypt.o += $(FRAME_WARN_BUMP_FLAG) obj-$(CONFIG_DM_DELAY) += dm-delay.o obj-$(CONFIG_DM_FLAKEY) += dm-flakey.o obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o diff --git a/drivers/net/ppp/Makefile b/drivers/net/ppp/Makefile index 16c457d6b324..18f35e449c93 100644 --- a/drivers/net/ppp/Makefile +++ b/drivers/net/ppp/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_PPP_ASYNC) += ppp_async.o obj-$(CONFIG_PPP_BSDCOMP) += bsd_comp.o obj-$(CONFIG_PPP_DEFLATE) += ppp_deflate.o obj-$(CONFIG_PPP_MPPE) += ppp_mppe.o +CFLAGS_ppp_mppe.o += $(FRAME_WARN_BUMP_FLAG) obj-$(CONFIG_PPP_SYNC_TTY) += ppp_synctty.o obj-$(CONFIG_PPPOE) += pppox.o pppoe.o obj-$(CONFIG_PPPOL2TP) += pppox.o diff --git a/drivers/staging/rtl8192e/Makefile b/drivers/staging/rtl8192e/Makefile index 6af519938868..fde738cdf876 100644 --- a/drivers/staging/rtl8192e/Makefile +++ b/drivers/staging/rtl8192e/Makefile @@ -15,6 +15,7 @@ obj-$(CONFIG_RTLLIB) += rtllib.o obj-$(CONFIG_RTLLIB_CRYPTO_CCMP) += rtllib_crypt_ccmp.o obj-$(CONFIG_RTLLIB_CRYPTO_TKIP) += rtllib_crypt_tkip.o +CFLAGS_rtllib_crypt_tkip.o += $(FRAME_WARN_BUMP_FLAG) obj-$(CONFIG_RTLLIB_CRYPTO_WEP) += rtllib_crypt_wep.o obj-$(CONFIG_RTL8192E) += rtl8192e/ diff --git a/drivers/staging/rtl8192u/Makefile b/drivers/staging/rtl8192u/Makefile index 3022728a364c..ad059546df88 100644 --- a/drivers/staging/rtl8192u/Makefile +++ b/drivers/staging/rtl8192u/Makefile @@ -26,5 +26,6 @@ r8192u_usb-y := r8192U_core.o r8180_93cx6.o r8192U_wx.o \ ieee80211/rtl819x_TSProc.o \ ieee80211/rtl819x_BAProc.o \ ieee80211/dot11d.o +CFLAGS_ieee80211_crypt_tkip.o += $(FRAME_WARN_BUMP_FLAG) obj-$(CONFIG_RTL8192U) += r8192u_usb.o diff --git a/drivers/staging/rtl8192u/ieee80211/Makefile b/drivers/staging/rtl8192u/ieee80211/Makefile index 0d4d6489f767..9f3a06674c1a 100644 --- a/drivers/staging/rtl8192u/ieee80211/Makefile +++ b/drivers/staging/rtl8192u/ieee80211/Makefile @@ -17,6 +17,7 @@ ieee80211-rsl-objs := ieee80211_rx.o \ ieee80211_crypt-rsl-objs := ieee80211_crypt.o ieee80211_crypt_tkip-rsl-objs := ieee80211_crypt_tkip.o +CFLAGS_ieee80211_crypt_tkip.o += $(FRAME_WARN_BUMP_FLAG) ieee80211_crypt_ccmp-rsl-objs := ieee80211_crypt_ccmp.o ieee80211_crypt_wep-rsl-objs := ieee80211_crypt_wep.o diff --git a/net/wireless/Makefile b/net/wireless/Makefile index 1d84f91bbfb0..f6af5a6233e1 100644 --- a/net/wireless/Makefile +++ b/net/wireless/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_LIB80211) += lib80211.o obj-$(CONFIG_LIB80211_CRYPT_WEP) += lib80211_crypt_wep.o obj-$(CONFIG_LIB80211_CRYPT_CCMP) += lib80211_crypt_ccmp.o obj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib80211_crypt_tkip.o +CFLAGS_lib80211_crypt_tkip.o += $(FRAME_WARN_BUMP_FLAG) obj-$(CONFIG_WEXT_CORE) += wext-core.o obj-$(CONFIG_WEXT_PROC) += wext-proc.o