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]
Date:   Mon, 26 Sep 2022 17:19:39 +0200
From:   Florian Westphal <fw@...len.de>
To:     Michal Hocko <mhocko@...e.com>
Cc:     Florian Westphal <fw@...len.de>, netdev@...r.kernel.org,
        tgraf@...g.ch, urezki@...il.com, Paolo Abeni <pabeni@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>, herbert@...dor.apana.org.au,
        linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
        Martin Zaharinov <micron10@...il.com>,
        Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org
Subject: Re: [PATCH net] rhashtable: fix crash due to mm api change

Michal Hocko <mhocko@...e.com> wrote:
> On Mon 26-09-22 10:31:39, Florian Westphal wrote:
> > Martin Zaharinov reports BUG() in mm land for 5.19.10 kernel:
> >  kernel BUG at mm/vmalloc.c:2437!
> >  invalid opcode: 0000 [#1] SMP
> >  CPU: 28 PID: 0 Comm: swapper/28 Tainted: G        W  O      5.19.9 #1
> >  [..]
> >  RIP: 0010:__get_vm_area_node+0x120/0x130
> >   __vmalloc_node_range+0x96/0x1e0
> >   kvmalloc_node+0x92/0xb0
> >   bucket_table_alloc.isra.0+0x47/0x140
> >   rhashtable_try_insert+0x3a4/0x440
> >   rhashtable_insert_slow+0x1b/0x30
> >  [..]
> > 
> > bucket_table_alloc uses kvzalloc(GPF_ATOMIC).  If kmalloc fails, this now
> > falls through to vmalloc and hits code paths that assume GFP_KERNEL.
> > 
> > I sent a patch to restore GFP_ATOMIC support in kvmalloc but mm
> > maintainers rejected it.
> > 
> > This patch is partial revert of
> > commit 93f976b5190d ("lib/rhashtable: simplify bucket_table_alloc()"),
> > to avoid kvmalloc for ATOMIC case.
> > 
> > As kvmalloc doesn't warn when used with ATOMIC, kernel will only crash
> > once vmalloc fallback occurs, so we may see more crashes in other areas
> > in the future.
> > 
> > Most other callers seem ok but kvm_mmu_topup_memory_cache looks like it
> > might be affected by the same breakage, so Cc kvm@.
> > 
> > Reported-by: Martin Zaharinov <micron10@...il.com>
> > Fixes: a421ef303008 ("mm: allow !GFP_KERNEL allocations for kvmalloc")
> > Link: https://lore.kernel.org/linux-mm/Yy3MS2uhSgjF47dy@pc636/T/#t
> > Cc: Michal Hocko <mhocko@...e.com>
> > Cc: Paolo Bonzini <pbonzini@...hat.com>
> > Cc: kvm@...r.kernel.org
> > Signed-off-by: Florian Westphal <fw@...len.de>
> 
> Please continue in the original email thread until we sort out the most
> reasonable solution for this.

I've submitted a v2 using Michals proposed fix for kvmalloc api, if
thats merged no fixes are required in the callers, so this rhashtable
patch can be discarded.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ