linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Dmitry Vyukov <dvyukov@google.com>,
	syzbot <syzbot+0b06ef9b44d00d600183@syzkaller.appspotmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: [syzbot] kernel panic: corrupted stack end in openat
Date: Tue, 16 Mar 2021 15:51:02 +0000	[thread overview]
Message-ID: <20210316155102.GP1463@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAK8P3a0zA9pv005d_P_e64j4EwXDh75yC6gNGRVdyy-VzO+7Fw@mail.gmail.com>

On Tue, Mar 16, 2021 at 04:44:45PM +0100, Arnd Bergmann wrote:
> On Tue, Mar 16, 2021 at 11:17 AM Dmitry Vyukov <dvyukov@google.com> wrote:
> > On Tue, Mar 16, 2021 at 11:02 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > > > On Tue, Mar 16, 2021 at 8:18 AM syzbot
> >
> > > > > [<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.
> >
> > 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.
> 
> I see ima_calc_field_array_hash_tfm() shows up as one of the larger
> stack users, but not alarmingly high:
> ../security/integrity/ima/ima_crypto.c: In function
> ‘ima_calc_field_array_hash_tfm’:
> ../security/integrity/ima/ima_crypto.c:624:1: warning: the frame size
> of 664 bytes is larger than 600 bytes [-Wframe-larger-than=]
> none of the other functions from the call chain have more than 600 bytes
> in this combination of config/compiler/sourcetree.
> 
> In combination, I don't get to more than ~2300 bytes:

... 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?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!


  reply	other threads:[~2021-03-16 15:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16  7:18 syzbot
2021-03-16  7:59 ` Dmitry Vyukov
2021-03-16  9:24   ` Russell King - ARM Linux admin
2021-03-16  9:51     ` Dmitry Vyukov
2021-03-16 10:02   ` Arnd Bergmann
2021-03-16 10:17     ` Dmitry Vyukov
2021-03-16 15:44       ` Arnd Bergmann
2021-03-16 15:51         ` Russell King - ARM Linux admin [this message]
2021-03-16 16:03           ` Dmitry Vyukov
2021-03-16 16:03           ` Arnd Bergmann
2021-03-16 16:13             ` Dmitry Vyukov
2021-03-16 16:28               ` Arnd Bergmann
2021-03-17  7:47                 ` Dmitry Vyukov
2021-03-17  8:31                   ` Arnd Bergmann
2021-03-17  8:50                     ` Dmitry Vyukov
2021-03-16 10:37     ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210316155102.GP1463@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=dvyukov@google.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=syzbot+0b06ef9b44d00d600183@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox