From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBA27C433DB for ; Wed, 17 Mar 2021 08:32:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 52F0A64F2B for ; Wed, 17 Mar 2021 08:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52F0A64F2B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C49B26B006E; Wed, 17 Mar 2021 04:32:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0D026B0070; Wed, 17 Mar 2021 04:32:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A72DE6B0071; Wed, 17 Mar 2021 04:32:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 8B69B6B006E for ; Wed, 17 Mar 2021 04:32:08 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 51085181AF5E6 for ; Wed, 17 Mar 2021 08:32:08 +0000 (UTC) X-FDA: 77928698736.04.B247C4A Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by imf10.hostedemail.com (Postfix) with ESMTP id 73F69407F8E8 for ; Wed, 17 Mar 2021 08:32:07 +0000 (UTC) Received: from mail-ot1-f47.google.com ([209.85.210.47]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MuUvU-1leWPf2hsI-00rUcy for ; Wed, 17 Mar 2021 09:32:05 +0100 Received: by mail-ot1-f47.google.com with SMTP id w21-20020a9d63950000b02901ce7b8c45b4so1021618otk.5 for ; Wed, 17 Mar 2021 01:32:05 -0700 (PDT) X-Gm-Message-State: AOAM530Mb/af5UmVRTBweVUS+T8dfgMiOsmF6unIeQ6b3d+GPEMaVMEK 8wKhN/hHcMVBdWPJiiYL9+2hLiWguWqEb4pqIEc= X-Google-Smtp-Source: ABdhPJw0WED6GA+Cp8O4H4XC5cwO0STfMpzH/SMQfAXNc1kpYycFbPPDhLRQrHynegxHzApNDtrTXWPIyV31wwgqbdU= X-Received: by 2002:a05:6830:148c:: with SMTP id s12mr2447135otq.251.1615969924131; Wed, 17 Mar 2021 01:32:04 -0700 (PDT) MIME-Version: 1.0 References: <00000000000069802205bda22b7f@google.com> <20210316155102.GP1463@shell.armlinux.org.uk> In-Reply-To: From: Arnd Bergmann Date: Wed, 17 Mar 2021 09:31:47 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [syzbot] kernel panic: corrupted stack end in openat To: Dmitry Vyukov Cc: Russell King - ARM Linux admin , syzbot , Linus Walleij , Linux ARM , Andrew Morton , LKML , Linux-MM , syzkaller-bugs , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:3hf5NeeO/cJM4V4v+g9pL86wC7AMLNtQ+PsnhIYYYpSwPvsUwh9 cLqOmPTAM0EhGnsEkwEfe/FpzDNHXn0i1SMo29DoEbuyKLAp2WNMyBbhNc2Vd7WxMtCqDOs O3aITvSGw6wU1mMD+Z79CTr6agL1LKLsagwfuytqG1YRytAPWqMe/KtLQWpMOB/IG/foFv2 n+VKUxqlCVk/hQoTvYffA== X-UI-Out-Filterresults: notjunk:1;V03:K0:eGmpalzImXw=:t2fBuAiWKiZSFKsB2/EHPc /b5V/hqCzOR8Y4I1m+Qvx2uDsBxwNFNB+QzYwHKigdLeMH7XqbsGqNT39BL6Ln8SoW49+bE5T XPf0BKLuGYeYCNY/HdgHJbO54rxbww8+NBtlmxBsS7qmqEP3O3vJcowiIdMDY0Kd8jn+F7jeF ltEz43XPtvULFUbEDlvecjv39Ot0Xgj/y5jyvdMgFo9Ke80RWQ3vjHEI/L/6PZwzHY4yGEBgC Jlt8ma/GWz3R+JSjkXbcP8pEvvUExPvNZ5qLEJr4sUoQgIDSm3Klvz+COJGuRWnxx/EX4f+h/ euquVJbuddtr00CAz8warFuprUAiO9BbDpA9qt5uYCaP4IYR7Q7dt48P8XC+l7R5T0gAivG9Q cTas1/nToolEklIBrWSmDsrXYWBvJjN+EUTjrouyHejYaHFQwmaqJ9V19S82x8eysfsJuEFNe fp1ny0zzBdjfCjBn9a5UOoiaa28baKPQFoI+KAr7ljlZfxgPQNjJtQDvWfHfH4i7hnKMsMYx2 tcOzpO6zNCYQqAsL2pH/HsSitp/axmJjU89r7dZ4LOiOSwyeBCgrZV9xto9Go7QXg== X-Stat-Signature: f15spn7m1atwe4g4m56gnep3k6g64es4 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 73F69407F8E8 Received-SPF: none (arndb.de>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=mout.kundenserver.de; client-ip=217.72.192.75 X-HE-DKIM-Result: none/none X-HE-Tag: 1615969927-102795 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 17, 2021 at 8:52 AM Dmitry Vyukov wrote: > On Tue, Mar 16, 2021 at 5:28 PM Arnd Bergmann wrote: > > On Tue, Mar 16, 2021 at 5:13 PM Dmitry Vyukov wrote: > > > On Tue, Mar 16, 2021 at 5:03 PM Arnd Bergmann wrote: > > > > On Tue, Mar 16, 2021 at 4:51 PM Russell King - ARM Linux admin > > > > wrote: > > > > > On Tue, Mar 16, 2021 at 04:44:45PM +0100, Arnd Bergmann wrote: > > > > > > On Tue, Mar 16, 2021 at 11:17 AM Dmitry Vyukov wrote: > > > > > > > The compiler is gcc version 10.2.1 20210110 (Debian 10.2.1-6) > > > > > > > > > > > > Ok, building with Ubuntu 10.2.1-1ubuntu1 20201207 locally, that's > > > > > > the closest I have installed, and I think the Debian and Ubuntu versions > > > > > > are generally quite close in case of gcc since they are maintained by > > > > > > the same packagers. > > > > > > > > > > ... which shouldn't be a problem - that's just over 1/4 of the stack > > > > > space. Could it be the syzbot's gcc is doing something weird and > > > > > inflating the stack frames? > > > > > > > > It's possible, I think that's really unlikely given that it's just Debian's > > > > gcc, which is as close to mainline as the version I was using. > > > > > > > > Uwe's DEBUG_STACKOVERFLOW patch from a while ago might > > > > help if this was the problem though: > > > > https://lore.kernel.org/linux-arm-kernel/20200108082913.29710-1-u.kleine-koenig@pengutronix.de/ > > > > > > > > My best guess is something going wrong in the interrupt > > > > that triggered the preempt_schedule() which ended up calling > > > > task_stack_end_corrupted() in schedule_debug(), as you suggested > > > > earlier. > > > > > > FWIW I see slightly larger frames with the config: > > > > > > 073ab64 : > > > 8073ab64: e1a0c00d mov ip, sp > > > 8073ab68: e92ddff0 push {r4, r5, r6, r7, r8, r9, sl, > > > fp, ip, lr, pc} > > > 8073ab6c: e24cb004 sub fp, ip, #4 > > > 8073ab70: e24ddfa7 sub sp, sp, #668 ; 0x29c > > > > Yes, this is the one that the compiler complained about when warning > > for stack over 600 bytes. It's not called in this call chain though. > > > > > page_alloc can also do reclaim, I had the impression that reclaim can > > > be quite heavy-weight in all respects. > > > > Yes, that is another possibility. What writable file systems or swap > > do you normally have mounted that it could be writing to, and on > > what storage device? > > The root fs is ext4 on virtio-blk. > > There are also several dozens of shrinkers that can be called during reclaim: > https://elixir.bootlin.com/linux/latest/C/ident/unregister_shrinker Right, unfortunately I don't see a smoking gun there either, unless you are also using NFS or devicemapper. Implementing VMAP_STACK as you suggested earlier is probably the best way to figure out if there is an actual overrun of the stack. Alternatively, adding support for GCC_PLUGIN_STACKLEAK might also help find out if we ever get close to the limit. This is probably less work, but it might not actually help in this case. Arnd