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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 0F663C433E0 for ; Tue, 16 Mar 2021 10:37:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C68864FD1 for ; Tue, 16 Mar 2021 10:37:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C68864FD1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 00CF76B006C; Tue, 16 Mar 2021 06:37:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EFF126B006E; Tue, 16 Mar 2021 06:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9FE76B0070; Tue, 16 Mar 2021 06:37:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id BB6E56B006C for ; Tue, 16 Mar 2021 06:37:42 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 72A3552C1 for ; Tue, 16 Mar 2021 10:37:42 +0000 (UTC) X-FDA: 77925386364.03.E6FD3EF Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf16.hostedemail.com (Postfix) with ESMTP id D8B028019146 for ; Tue, 16 Mar 2021 10:37:41 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B181A6502F for ; Tue, 16 Mar 2021 10:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615891060; bh=8vg3j4KbPfPGCtaZq86t7nyqRbHFTsK5OFjgTIYKfE0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=d+Qjn9VAZhU8320HlfH2CF0EbAoM7HkH3DWSmpdhX16QM3iC/iWgU3NrykWSeIqI5 6PwLg9/I7L/rXuiwbV+B7CPS2qWTZEW9he9zJBT/s1ENhdiwqX/cOER+oWPAEirl57 L/C3bXCfxio2noARTJbjXLxLPN794rCyy+oEqfUGTeiTCF+/hNrcfUlP7zd05wuHDU NCbstAr9gGzL9CTPQhIGHfpYU923DO/qYj8QVaVaiaeDVVq64YfT2WTAIdnhex62s9 FvpdoeXGZzfEbZCFIzEmUtI/EepUF0A4sB+9TR2DbUOS3Lr8D4R8V7rX2/53dTszGw EtxPP3KLOUh2Q== Received: by mail-ot1-f44.google.com with SMTP id j8so8374137otc.0 for ; Tue, 16 Mar 2021 03:37:40 -0700 (PDT) X-Gm-Message-State: AOAM533kNskiT1i1VvnC7GZuBhD0oYPJv+/NcFwJGt2SUDq24vW9i8Km A7mcuV9HnEMds+0l8VS5P6TdhhknbwaKkemS3a0= X-Google-Smtp-Source: ABdhPJzBZsC6BebipGpd9qkQLkv5f4JpjNvG8vPxGY97HQYtsk7jXKK3lV51bWXjlBbggbKWr0LEZj3gGa0q79LDMx0= X-Received: by 2002:a9d:7512:: with SMTP id r18mr3234126otk.90.1615891059931; Tue, 16 Mar 2021 03:37:39 -0700 (PDT) MIME-Version: 1.0 References: <00000000000069802205bda22b7f@google.com> In-Reply-To: From: Ard Biesheuvel Date: Tue, 16 Mar 2021 11:37:28 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [syzbot] kernel panic: corrupted stack end in openat To: Arnd Bergmann Cc: Dmitry Vyukov , syzbot , Russell King - ARM Linux , Linus Walleij , Linux ARM , Andrew Morton , LKML , Linux-MM , syzkaller-bugs Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D8B028019146 X-Stat-Signature: fjzpdc1uo1u3wzrqjth8notgtid113bc Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615891061-337236 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 Tue, 16 Mar 2021 at 11:04, Arnd Bergmann wrote: > > On Tue, Mar 16, 2021 at 8:59 AM Dmitry Vyukov wrote: > > > > On Tue, Mar 16, 2021 at 8:18 AM syzbot > > wrote: > > > > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit: 1e28eed1 Linux 5.12-rc3 > > > git tree: upstream > > > console output: https://syzkaller.appspot.com/x/log.txt?x=167535e6d00000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=e0cee1f53de33ca3 > > > dashboard link: https://syzkaller.appspot.com/bug?extid=0b06ef9b44d00d600183 > > > userspace arch: arm > > > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > Reported-by: syzbot+0b06ef9b44d00d600183@syzkaller.appspotmail.com > > > > +arm32 maintainer > > I think this is a real stack overflow on arm32, the stack is indeed deep. > > Nice find. I see there was already a second report, so it seems to be > reproducible as well. > If you are able to trigger this reliably, you could try printing the frame > pointer while unwinding to see what is actually going on: > > --- a/arch/arm/kernel/traps.c > +++ b/arch/arm/kernel/traps.c > @@ -68,8 +68,8 @@ void dump_backtrace_entry(unsigned long where, > unsigned long from, > unsigned long end = frame + 4 + sizeof(struct pt_regs); > > #ifdef CONFIG_KALLSYMS > - printk("%s[<%08lx>] (%ps) from [<%08lx>] (%pS)\n", > - loglvl, where, (void *)where, from, (void *)from); > + printk("%s[<%08lx>] (%ps) from [<%08lx>] (%pS), frame %08lx\n", > + loglvl, where, (void *)where, from, (void *)from, frame); > #else > printk("%sFunction entered at [<%08lx>] from [<%08lx>]\n", > loglvl, where, from); > > If that doesn't help, I could have a look at the binary to see which > functions in the call chain take a lot of stack space, if any. > > Which exact compiler version do you use for building these > kernels? I can try doing a build with the same commit and config. > > This one function is one that I have seen before when looking at build > warnings with KASAN: > > > > [<8073772c>] (integrity_kernel_read) from [<8073a904>] (ima_calc_file_hash_tfm+0x178/0x228 security/integrity/ima/ima_crypto.c:484) > > > [<8073a78c>] (ima_calc_file_hash_tfm) from [<8073ae2c>] (ima_calc_file_shash security/integrity/ima/ima_crypto.c:515 [inline]) > > > [<8073a78c>] (ima_calc_file_hash_tfm) from [<8073ae2c>] (ima_calc_file_hash+0x124/0x8b8 security/integrity/ima/ima_crypto.c:572) > > ima_calc_file_hash_tfm() has a SHASH_DESC_ON_STACK(), which by itself can > use up 512 bytes, but KASAN sometimes triples this number. However, I see > you do not actually have KASAN enabled, so there is probably more to it. > FYI, as an aside, the SHASH_DESC_ON_STACK() issue was fixed in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=660d2062190db131d2feaf19914e90f868fe285c (note that the size of SHASH_DESC_ON_STACK() accounts for two struct shash_desc instances)