From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13FC52EC09F for ; Tue, 19 May 2026 01:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779154831; cv=none; b=Vcp3j9KBDVS7AtmfkYQ9TsY6DXx6iO3FsOX6UY0BM0/ht/89BjL5xZH2piE/hWB4ENG5HDvJZC9ad2pG+a0haTWd+XIuWZKE6BIoOk9TubhxWYTbUKa0DX2MRi6RAcrFV/v3x4vHN0RhpaDnS9X/SjrwK0GGFM5/6Bc9EnZ2mb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779154831; c=relaxed/simple; bh=UuYCkakm32O32yettIG3qSF1MAAN+MuoKbY5f50rQiA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p5isQzHgcDqOsqcKnfyvUaivMeoM/RSU6Hil4BDLfBBxZm8LZOdXeYLBWV2RuhwgWRqAORm9OrOA5QFbL8XQ0efmrrMtY9WO0O32OQqI0mVMvyctro0UAq9D1eBuSQB0v+/ZR495env4drgg7ZzgzmPriwYDwAjegETJm3GEDto= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=DJGuWxRc; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="DJGuWxRc" Date: Tue, 19 May 2026 09:40:19 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779154827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aFNPqECUvzIjQM2xh3jiajRWrtxxd4LfC5NGW5y7hhI=; b=DJGuWxRcGchDQ9kHK45v116lREVNAqyqy9LrbHfpc8iFeHs12FtRl+j39x7uPYC8ooHg8g DUWHNd35b2t7Zi2vCBG4oBuwi4uYUthgSzQ18xZBUgtHhe/TQC0ykJPHb0z2+YeK6L7BkX LCiLJA27W4vm+AIdoaTKerSAFBrGU+o= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Baoquan He To: "Uladzislau Rezki (Sony)" Cc: linux-mm@kvack.org, Andrew Morton , Baoquan He , LKML , Ido Schimmel , syzbot+8b12fc6e0fb139765b58@syzkaller.appspotmail.com Subject: Re: [PATCH] mm/vmalloc: Do not trigger BUG() on BH disabled context Message-ID: References: <20260515153009.2296191-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260515153009.2296191-1-urezki@gmail.com> X-Migadu-Flow: FLOW_OUT On 05/15/26 at 05:30pm, Uladzislau Rezki (Sony) wrote: > __get_vm_area_node() currently triggers a BUG() if in_interrupt() > returns true. However, in_interrupt() also reports true when BH > are disabled. > > The bridge code can call rhashtable_lookup_insert_fast() with > bottom halves disabled: > > __vlan_add() > -> br_fdb_add_local() > spin_lock_bh(&br->hash_lock); <-- Disable BH > -> fdb_add_local() > -> fdb_create() > -> rhashtable_lookup_insert_fast() > -> kvmalloc() > -> vmalloc() > -> __get_vm_area_node() > -> BUG_ON(in_interrupt()) > spin_unlock_bh(&br->hash_lock) > > this triggers the BUG() despite the caller not being in NMI or > hard IRQ context. Because the current vmalloc supports non-blocking allocation, so we need to skip disabled BH or in_serving_softirq() cases to avoid unwanted BUG(). This change looks great to me, not sure if I undersand it correctly. Reviewed-by: Baoquan He Thanks Baoquan > > Replace the in_interrupt() check with in_nmi() || in_hardirq(). > > Cc: Ido Schimmel > Fixes: c6307674ed82 ("mm: kvmalloc: add non-blocking support for vmalloc") > Reported-by: syzbot+8b12fc6e0fb139765b58@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/all/69ff8c7c.050a0220.1036b8.000b.GAE@google.com/ > Signed-off-by: Uladzislau Rezki (Sony) > --- > mm/vmalloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index 676851d5cfe7..273bbe49eaef 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -3209,7 +3209,7 @@ struct vm_struct *__get_vm_area_node(unsigned long size, > struct vm_struct *area; > unsigned long requested_size = size; > > - BUG_ON(in_interrupt()); > + BUG_ON(in_nmi() || in_hardirq()); > size = ALIGN(size, 1ul << shift); > if (unlikely(!size)) > return NULL; > -- > 2.47.3 >