From patchwork Thu Mar 2 16:38:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9601141 X-Patchwork-Delegate: kvalo@adurom.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 CCA8460453 for ; Thu, 2 Mar 2017 17:16:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7CE926BE9 for ; Thu, 2 Mar 2017 17:16:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAB6E28479; Thu, 2 Mar 2017 17:16:58 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D81026BE9 for ; Thu, 2 Mar 2017 17:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754742AbdCBRM7 (ORCPT ); Thu, 2 Mar 2017 12:12:59 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:58019 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753220AbdCBRLM (ORCPT ); Thu, 2 Mar 2017 12:11:12 -0500 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LmT7D-1cBF3y0hed-00aAXO; Thu, 02 Mar 2017 17:38:49 +0100 From: Arnd Bergmann To: kasan-dev@googlegroups.com Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, kernel-build-reports@lists.linaro.org, "David S . Miller" , Arnd Bergmann Subject: [PATCH 04/26] tty: kbd: reduce stack size with KASAN Date: Thu, 2 Mar 2017 17:38:12 +0100 Message-Id: <20170302163834.2273519-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de> References: <20170302163834.2273519-1-arnd@arndb.de> X-Provags-ID: V03:K0:MbK4+5NImVjwkAkvaQzCBXV8NBTjnPZJnk8G8G3eIMJBKVpVkbp 6Qqxo/vGP2z5gOgXrzx9iLSEBKMA5K8PLEZCWB8oYoTnkt+KW6XcG5VuquFHAw+kTdXL5hk BMivFpYqHd2RlDwkgq0eWKgeG9BLbVMpf++aLdZMBmaRl3u4ZIFbALm5n3jkLPQpf/9dZTh c0aFipMND++ZX+xpwh1Ug== X-UI-Out-Filterresults: notjunk:1; V01:K0:GR79i9vN8qg=:TdmQS2kgDP3BANZTbLFrb0 djJAEosrrIguGMZYmqG68pyzFrVid+ChtAhG0+BkcP7/gnKuOqX9Xz+H1xoRMUV4yDIVOfoM7 eaCE61besOwAMRDpYAjcBmWcwihR275rmq0w6Aml0lZJyPHxqOi3sauPXQVtVVcFX46G8/wiW +WbozuZ4+ul7cuFMLOqxeaycuTNG+HuoHVWLiEOUalvCxaxBr2gB/so9OY1scqMDPrsPLlYpo 9YQ8V17ANjqCUjCvO5xjrzq1fOukgPJUhCkoioKcibU9OAwbeWxOsv/YnunTK71BTNND+i2Vu rr+un0sFDqOqffpU7jlS+1xSao+OT+6zyF9JUxDJ47+euuPXTCwWYzV25pveayHoTFjoyggkd mlC2LbknJfIifUtuId7QsrLdXhmFBlRUoiCw7dhdkCvhUHsIpjybTksLznF/x5z5ul/hEXMTD 7Hm/MUCxVo2XEczMuwtHPIOv4VHvinHHJ2us6XfSJvADK95gR0wI6YucAngfwVk3RZwlqdNmT VkSpk3MLY9Il3W3m3fujbGhRSjydYnAoaySZ5fJ3pMOub4LedcPs7vJFIM8X4PeSKdoldZupb 6iFpVC8ACobH3rlV3qxJI/0SxKPoAB6il4BdLm2ql0tVU4iB5Wu5bUOIT2igPGmxebjS8iWZe 7wardvKVo8f+S3A0YwHDrfQASzmkcoat3p3f/+LRvNxvNPXc02GQA3jBKZO+kowXFr9o= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As reported by kernelci, some functions in the VT code use significant amounts of kernel stack when local variables get inlined into the caller multiple times: drivers/tty/vt/keyboard.c: In function 'kbd_keycode': drivers/tty/vt/keyboard.c:1452:1: error: the frame size of 2240 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] Annotating those functions as noinline_for_kasan prevents the inlining and reduces the overall stack usage in this driver. Signed-off-by: Arnd Bergmann --- drivers/tty/vt/keyboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index 397e1509fe51..f8a183c1639f 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -300,13 +300,13 @@ int kbd_rate(struct kbd_repeat *rpt) /* * Helper Functions. */ -static void put_queue(struct vc_data *vc, int ch) +static noinline_for_kasan void put_queue(struct vc_data *vc, int ch) { tty_insert_flip_char(&vc->port, ch, 0); tty_schedule_flip(&vc->port); } -static void puts_queue(struct vc_data *vc, char *cp) +static noinline_for_kasan void puts_queue(struct vc_data *vc, char *cp) { while (*cp) { tty_insert_flip_char(&vc->port, *cp, 0); @@ -554,7 +554,7 @@ static void fn_inc_console(struct vc_data *vc) set_console(i); } -static void fn_send_intr(struct vc_data *vc) +static noinline_for_kasan void fn_send_intr(struct vc_data *vc) { tty_insert_flip_char(&vc->port, 0, TTY_BREAK); tty_schedule_flip(&vc->port);