From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793052189; b=mIcAc2Jr1detka/hH/On4iuV0/+PmppCjICGrknLw5eoksfkXSTxz9Tsn48HwGPMb4ft WG4Rwn/PLD6Kb2A/fi+X3KyaczshOCX/x/kZnotOZ9yuOstaUfcWvNyIH3MXQ4rafm098 tT342gclByO1cwap06EZoUD+xlzR5nK+m4kOyBWEFkpnZxrQvPkxxSv6RRlULxMdJmSM9 eOQ/VTwONjChl2w19Sqoa1CZMxLCAGp1mBAx5+d8IV1aoqQYRmnV+jmxGez6NXREWAaPO BqdtVLbOrPwztoNj5eN2l7psb/FkthW2Pj5Z0lbUVfKn/irFDSsf7DO779B+jBhmcbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793052189; h=Received:DKIM-Signature:Date:To:From:Subject:Message-Id; bh=rJHcJmm9OdDy/GkqN7nf1CjjXNAuKOUsenQLN+/pyFU=; b=ZFihmoJdEXnNu9wYwt+umCxQTsYZuDtWYAtUNH3rY97yNLk9vryJo+SytiSIOvakCi8B yDEUTj7lnK1ULasxdIcRyiUwKavLZcrG6DjHQiTNRYAlEjrzIPcSqiZLE5zhsknuVutB6 GkYCPY45V7jSl/laBk20Lg5FbItmcYnln8Nn9Pc/lSAoZAoJY4c85bBFiixTuDLUsLgg7 u66rUCGWUXGkPd6It6h1cDpKOt8XOG03UL12WpDUDTTYl1XsP+7om/dWfPxqq5mzNaOKk aUcK2DOJvQSSLyITIW7epgoFBXji7XJlYhiKwzZM7/fD4KLs/SuO8P4jePMFhsin5zQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=01efuKfx; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95171606A31A; Mon, 26 Oct 2026 22:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=01efuKfx Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03F621F01825; Mon, 26 Oct 2026 22:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1793052189; bh=rJHcJmm9OdDy/GkqN7nf1CjjXNAuKOUsenQLN+/pyFU=; h=Date:To:From:Subject; b=01efuKfx7tJUZrjdIgqv+bBJX7BF7YnOnYLCmvQCIJ9PL/BtNk9Ur4HH5fwiCJdhL yxW/IHVACTkaKK7RKorsc7t8jRi6vlBjqbyfv2AS4xLTUvjdA1es+OCyA/BmAH0ofY 0tPEbIi6hOffPtIjfAtOZLOLo5kni+YnOFCZq3gQ= Date: Mon, 26 Oct 2026 15:03:08 -0700 To: mm-commits@vger.kernel.org,stable@vger.kernel.org,david@kernel.org, baoquan.he@linux.dev,urezki@gmail.com,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-vmalloc-bail-out-if-in-softirq-context.patch added to mm-unstable branch Message-Id: <20261026220309.03F621F01825@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: mm/vmalloc: bail out if in softirq context has been added to the -mm mm-unstable branch. Its filename is mm-vmalloc-bail-out-if-in-softirq-context.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmalloc-bail-out-if-in-softirq-context.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: "Uladzislau Rezki (Sony)" Subject: mm/vmalloc: bail out if in softirq context Date: Mon, 26 Oct 2026 11:25:03 +0100 vmalloc() is not allowed to be invoked from the NMI, hard-irq and softirq contexts because doing so may deadlock on internal locks. Commit 04aa71da5f35 ("mm/vmalloc: do not trigger BUG() on BH disabled context") replaced the deprecated in_interrupt() macro with explicit in_nmi() and in_hardirq() checks, but unintentionally dropped the softirq context check. Example: vzalloc() in a task spin_lock(&vn->busy.lock) <------ Hard irq irq_exit() process softirq on the same CPU vmalloc() spin_lock(&vn->busy.lock) spins forever Restore the check by checking the caller's context with the in_serving_softirq() helper. Note that, it is still allowed to invoke vmalloc() with disabled bottom halves. Replace BUG_ON() with WARN_ON_ONCE() for in_nmi() and in_hardirq() case. Link: https://lore.kernel.org/20261026102503.30860-1-urezki@gmail.com Fixes: 04aa71da5f35 ("mm/vmalloc: do not trigger BUG() on BH disabled context") Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton Cc: David Hildenbrand (Arm) Cc: Baoquan He Cc: --- mm/vmalloc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/mm/vmalloc.c~mm-vmalloc-bail-out-if-in-softirq-context +++ a/mm/vmalloc.c @@ -3271,7 +3271,13 @@ struct vm_struct *__get_vm_area_node(uns struct vm_struct *area; unsigned long requested_size = size; - BUG_ON(in_nmi() || in_hardirq()); + /* IRQ re-entrancy -> irq_exit() -> process softirq. */ + if (in_serving_softirq()) + return NULL; + + if (WARN_ON_ONCE(in_nmi() || in_hardirq())) + return NULL; + size = ALIGN(size, 1ul << shift); if (unlikely(!size)) return NULL; _ Patches currently in -mm which might be from urezki@gmail.com are mm-vmalloc-use-dedicated-unbound-workqueues-for-vmap-drain.patch mm-vmalloc-bail-out-if-in-softirq-context.patch