Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbdFNVTb (ORCPT ); Wed, 14 Jun 2017 17:19:31 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:57813 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbdFNVT3 (ORCPT ); Wed, 14 Jun 2017 17:19:29 -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 , Greg Kroah-Hartman , Jiri Slaby , Samuel Thibault , Dmitry Torokhov Subject: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN Date: Wed, 14 Jun 2017 23:15:38 +0200 Message-Id: <20170614211556.2062728-4-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:obbGuMO3DfZICmHs6PMFQe5qb/AC5L2+g3P1WTGL1QfU8Rem7/A 6L7YNT4foR6C7EfAA51tIoQLuOvRx3160f3QqzWjWyNd0JvGA1lAjVk7dBCA7XkFq8JpBa5 4nfgGTD6uw8PhJPjfcfNflkS7QUUSgvdVCtIgvV7Fg3ew5HKc+RIr+aZM2rqrrqdwJxbEKY 93C2HEv311Fbt/G0Quc8Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:ExKX8DQOxWI=:7X19Lo/0InpzIz1yu/QY+5 GSF721TJm1FFg+al+cbotBUrj+c2FoVVBy+7TrUQBUTQPDOSe/Ctpim6qkN3D1xcnv8HOgDfd oiHVrLg2whgLQqH1M2Qi5GGFbbFsAsBWwii/bksnnYuWXu7zwtQsrhCxiPkshGBq7Sfv7KWRJ X4fQstEbrii7AtgpG6/FWZbBqPg8VV4KCogna4BuHU6h7Spl8FWMkBQ3w0seQXFBEpklXcIp3 U6LiLjl39zqNyZndzic0go17ATKkph2yspsttSCREcJoibnuPI9AlsxYjv3Lb0koaqnfvcFqv 1+D/zZXfBYI5P5sWdBUG+ZL0BP5W8RgjncqDqatHlAncI/geF4Xoo8wnwif9QXvWbApph6aRk QPlmrBET+aKZPuC6ifhnB5DN86grGJdFCdi73VNiZ4OkLOEhTH4q+YDfK6LwtF8z6+/8+IwnX L8iV4mB3QvREAY11FCM0JyYnm7cjlIaed+3rMKvgIb1is6g57BlFonZFyAbC3MhBw0I+augjv sW6b3WQhKWPlD3U/lpdehWAc85+/JaN/XvHcZRxBBTkDYfY5L2rX+kt1cKHfDB/36nZKf0pTF cslrmE0OW7M2vtQfm5kOkd4KYRwyPD6ww+drgNaVLSt6hYFLSndDhRePtCrAc+2NvIfYJRSBb 55Q9lWtwa+ssSjIs01+0Qty4B3ms6Vlqs9NPbuvhnm5x4KHRnVYgn9gX82501Ealluzw= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1567 Lines: 46 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_if_stackbloat 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 f4166263bb3a..c0d111444a0e 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -301,13 +301,13 @@ int kbd_rate(struct kbd_repeat *rpt) /* * Helper Functions. */ -static void put_queue(struct vc_data *vc, int ch) +static noinline_if_stackbloat 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_if_stackbloat void puts_queue(struct vc_data *vc, char *cp) { while (*cp) { tty_insert_flip_char(&vc->port, *cp, 0); @@ -555,7 +555,7 @@ static void fn_inc_console(struct vc_data *vc) set_console(i); } -static void fn_send_intr(struct vc_data *vc) +static noinline_if_stackbloat void fn_send_intr(struct vc_data *vc) { tty_insert_flip_char(&vc->port, 0, TTY_BREAK); tty_schedule_flip(&vc->port); -- 2.9.0