From patchwork Thu Jun 22 17:13:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 106222 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp231988qgd; Thu, 22 Jun 2017 10:14:58 -0700 (PDT) X-Received: by 10.99.141.76 with SMTP id z73mr3729588pgd.40.1498151697913; Thu, 22 Jun 2017 10:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498151697; cv=none; d=google.com; s=arc-20160816; b=Jl1GPnQ0yEWIVdePp61ceFPZhqD6T0jGgOFdE1VIcvEFLRxiVeL8rQr7wuiNiGBIpa l35bxP3Wpxo8N3OkwNycgLdavDO18GkZnb1P2M4dmK+rh5b2EgyubWGeMgLNofNeQuI+ /m/C6AUpnH2sPvzdMd7dGmr5VtmAhgdrLfUdrhgXp+/YQr8v0ynwFrPnZfQuhTC0CkKH qH+QB5SNe6hZy7+EsnRTdIDCySTSKuZQRuoUr1HCaZEEmBZLeY61epg3oNfhNu/4FKzg SqqM2/ctlPfF4EqZ1RmuMzAX9NdygTOmq5rHg9YdO0WiC8xOHiTHS94p52JaUxqiUV2Z uzaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=E6gM1g7artpJjtGiFQnuEHY10fTIOitMegO8wrxBefw=; b=dAEbN1x4dlK9dowN5mMHW+zjPc2ZW0odAhOp3sI2ExCyGYnK9Kki9UZpoKWXX6ABTU oJCUlcsd1uegj6RMpqjlDtbWKX19x9Pur7kt3oOiTrZxvYxnbRnx8IZELeh0DsoXltFT EsS01DnfxVrig2sTclXSVbcW0uZLoF7QeR/ighI5uZjy2vXmalnQBiBI7TlYz6tdDHPH gV/cvfc2FjHADMgfRkR064RCfDkQy5e17ssCUDJLt7zg83auswZ/E8VLE+dDvtNXSR00 nUoZv/TZlQiRpncJRS+KIZ9K6v8JXmYHJYE2Cw910y02nKVcLWX3GzYwTtCn/bzgYR4P EPEA== ARC-Authentication-Results: i=1; mx.google.com; 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 i133si1530506pgc.544.2017.06.22.10.14.57; Thu, 22 Jun 2017 10:14:57 -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; 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 S1753606AbdFVROp (ORCPT + 25 others); Thu, 22 Jun 2017 13:14:45 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50432 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466AbdFVROm (ORCPT ); Thu, 22 Jun 2017 13:14:42 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Me5Bm-1d99Hv2Qvu-00Pso9; Thu, 22 Jun 2017 19:14:05 +0200 From: Arnd Bergmann To: Andrew Morton Cc: kasan-dev@googlegroups.com, Dmitry Vyukov , Alexander Potapenko , Andrey Ryabinin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Arend van Spriel , Arnd Bergmann , Masahiro Yamada , Michal Marek , Kees Cook , Ingo Molnar , "David S . Miller" , linux-kbuild@vger.kernel.org, Samuel Thibault , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v3 03/11] rocker: mark rocker_tlv_put_* functions as noinline_if_stackbloat Date: Thu, 22 Jun 2017 19:13:47 +0200 Message-Id: <20170622171355.267192-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170622171355.267192-1-arnd@arndb.de> References: <20170622171355.267192-1-arnd@arndb.de> X-Provags-ID: V03:K0:HjDhxuI7Kaf8iKu+oYw8ySLB2MJbPUOykZUtN6zTamUSsei/pxi QWpP6h8tCvS3E2ZhqtwA8F3XJPI7OnwwDh1kh2NxJeJE47lTTq8lSfbq0M+knEBEZ+smSZH rQr5C5klQPcwA4d0uad0uXLOhr8nwWi+AhZTdCljtbugsG0YNLZdnyXQABLkFE/DPLAWKqq oJhqFY5qJ6ON6yKBXf1vg== X-UI-Out-Filterresults: notjunk:1; V01:K0:os4A8fB38Ew=:zX1ky85UNCR9zIjmHkgtfN aMuL8w4KQP8KcigsrbR+m1q7XKQjwqMjWmfN9A590vuIJ0j5VeYuWAb+Y6Dlit7ycjwl2bcvc KMdCNyjgR0a2/PIBhstM2f5Gj2VhkdgJ7zWPcgLZrA8vZVpLh+LbiZHEdQ4bOKX0Sr29oOBBs aBSvxFQso9eCYAhWo2xvfIajeYBI7eh+bClpULGE9FWu/vjVrRBdlx08lejMF5zonIlr11CXh Dg6PG49Bu1qiuTv1ii+t8if038klZQZ927mtFVYTUSxrXtleXQ/Alc//3p/OIO5lZpZGn1EGt Py9BRK3cl8K44vmIV5NJ0al32/S4QGVH9mQypk4Xz3y4Krp2736uJx7355iJCShYiX93pzRoD cBICdn+Oc1C8miRHolHWJj3B6iBI70D4yvT4L5JZiyHS4YJcPUgoFsPQC97E8uZqWlQClfbwS 3JeZDG1oI7yHw3lPygLBmDy0ZKppuYgFVAOx+Xfd5qgCPC/bBSAxiS1+cd/eYUYkZiJUgKIRy tVRo4Qh2xYqT2U5fMdUYKY2BGPVxIDmsandgJGZPvo7PUxTYZl6pTxqbjGvgG0mY0JzqOMPU0 2kCgsI6+68sQcUPfP3CrPdmne+wbGNijngvkYYPCy4cbSlbnwfZmd9+0LJasfJpJkKv3KqeZj 3czqyF83bFLlS3FwFSFaEvDI3XhLw+J7r808ptHrS+OIk/ttAwoHgoU6UV8QXgO05FRY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Inlining these functions creates lots of stack variables when KASAN is enabled, leading to this warning about potential stack overflow: drivers/net/ethernet/rocker/rocker_ofdpa.c: In function 'ofdpa_cmd_flow_tbl_add': drivers/net/ethernet/rocker/rocker_ofdpa.c:621:1: error: the frame size of 2752 bytes is larger than 1536 bytes [-Werror=frame-larger-than=] This marks all of them noinline_if_stackbloat, which solves the problem by keeping the redzone inside of the separate stack frames. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/rocker/rocker_tlv.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) -- 2.9.0 diff --git a/drivers/net/ethernet/rocker/rocker_tlv.h b/drivers/net/ethernet/rocker/rocker_tlv.h index a63ef82e7c72..8970a414eb5b 100644 --- a/drivers/net/ethernet/rocker/rocker_tlv.h +++ b/drivers/net/ethernet/rocker/rocker_tlv.h @@ -139,38 +139,38 @@ rocker_tlv_start(struct rocker_desc_info *desc_info) int rocker_tlv_put(struct rocker_desc_info *desc_info, int attrtype, int attrlen, const void *data); -static inline int rocker_tlv_put_u8(struct rocker_desc_info *desc_info, - int attrtype, u8 value) +static noinline_if_stackbloat int +rocker_tlv_put_u8(struct rocker_desc_info *desc_info, int attrtype, u8 value) { return rocker_tlv_put(desc_info, attrtype, sizeof(u8), &value); } -static inline int rocker_tlv_put_u16(struct rocker_desc_info *desc_info, - int attrtype, u16 value) +static noinline_if_stackbloat int +rocker_tlv_put_u16(struct rocker_desc_info *desc_info, int attrtype, u16 value) { return rocker_tlv_put(desc_info, attrtype, sizeof(u16), &value); } -static inline int rocker_tlv_put_be16(struct rocker_desc_info *desc_info, - int attrtype, __be16 value) +static noinline_if_stackbloat int +rocker_tlv_put_be16(struct rocker_desc_info *desc_info, int attrtype, __be16 value) { return rocker_tlv_put(desc_info, attrtype, sizeof(__be16), &value); } -static inline int rocker_tlv_put_u32(struct rocker_desc_info *desc_info, - int attrtype, u32 value) +static noinline_if_stackbloat int +rocker_tlv_put_u32(struct rocker_desc_info *desc_info, int attrtype, u32 value) { return rocker_tlv_put(desc_info, attrtype, sizeof(u32), &value); } -static inline int rocker_tlv_put_be32(struct rocker_desc_info *desc_info, - int attrtype, __be32 value) +static noinline_if_stackbloat int +rocker_tlv_put_be32(struct rocker_desc_info *desc_info, int attrtype, __be32 value) { return rocker_tlv_put(desc_info, attrtype, sizeof(__be32), &value); } -static inline int rocker_tlv_put_u64(struct rocker_desc_info *desc_info, - int attrtype, u64 value) +static noinline_if_stackbloat int +rocker_tlv_put_u64(struct rocker_desc_info *desc_info, int attrtype, u64 value) { return rocker_tlv_put(desc_info, attrtype, sizeof(u64), &value); }