From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B47CB38C43F for ; Tue, 26 May 2026 20:24:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779827065; cv=none; b=d072yYFgvsuS5BIhL/07R7ya48Vp6InKEs6T+AzFtl76KONDr+95Iaeswu2UucH2OEHETtM5M0piJFuUX3/pbaDpzvIse0Jexd3QR4uwbvnQzqg9Ecfyd1w/4tjfY1WsOQQPwA03tGJFQGd8xq0dfALHPXXvb7/jEl+HeY233/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779827065; c=relaxed/simple; bh=Hc0/23UBsWwSbnprxM4wxw8G0hLXVv/BuZH+fXeVZgQ=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=SYP5zkv0g/xijLJeBAA1YDWDlrgttjfhIyGAI94KNOAu6do8QPCLoZb/J6rwb34GCcK01ms9Uf7ueUTG8060LuHIBrg3Fw/UkrbHniO0CTNppIgWUTv1QVu4iVzh+a7Cd10aoFCyd0LqWh6AFdyWT9eUnvcyykYSg0BUBbPi6VI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=0xuu54jv; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="0xuu54jv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBD9F1F000E9; Tue, 26 May 2026 20:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1779827064; bh=blBx0fuhONZ21syWWbL6cl6+9gKLYf6WL28E8AAD0MM=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=0xuu54jvYgA8mfdFp1X4447UqkKxvCl+l1IwkBWqQ7TYH97UlAXxIj2RZCsDZQvkI yigpSJnXGWh7aGWXzvHAXC9noYWzeBjPae00bZ+Tf2bGnSuE6mfRdxeeRyXrxHFNIb Tl0eay+AAgSO2SVj3DEm2ero1sIwOTnaOYubQTcI= Date: Tue, 26 May 2026 13:24:23 -0700 From: Andrew Morton To: Oleg Nesterov Cc: Alistair Popple , Byungchul Park , David Hildenbrand , Gregory Price , Joshua Hahn , Matthew Brost , Rakie Kim , Ying Huang , Zi Yan , Jann Horn , Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/migrate: find_mm_struct: fix race between security checks and suid exec Message-Id: <20260526132423.bb6a37e0ca145e0150a0356e@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 26 May 2026 16:42:11 +0200 Oleg Nesterov wrote: > The target task can execute a setuid binary between ptrace_may_access() > and get_task_mm(). Protect this critical section with exec_update_lock. > > I don't think cpuset_mems_allowed(task) should be called under > exec_update_lock, but this patch just tries to add the minimal fix. > > Perhaps we can later add a common helper which can be used by > find_mm_struct() and kernel_migrate_pages(). > Do you think we should backport this into earlier kernels?