From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88ACD38553F for ; Fri, 21 Aug 2026 17:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787334009; cv=none; b=Y7cgsn2BVEZunnVNHusnrJsI1DbLvu7QMSb9nikhYZ650N8Joe8lgvHn0i9GpotnFiqpLyFiuHbz+/7qopr8d0ZHZjUXghuacIdb/em3YVPUiw5lzse0vP+5YZhcyfKlz07IoHe2NVeaft9L9eIZpenClJMCHtsYPoOp18nw8LU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787334009; c=relaxed/simple; bh=FmDXmGELPvxUPDSq949unzGdJoBupnv+HX21NPcdu2w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tyatfHIM00/XaVH6tcZEgjQwQBEzkLHKDtvl0hVr8Oe6Lzw9pqvOtIdeg8VJux/Cc2OQ69HkKBdLj41H0+FFOJDJt8AGOzo4A8HwRIsDQx1QJPcoyRAGOWI8V+TFlER5aGvMEsxvRA9n/Lh5tfrrN9BYZ8aoXRMMfMIYVVJQets= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=btQYjHF1; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="btQYjHF1" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-93738ebbffaso65416385a.3 for ; Fri, 21 Aug 2026 10:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1787334006; x=1787938806; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=g/LOIEO2zvXm+1il73lApOnhY9ShiLcmm1S4Hmc7OsA=; b=btQYjHF1tTAG4thIb4kJKES+gnEFzgvDb3pAk064dI8Wuqj2mzU75OvFnTI0XMUhfC 2k3Ckt2vTFLw4Zdzv6zL9eBrlAfgBM88P3XU6bXYvtvELzXusRXwfwnJ02SEOTJpYc6u EleuzNzA3/IAbHpwvXxwULmE6kfHKfEfxHWyPT0I77WbtaQ9EaJtcT7cyUwSW4fnAm2y TK9+2QD1WsIPcwaL1juZyaXXTqW8a0qG20qWEtSQEKfV9RA/fPHFIf+HZ4ZafixdqQd7 g7l0xXyLQllbKKGfSDr6Ij8eE+eJiIcq9KPbObtkX8damDred0OuPJpv8CCgLoIJ3+cp b9wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787334006; x=1787938806; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=g/LOIEO2zvXm+1il73lApOnhY9ShiLcmm1S4Hmc7OsA=; b=H1EXMKyiff2tk4NusFlV40H/rOtD6iWx9V7Wk6PjNkiyt+/74a1RREi8oIOwmEC8Rm TMcjiEugXc2pLb6UkgeJYOzMUqfPPajrt/AegYtpY7YS1NkjDjpYVqlxEmF5otSGM9nb A+azpqCrA1U+WbnPvV72+F79RvVFs2l4WbgzjG+BBev8mtnzuuukApreB/IA/Wd4P333 5VBsPz6u9y48brUqhIxo670ENx8e5kiUr1s6f5YiX/0cMk9zWUc8lENuSoVYjSFOGBdL LrexWbpcWCvGce2ynIAnm2sG/ks5khVHhwfMo5xUTo76GQm6Y2Q9xC2dUbLUNCom/bBW pA/Q== X-Forwarded-Encrypted: i=1; AHgh+RoLci0QrqdjiQWKAz0Dl2CRHgTu15t2ehdy5eGxUTKEf/3YET652QcK5UpxlNMw6Cn0gU2GNQ497CFCoxw=@vger.kernel.org X-Gm-Message-State: AFuF++nkVfrArLP7LEPqPT/kzCx9n9qqg1jJson18SaFJpzWPNAmVYrl eRmvPV50oP/9xUOuNNT2fdx+ZWAmyXzlVLqqzAqxIohH9t+Wrr25XECimxH/kWT8YRY= X-Gm-Gg: AR+sD10ZmZ7ji7EP03i2eXYmjCBueJXXN+1iDC7V7EXIhNE1QEixjZ9qdRmxm8FqVmV xGHCRIH1QdvwSDit6B12fUNgXFpRPjTImOowkyQhskroHzEt7vZpBB4eyg4ctidfEvUeyhmkwKc ms/T96t2U/9wW4EX9vTpsCYpjhHiOH/OPXUrdf5VgrnXznJvZPxfUrD3aNbmR2TUssnDBey0vjN JhIuvQ+gzrTTaekUVJf3KWpZL4ZzjBW/50f2gdJABnB6miOWuvjJfqXPjLfSMRdjRZny+qMbpnX 7r8ZIqyGoTBpYT0WOzsWDbAXyukxgnhBH/thrS8TBDG1OYOTkKKYikXkj+wWqTBZ01pDHcnpoSs 7NRltYI9+yLw0CShGxjKvC8dkFuQEj68JF6+wNNrqwvDW1Gw8TtjyjX7+VK7sPN9bbc7RAeg40l J7RasyZvcjP36ObPgxd5hzkWwwFYOoImnk7+1gxcHLgcyN9lnSjkeSnoml96vtr1tz+GtnG5p/a yvGlFrzj55Vlvl0BcLWhRvx+fa/03+Zjoyk/VT+sjfM X-Received: by 2002:a05:620a:400c:b0:934:b07f:aebd with SMTP id af79cd13be357-937395d0cccmr654779385a.46.1787334005582; Fri, 21 Aug 2026 10:40:05 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9372ea69aa0sm392753685a.4.2026.08.21.10.40.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 10:40:05 -0700 (PDT) Date: Fri, 21 Aug 2026 13:40:03 -0400 From: Gregory Price To: Eric Dumazet Cc: Andrew Morton , linux-kernel , syzbot+0dbf6d295b3350944f0b@syzkaller.appspotmail.com, David Hildenbrand , Zi Yan , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , linux-mm@kvack.org Subject: Re: [PATCH] mm/mempolicy: Fix sleeping allocation in alloc_pages_bulk_weighted_interleave() Message-ID: References: <20260821170407.3721004-1-edumazet@google.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: <20260821170407.3721004-1-edumazet@google.com> On Fri, Aug 21, 2026 at 05:04:07PM +0000, Eric Dumazet wrote: > syzbot reported a sleeping function called from invalid context splat > in bucket_table_alloc(). > > When rhashtable_insert_slow() rehashes the table under rcu_read_lock(), > it calls bucket_table_alloc(..., GFP_ATOMIC | __GFP_NOWARN). > If the bucket table allocation uses vmalloc, __vmalloc_node_range_noprof() > invokes vm_area_alloc_pages() -> alloc_pages_bulk_mempolicy_noprof() with > the passed GFP_ATOMIC flags. > > If the current task has an MPOL_WEIGHTED_INTERLEAVE mempolicy, > alloc_pages_bulk_weighted_interleave() is called and currently hardcodes > GFP_KERNEL when allocating the temporary weights array, triggering > a might_alloc() splat in atomic/RCU contexts. > > Pass the gfp flags (masked with GFP_RECLAIM_MASK to strip page-allocator > zone modifiers like __GFP_HIGHMEM) received by > alloc_pages_bulk_weighted_interleave() to kmalloc() instead of > hardcoding GFP_KERNEL. Since the weights buffer is immediately > initialized in full, kmalloc() is sufficient. > > Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving") > Reported-by: syzbot+0dbf6d295b3350944f0b@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/lkml/6a88837e.ae6ddae5.3da009.0040.GAE@google.com/T/#u > Signed-off-by: Eric Dumazet Yup, seems a solid oversight on my part. Reviewed-by: Gregory Price (Meta) ~Gregory