Re: [PATCH 4/4] rhashtable: fix vmalloc() deadlock in atomic rehash
From: Herbert Xu
Date: Wed Oct 28 2026 - 22:17:17 EST
On Wed, Oct 28, 2026 at 11:42:18AM -0400, Liam R. Howlett (Google) wrote:
>
> Below, one CPU adds an FDB entry for an RTM_NEWNEIGH netlink request,
> while another CPU is inside vmalloc() or vfree():
>
> RTM_NEWNEIGH vmalloc() or vfree()
> ============ ====================
> spin_lock_bh(&br->hash_lock)
> spin_lock(&vn->busy.lock)
> rhashtable_insert_rehash()
> kvmalloc(GFP_ATOMIC)
> vmalloc()
> spin_lock(&vn->busy.lock)
> waits for the other CPU
> softirq: a frame for the bridge
> spin_lock(&br->hash_lock)
> waits for RTM_NEWNEIGH
I think this is a fundamental bug in the kvmalloc non-blocking
support patch. How can it be used at all if it is susceptible
to such dead-locks?
And if you can't use it safely why don't we just get rid of the
broken kvmalloc non-block path and have it always go to kmalloc
like it did before?
> Fixes: c6307674ed82 ("mm: kvmalloc: add non-blocking support for vmalloc")
BTW, rhashtable patches should be sent to linux-crypto.
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt