lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAABZP2wNEUpM0OyhpKb+EtKY2RynpeU2N2tu9Jw_9B6iv6jGNQ@mail.gmail.com>
Date:   Sun, 13 Feb 2022 12:17:50 +0800
From:   Zhouyi Zhou <zhouzhouyi@...il.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Paul Menzel <pmenzel@...gen.mpg.de>,
        Michael Ellerman <mpe@...erman.id.au>,
        linuxppc-dev@...ts.ozlabs.org, Linux-MM <linux-mm@...ck.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Jason Baron <jbaron@...mai.com>, rcu <rcu@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "Paul E. McKenney" <paulmck@...nel.org>
Subject: Re: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256

Thank Matthew for correcting me

On Sun, Feb 13, 2022 at 12:09 PM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Sun, Feb 13, 2022 at 11:19:09AM +0800, Zhouyi Zhou wrote:
> > I think the key to the problem lies in your attached console.log
> > (pasted below), at times 0.014987 and 0.015995, I see there are two
> > locks (cpu_hotplug_lock and jump_label_mutex)  holded while
> > kmem_cache_alloc calls __might_resched (0.023356).
>
> Those are both sleeping locks (a percpu_rwsem and mutex, respectively).
> There is no problem with sleeping while holding a mutex or rwsem.
>From console.log, I see
[    0.012154][    T1] BUG: sleeping function called from invalid
context at include/linux/sched/mm.h:256
[    0.013128][    T1] in_atomic(): 0, irqs_disabled(): 1, non_block:
0, pid: 1, name: swapper/0
>From ___might_sleep, I see

9506         if ((preempt_count_equals(preempt_offset) && !irqs_disabled() &&
9507              !is_idle_task(current) && !current->non_block_count) ||
9508             system_state == SYSTEM_BOOTING || system_state >
SYSTEM_RUNNING ||
9509             oops_in_progress)
9510                 return;

I guess it is irq_disable which cause the bug.

Thanks
Zhouyi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ