From: Uladzislau Rezki <urezki@gmail.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Dmitry Vyukov <dvyukov@google.com>,
syzbot <syzbot+4925d60532bf4c399608@syzkaller.appspotmail.com>,
Daniel Axtens <dja@axtens.net>,
kasan-dev <kasan-dev@googlegroups.com>,
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: BUG: sleeping function called from invalid context in __alloc_pages_nodemask
Date: Sat, 30 Nov 2019 14:44:55 +0100 [thread overview]
Message-ID: <20191130134455.GA27399@pc636> (raw)
In-Reply-To: <77abfacd-cfd0-5a8d-4af7-e5847fb4e03a@I-love.SAKURA.ne.jp>
On Sat, Nov 30, 2019 at 09:48:34PM +0900, Tetsuo Handa wrote:
> On 2019/11/30 16:57, Dmitry Vyukov wrote:
> > On Sat, Nov 30, 2019 at 8:35 AM syzbot
> > <syzbot+4925d60532bf4c399608@syzkaller.appspotmail.com> wrote:
> >>
> >> Hello,
> >>
> >> syzbot found the following crash on:
> >>
> >> HEAD commit: 419593da Add linux-next specific files for 20191129
> >> git tree: linux-next
> >> console output: https://syzkaller.appspot.com/x/log.txt?x=12cc369ce00000
> >> kernel config: https://syzkaller.appspot.com/x/.config?x=7c04b0959e75c206
> >> dashboard link: https://syzkaller.appspot.com/bug?extid=4925d60532bf4c399608
> >> compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> >>
> >> Unfortunately, I don't have any reproducer for this crash yet.
> >>
> >> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> >> Reported-by: syzbot+4925d60532bf4c399608@syzkaller.appspotmail.com
> >
> > +Daniel, kasan-dev
> > This is presumably from the new CONFIG_KASAN_VMALLOC
>
> Well, this is because
>
> commit d005e4cdb2307f63b5ce5cb359964c5a72d95790
> Author: Uladzislau Rezki (Sony) <urezki@gmail.com>
> Date: Tue Nov 19 11:45:23 2019 +1100
>
> mm/vmalloc: rework vmap_area_lock
>
> @@ -3363,29 +3369,38 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
> va = vas[area];
> va->va_start = start;
> va->va_end = start + size;
> -
> - insert_vmap_area(va, &vmap_area_root, &vmap_area_list);
> }
>
> - spin_unlock(&vmap_area_lock);
> + spin_unlock(&free_vmap_area_lock);
>
> /* insert all vm's */
> - for (area = 0; area < nr_vms; area++)
> - setup_vmalloc_vm(vms[area], vas[area], VM_ALLOC,
> + spin_lock(&vmap_area_lock);
> + for (area = 0; area < nr_vms; area++) {
> + insert_vmap_area(vas[area], &vmap_area_root, &vmap_area_list);
> +
> + setup_vmalloc_vm_locked(vms[area], vas[area], VM_ALLOC,
> pcpu_get_vm_areas);
> + }
> + spin_unlock(&vmap_area_lock);
>
> kfree(vas);
> return vms;
>
> made the iteration atomic context while
>
> commit 1800fa0a084c60a600be0cc43fc657ba5609fdda
> Author: Daniel Axtens <dja@axtens.net>
> Date: Tue Nov 19 11:45:23 2019 +1100
>
> kasan: support backing vmalloc space with real shadow memory
>
> @@ -3380,6 +3414,9 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
>
> setup_vmalloc_vm_locked(vms[area], vas[area], VM_ALLOC,
> pcpu_get_vm_areas);
> +
> + /* assume success here */
> + kasan_populate_vmalloc(sizes[area], vms[area]);
> }
> spin_unlock(&vmap_area_lock);
>
> tried to do sleeping allocation inside the iteration.
There was a patch that fixes an attempt of "sleeping allocation" under
the spinlock from Daniel:
https://lkml.org/lkml/2019/11/20/22
--
Vlad Rezki
next prev parent reply other threads:[~2019-11-30 13:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-30 7:35 BUG: sleeping function called from invalid context in __alloc_pages_nodemask syzbot
2019-11-30 7:57 ` Dmitry Vyukov
2019-11-30 12:48 ` Tetsuo Handa
2019-11-30 13:44 ` Uladzislau Rezki [this message]
2019-12-01 11:22 ` syzbot
2019-12-01 15:11 ` syzbot
2019-12-02 4:07 ` syzbot
2019-12-02 4:07 ` syzbot
2019-12-02 4:07 ` [Bridge] " syzbot
-- strict thread matches above, loose matches on Subject: below --
2019-11-30 8:32 Hillf Danton
2019-11-30 11:50 ` Tetsuo Handa
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=20191130134455.GA27399@pc636 \
--to=urezki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dja@axtens.net \
--cc=dvyukov@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=syzbot+4925d60532bf4c399608@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.