Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752616AbdFNVSi (ORCPT ); Wed, 14 Jun 2017 17:18:38 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:56038 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbdFNVSg (ORCPT ); Wed, 14 Jun 2017 17:18:36 -0400 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 , Jiri Pirko Subject: [PATCH v2 04/11] rocker: mark rocker_tlv_put_* functions as noinline_if_stackbloat Date: Wed, 14 Jun 2017 23:15:39 +0200 Message-Id: <20170614211556.2062728-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170614211556.2062728-1-arnd@arndb.de> References: <20170614211556.2062728-1-arnd@arndb.de> X-Provags-ID: V03:K0:N8MvLMXQqi4I7IGzAHKnT2mQXNtSNaxpj0ueBjiGqbtbekK27DU ugBTDlLXn5e7Tn7Om7CZfH3jz6rcG8xz1/eIX3Lb5txXuXOEWbOu5GQ8q3BrhxVVPae2MEP ejWN9p1BLhgnLQE4G5dd8862czPUVTZtxNjjc/wTweZoG7zNAVH42F+8ygNltBA8NoXrvjq 1aVsdcbdVzOW2dEW4647A== X-UI-Out-Filterresults: notjunk:1;V01:K0:ro9uji92QhY=:74EHqjgdAPiyN/h1FbNECO gVltqU3vPMQLAAI+14W7phUakyxTN8PSu+gv1kP6OOID4nDemyVIKo5royiSiOFQhFKJgO5tZ CLJt2+AASy4xA5rKisnq/sHSkpEYrwzGDu0kiI8mZFRTa4DujqXYEnA9ijZSlGN1E951oMz0w ESFAclC9wOAaqdAM3gUN4BgTgfYh38T7ogsk+wSCjLp40gxbw8ZYlL8Qa4SXdQBgXfxxatlQ9 grwRDycBrtJfbc3SmwaXd1D11zTO54F0NMw9T8mITSaUT4XPY+YmVSTkbrt6yXqu7yCkHhHoG vtVaWcv7G4HdzCb/aTyN9nj3KB8I87uoOf0g9je+sGF5HcCoJDsqoM/gT3OLloGI4y8ZtWdd6 vf5yKeFI981HPFpAHBfju+yecDCJ8kKg6Ej4GfVQZdzxzw3qeszy+1fkD5myiIv4msmZDdUiS mwunqEIqe8YALio3xwiH5W2goXEKhmzlJFDHbFRQsYV3ApiwluHdhs1gEFJ11lc8kOA6cHUq7 AwqB2s3hwpNs8ZIGUmqF1/4boHGWC9f9fQquOUUU+HGJUaQs8g2mHJ7jrnYWqWoxDPrUyL70x fxsEy4Lbo+grbT49jyvKwjUfdvhlnP0lGTH9nAL5rs1Z9MWpNMbyfH/yPzMrwq/8ojoBAOavj qsvDppt8Ar47KEt7wCaTG+JuPU0J0IqyUfJxOK4Hg+xCFTV9isK1fNateiYbUxjWscv4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2909 Lines: 71 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(-) 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); } -- 2.9.0