From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 2120A3BE16A for ; Tue, 2 Jun 2026 09:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780394065; cv=none; b=gf/w8oQ5TUILsP08OOBTXP0ylU90++usr9jn3Y61CugzKLf9zqZf9DaibPGCbeU2kvZAlEZFSF5uOsMGr23Dfnj7JbGKE+qzXtB3VrEq6HWQehHKHB5sO56RAgWIyapAAjDaiXt04qA3xsgCURPsATHh4QFQzQffc0615FiEY3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780394065; c=relaxed/simple; bh=vMyl1APG9x8rbRIHZ/UaBfkgDRSxXmKHikG67TQUrWE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FvKJx9G536Yhsp0cZ3IYUSadwuvoA/W1662+jLrREiNpyA7NTu79Oo5/QSg9RMNiQeYbWoWWLnsFwResd0tIQLRQIamIATaLwF1GknehcAg6xBJCdtqySQcuAftghvEM8tAvSXFpjVZUQKvdmiRGDLoYzyURQ6PQTV19mA6J7yU= 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=QceMoB3l; arc=none smtp.client-ip=209.85.128.42 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="QceMoB3l" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-490b2b037d2so3002075e9.3 for ; Tue, 02 Jun 2026 02:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1780394062; x=1780998862; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PLkbX1HVnS/So1qJRm5FqYtfb6XONO20D/jzobgweiY=; b=QceMoB3l4CriNafjAglf1J0msJy28U8jXl7bCq5JgFSPHcM7XFBRp/AF7mVsAwMHwW ZYIEHfN9aXYSS8qrxLw9auHTHvekkA2TWQ5N/lAzTeMAkbxdIEkj5UhgrjLbP9ZFXJUx JtpX3zdi9C6jGugO/voj3DSYMxymELo7AVhtdw5rWYYw8XU5v1OCT4MVnduG1lb22B3+ 5dDIJeBQl5Y3eDFf6ikVb+YJNXEPn6qrhtYl8RFfYuG6Cn0VaKU0oxsUChq154/iQUWw Y5EgmFikUCh4VG1GzGS8XBbZGNy1Jhztl1oYgb0OJBRGqlypVDD29aex+sNg1HcwcP+K aa3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780394062; x=1780998862; h=in-reply-to:content-disposition: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; bh=PLkbX1HVnS/So1qJRm5FqYtfb6XONO20D/jzobgweiY=; b=esBMAwE+VkIRYckBniw6BXpWB3XnXFqKMVCdwU3J7FdAl+Naa3ugXgSPdyoGOCD+T0 3q0WH1gz5/Rb/3vGVhfpevMLoMIwDi7KJ6pYJvqiFKRqULLzmaTpVIx3vurLJl5LG6cU riN06oJ1Wl43fGjR1CSA6ZXgmZkCFoGX+fXHgVPu6sbXa0glnuWfk+PQ7znfe0sJSsJ1 wOSlEhLCCWs7yqxHb0iViBD+HKyp3tPRQp/71Z0fKyoiP2eJ8oCkB5qYKrRNs8QkeY4Y tCmVYgbk/E+ip61bAXQTpJ1w/9WrfOa2fsoVVgIkyRT6iz0OLZ8jEkIaT+pc8DdaouQt jU5Q== X-Forwarded-Encrypted: i=1; AFNElJ+FBnHxXZSmipI/kZjuVtqs6Ct+LoFFs8WIpweAoZn/DPW4TAGNgn819my/zvpCtHI+PkG+WtgswOx00tQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyAykHHfPqBqklfsVnsCdEE1X6tZkOA6Yvpxua1QRh3rhy6yCbA x2XrtJ2j1bN3H7dBV9HNjvQhvw2D0eBstl4+FGWfJuSI/DQKZMifJySeg+a+XGh/deo= X-Gm-Gg: Acq92OHCgBV42nLyJzT6F4K5gCPt5E6PKvCx68qD9qhsdZzpRgBAB+j2nDc4wIDgBwR Qnu1Xq/6bHB0dPpnyRJzltWwuPR7jv4pw98FtKU/arVOQj4KFZBtBaCn60WPQPLckqhBxKRZSEP HaIAYYv9Vwz4S3gKo3OFZRIvs3tI64b/ao1jkLnKwVZ5y5hQVMUTgb6gaukPdGjm5aE2PIqUVDd 2LhprqWHCwdN6h3d2lxHCCAbGOosmwjQFKy9zsWyIaSXffBenfFB87FnnwZ5Zz7UhyuBAZJDHVV D6B8YWF3HFNrWLKcrlBCjZkjJkABcGOro6arh911WUcVwIhsT7HQrcdP6DaGr6A6EXgnziBLPwL DxPVMpUxlSqoi9uPzHhvCverHSCtrp5Iebia/7woYCfmxEuZVT8qAnWRhd6lRaghn5A8PN7mxGA BTAHsiw+sVxffzkrIQz9WpdhJPByZ2kdI= X-Received: by 2002:a05:600d:848a:b0:490:9d1b:f06b with SMTP id 5b1f17b1804b1-490a2943afamr189761525e9.26.1780394062160; Tue, 02 Jun 2026 02:54:22 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F ([2620:10d:c092:500::6:2ad2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm35194975e9.35.2026.06.02.02.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 02:54:21 -0700 (PDT) Date: Tue, 2 Jun 2026 10:54:19 +0100 From: Gregory Price To: "David Hildenbrand (Arm)" Cc: Yury Norov , Joshua Hahn , Andrew Morton , Zi Yan , Matthew Brost , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Farhad Alemi , Waiman Long , Rasmus Villemoes , cgroups@vger.kernel.org Subject: Re: [PATCH] mm: don't allow empty relative nodemask in mpol_relative_nodemask() Message-ID: References: <20260528124133.c88c27b11a8ea0ef05e494f7@linux-foundation.org> <20260529152616.2308736-1-joshua.hahnjy@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: On Tue, Jun 02, 2026 at 11:19:49AM +0200, David Hildenbrand (Arm) wrote: > > According to the report [1] syzkaller can trigger it. There is no reproducer, > though. > > [1] > https://lore.kernel.org/all/CA+0ovCgxbZkXa+OU8w3s84R3KNPNxxRfmsNR-udh+afQBbGNmw@mail.gmail.com/ > The actual implication of this report is that there is a bug in cpuset, not mempolicy. mpol_rebind_mm+0x3ab/0x680 mm/mempolicy.c:569 ^^^ should never receive a 0-node nodemask ^^^ ...snip... cpuset_update_tasks_nodemask+0x22e/0x340 kernel/cgroup/cpuset.c:2777 ^^^ calls guarantee_online_mems ^^^ ...snip... hotplug_update_tasks kernel/cgroup/cpuset.c:3882 [inline] cpuset_hotplug_update_tasks kernel/cgroup/cpuset.c:3985 [inline] Relevant code: void cpuset_update_tasks_nodemask(struct cpuset *cs) { ... snip ... guarantee_online_mems(cs, &newmems); <<< critical call ... snip ... while ((task = css_task_iter_next(&it))) { ... snip ... mpol_rebind_mm(mm, &cs->mems_allowed); Seems like maybe mpol_rebind_mm should be called with newmems, not cs->mems_allowed, though cs->mems_allowed should never be allowed to be empty, because that makes no sense. Just eyeballing it, I can't say whether calling with newmems is the right thing, or if mems_allowed should not be allowed to be empty, would have to dig in a little further. ~Gregory