Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752388AbdFPRMd (ORCPT ); Fri, 16 Jun 2017 13:12:33 -0400 Received: from mail-ve1eur01on0123.outbound.protection.outlook.com ([104.47.1.123]:45242 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752041AbdFPRM3 (ORCPT ); Fri, 16 Jun 2017 13:12:29 -0400 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=virtuozzo.com; Subject: Re: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN To: Arnd Bergmann , Greg Kroah-Hartman References: <20170614211556.2062728-1-arnd@arndb.de> <20170614211556.2062728-4-arnd@arndb.de> <20170615045221.GA26687@kroah.com> <20170615045347.GA26913@kroah.com> <20170616130215.GC31057@kroah.com> Cc: Andrew Morton , kasan-dev , Dmitry Vyukov , Alexander Potapenko , Networking , Linux Kernel Mailing List , Arend van Spriel , Jiri Slaby , Samuel Thibault , Dmitry Torokhov From: Andrey Ryabinin Message-ID: Date: Fri, 16 Jun 2017 20:14:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: KL1P15301CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:802:2::33) To HE1PR0801MB2732.eurprd08.prod.outlook.com (2a01:111:e400:7baf::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a7017eb-f412-4aac-b52c-08d4b4dadc57 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:HE1PR0801MB2732; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2732;3:wVPLdLwyH/F/YgXI0wGqg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MOjADuMY+Ei2Ed2eH3OxcFuYu/OXh6DRnf1pqvU4IRuZrwn6jpWtU;20:ild5Qp1n04e7ntenlXRQJmNUp181cS6Lwv0NQUMILG4kfPo+lBJ+MSy11qnKslWsHLROPFpJG57IPmh7jYBrkyPDtUyb0oYIyz65HYENKRVW7pGEdklT9TW5OGYVnyGcF+Jh/FmcOv384QPTaGQ1JXkmEEqquCZefooGXTpPsN2rmdI/qvtdo++jmIk/MGP0wy+Z+uIl8tV/sgiCvKB8DSUsGYeun4CXGQcnHoX5uAQj3qXEAw8mO+nrFYdmUDoCi7oUASDHy6QDQW3PPS2Ykw1aD3lo0LIRSnujKuhHB5wmflTHr6XrgIFrs+gQXsrbBwc/8pfMg+wXTUBquWJwhqZ1mnXg4cwfVKXBDFBPipi1DkZR6CJUqLBjnZQN1eYQJ7jnr62UFON8vO+Mp/70TqNDulnxu/GbWiF/BlIWJu0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0801MB2732;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0801MB2732; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDFNQjI3MzI7NDovbXZxL0lqVHVjaUl5WFNHdlY1UjZhcDJS?= =?utf-8?B?dHgxN0xkWER3MCtwYVoxRUYxdWV6dnU0T1FseDRTbGtsTWVIQXhUbXZsUHhU?= =?utf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USXRyOTZXbytuODJCUjAw?= =?utf-8?B?eGJCL25LbGFEOGhZaEdmbk1mUFlTczhhZVlnUTVNT3l3WGJ6QlAraHhsSSsw?= =?utf-8?B?dlJOalozMVJTV29uVFVDYm1PSWl5V0ZLTDdpM1dxbUJUa2RSYWdoajhEV3N3?= =?utf-8?B?dlgxZWxTcnIzVGtFczVrWTVxVC9LNjgrWloyRncyZWpFSWEvaUVJbDJFTnhN?= =?utf-8?B?NGxjNHNsckhOUmRGQU8rWDd6UE11K3dOL1h3MXB0YzE2WTByWVU3NG5iVzhQ?= =?utf-8?B?bllaVzNlSTdkSUloMVRONmpOY1JxNFBKdm8rbkRndnV0SThjT1VQS2RhZ1NZ?= =?utf-8?B?TktKa05vemlENHdkWWN0b28xZlFrWW1aQTdGMEU1SUtNeG5RakJFdStxRm1k?= =?utf-8?B?ZExaaHFmRW9lUVRKVE9hQnBmQlh2RGw4QjZpUHJ6US9BdkpiWDliL3dHemND?= =?utf-8?B?SFFjQ29rTGRuZ3JIWVFIeW5vZUluT1M2eWllaHBZOFd2VXY4aUIyTlJaRDZ6?= =?utf-8?Q?6XLgFpP9jxSs0wC4bzIw3T5N8F2/rMrIDLADwkv+/g1lM77?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(39830400002)(39410400002)(39400400002)(39450400003)(377454003)(24454002)(31686004)(50466002)(86362001)(31696002)(64126003)(77096006)(6486002)(2906002)(229853002)(33646002)(42186005)(6666003)(2950100002)(93886004)(7736002)(4326008)(53546009)(25786009)(478600001)(53936002)(23676002)(36756003)(8676002)(5660300001)(7416002)(65826007)(6116002)(3846002)(6246003)(38730400002)(54906002)(230700001)(189998001)(4001350100001)(54356999)(47776003)(305945005)(83506001)(81166006)(50986999)(66066001)(76176999);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB2732;H:[172.16.25.12];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Ex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B2732;20:SGP+BWQPTyP+YqqUUvsY7RcI4ZnjyQBPO91JyVif467h9wrIvkTPIbJjBHqDyh+H0rZDj/luNxx01VcnIzkE+1u3rEe1n5g0ibe4s28KlAiJSHhKoS7vtm46EU5y9bxvJKidjV5dyecYBlflIrJkV7S0Avd5iQp1+l1CA5Yj9PU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 17:12:18.7820 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2732 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5281 Lines: 111 On 06/16/2017 06:41 PM, Arnd Bergmann wrote: > On Fri, Jun 16, 2017 at 3:02 PM, Greg Kroah-Hartman > wrote: >> On Fri, Jun 16, 2017 at 02:01:57PM +0200, Arnd Bergmann wrote: >>> On Thu, Jun 15, 2017 at 6:53 AM, Greg Kroah-Hartman >>> wrote: >>>> On Thu, Jun 15, 2017 at 06:52:21AM +0200, Greg Kroah-Hartman wrote: >>>>> On Wed, Jun 14, 2017 at 11:15:38PM +0200, Arnd Bergmann wrote: >>>>>> -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); >>>>>> } >>>>> >>>>> Ugh, really? We have to start telling gcc not to be stupid here? >>>>> That's not going to be easy, and will just entail us doing this all over >>>>> the place, right? >>>>> >>>>> The code isn't asking to be inlined, so why is gcc allowing it to be >>>>> done that way? Doesn't that imply gcc is the problem here? >>>> >>>> Wait, you are now, in this patch, _asking_ for it to be inlined. How is >>>> that solving anything? >>> >>> The three functions that gain the attribute are all those that gcc decided >>> to inline for itself. Usually gcc makes reasonable inlining decisions, so >>> I left the existing behavior my marking them as 'inline' without >>> CONFIG_KASAN and 'noinline' when KASAN is enabled. >> >> But why should we have to care about this? If gcc wanted to inline >> them, and it did so in a way that blows up the stack, that would be a >> gcc bug, right? Why do I have to tell gcc "don't inline", when really, >> I never told it to inline it in the first place? > > I don't think gcc takes stack size into account when making the inlining > decisions. Without the address sanitizer, inlining won't normally have > any negative effects on the overall stack size, and may even help save > a few bytes for the caller-saved registers. > Well, in fact it should take stack into account. Gcc even has following params: large-stack-frame The limit specifying large stack frames. While inlining the algorithm is trying to not grow past this limit too much. The default value is 256 bytes. large-stack-frame-growth Specifies maximal growth of large stack frames caused by inlining in percents. The default value is 1000 which limits large stack frame growth to 11 times the original size. However, I've tried both and even with minimal values gcc continued to make bad decisions. Note, if you're going to try it, make sure that you have CONFIG_OPTIMIZE_INLINING=y because otherwise 'inline' becomes 'always_inline' > You could argue that the gcc inlining algorithm is buggy in combination > with kasan, but what does that help you? In most instances of this > problem, we actually force the inlining (see the other patches in this > series), so making gcc smarter would not help much either. > >>> Would you rather see this patch instead? >>> >>> diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h >>> index c28dd523f96e..25348c5ffcb7 100644 >>> --- a/include/linux/tty_flip.h >>> +++ b/include/linux/tty_flip.h >>> @@ -13,8 +13,8 @@ extern int tty_prepare_flip_string(struct tty_port *port, >>> extern void tty_flip_buffer_push(struct tty_port *port); >>> void tty_schedule_flip(struct tty_port *port); >>> >>> -static inline int tty_insert_flip_char(struct tty_port *port, >>> - unsigned char ch, char flag) >>> +static noinline_if_stackbloat int >>> +tty_insert_flip_char(struct tty_port *port, unsigned char ch, char flag) >>> { >>> struct tty_buffer *tb = port->buf.tail; >>> int change; >>> >>> This is just as good at eliminating the crazy stack usage in vt/keyboard.o, >>> but it will also impact all other users of that function. >> >> How is this function blowing up the stack? We have 2 variables being >> added, that's it. Are we really that low on stack that 2 words is too >> much? > > The 'tb' and 'change' variables don't hurt here, they just get optimized > away. The problem are the 'ch' and 'flag' variables that are passed into > tty_insert_flip_char by value, and from there into > tty_insert_flip_string_flags by reference. In this case, kasan tries > to detect whether tty_insert_flip_string_flags() does any out-of-bounds > access on the pointers and adds 64 bytes redzone around each of > the two variables. > > gcc-6.3.1 happens to inline 16 calls of tty_insert_flip_char() into > kbd_keycode(), so the stack size grows from 168 bytes to > 168+(16*2*64) = 2216 bytes. There are 10 calls to put_queue() > in to_utf8(), 12 in emulate_raw() and another 4 in kbd_keycode() > itself. On ARM64, it happens to decide differently and presumably > doesn't inline tty_insert_flip_char() and kbd_keycode() into > kbd_keycode(), so the maximum stack size isn't as bad, but > the problem still exists. > >> And no, we shouldn't need to do this. It sounds like ksan is the >> problem here... > > Of course kasan is the problem, but it really just does whatever we > asked it to do, and cannot do any better as long as we inline many > copies of tty_insert_flip_char() into kbd_keycode(). > > Arnd >