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=1796149296; b=ojjh2MBAWQIeJFWnVQusIKwZ96KMT2SsVcKm8yCL+gNi5m1W51ZwdDel21HOuMU1wcfe C1z6Fw7iKlmLzzVeGvjZwhvBWKJt/s8k2Dy6AYIot1MJLWYGbR/ln1uYlIwNA5oOprdme vYDDDuT2IBpeiztW05qswoC1Szl9I4p2ENvcwZNEuJLPvUIGMiiXMGS9M5iDcPd8+M9AZ 3HWenXml7QZl0Vtc7zp47iZsta/pRw+A5uZoh6ZG2l7UPv+keYVlXcH1P32trqMNRRIzN rbcA0vAJBmFWWYmDbGOozEJB3Rn7z59gVXFkuoafTORiUXvsdkL+cJzMJSRVQz+D6wg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796149296; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=xQ2CpAXOZ9Hy27pdXzXaFMY3K8pDq3znma+EXPJBoK4=; b=IywyITWAAI/H81zh3tFfoi/7UN4Oyhmt1M9tN7RFCSeM4hpM8ZjY9jlpZzuIeCBknq3X A7OqG9bFRoPVm8X8vUjZAnAhOfwT5Z3Nl95mxy2YTlDsGDJ7itW/O8ZDI9cSNr8YGAjJG yei9yayxA2cf+OSpuvuSh5/ZXv2nw17IwKlOjVWOVWt65ksGEJBSxMUmGsdjv8DcyzzEC hCpFyH3c7wa7BfON9X8xMCLZs7w31Gn8mFVFkK9qTPVlyEHwzkn+p1bTqECjZcW06Dq5O 2lSJYtUUGKzx68IPkir0Kl7sE3WgnBva51WXqp+DkEDbYyXim4LTQcc+cD51KGtAxNQ== 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=x0f18s6R; 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 664DF606A31A for ; Tue, 1 Dec 2026 18:21:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=x0f18s6R Received: by smtp.kernel.org (Postfix) with ESMTPSA id E51D71F00925; Tue, 1 Dec 2026 18:21:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796149296; bh=xQ2CpAXOZ9Hy27pdXzXaFMY3K8pDq3znma+EXPJBoK4=; h=Date:To:From:In-Reply-To:References:Subject; b=x0f18s6RT0ar/GSDKaoNNnRhf1XBNq1G0nK+ZaHvuwlr08bneB3AlWT8fTLp2TUef X6+BhjDbPO27cFWYa+WcuEDKk8M6ruHGZdmdw404tsvJv7D13OQuD4FKEoVTBAIxUb 21rxG2cZPifv3ae1CVOoaqcYDvcMiSMwUhrH1YZw= Date: Tue, 01 Dec 2026 10:21:35 -0800 To: mm-commits@vger.kernel.org,david@kernel.org,baoquan.he@linux.dev, urezki@gmail.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261201173727.90526-1-urezki@gmail.com> References: <20261201173727.90526-1-urezki@gmail.com> Subject: + mm-vmalloc-bail-out-if-in-softirq-context.patch added to mm-hotfixes-unstable branch Message-Id: <20261201182135.E51D71F00925@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-hotfixes-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-hotfixes-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: Tue, 1 Dec 2026 18:37:27 +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 original context restriction including BH-disabled task context. Use WARN_ON_ONCE() and return NULL instead of BUG_ON(), so invalid callers are reported without triggering a BUG. Link: https://patch.msgid.link/20261201173727.90526-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 mm/vmalloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/mm/vmalloc.c~mm-vmalloc-bail-out-if-in-softirq-context +++ a/mm/vmalloc.c @@ -3266,7 +3266,12 @@ struct vm_struct *__get_vm_area_node(uns struct vm_struct *area; unsigned long requested_size = size; - BUG_ON(in_nmi() || in_hardirq()); + /* + * Reject interrupt contexts, including BH-disabled task context. + */ + if (WARN_ON_ONCE(in_nmi() || in_hardirq() || softirq_count())) + 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