From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602AbdFVROp (ORCPT ); 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 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 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(-) 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