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 8362B3D3323 for ; Tue, 26 May 2026 16:42:43 +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=1779813764; cv=none; b=TzPIaz5e02ovwD/zVHKwBL3s3qBdr72v8sXDGdoJnJWh4stX2QOJpP1BFIPPBRh1kFKHAa9IYYMp6dpZ8qWJDSUO9bs8BIWEv7fmgRg2Se8iSNDSK2xpYg4MaoZ1oIckxwr4jTupPCy7ssOSSztvF+odeH+SQ161zuairZRbj08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779813764; c=relaxed/simple; bh=3aU56JP7Uxord6e8Zv7QretOOi0IEclsnyZGsLt/BVA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=aJ2oovuNeUaLErOpm6NtVEKnw/2zN/Dzs4wQ62Hy8DVl98Xe3/JytfgAKM2Rk0WGj8wgN0wAOXpqxvpH+2112kF9NrjC0R44xXb9x6S6GCZLdH58EWdBndaKhTDqSz6cjxLNMYJGP4aBbgS4WIIuLvh7YLTs7zAWayt2GKebvIw= 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=Py2YGmy8; 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="Py2YGmy8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8BE31F00A3A; Tue, 26 May 2026 16:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1779813763; bh=R1TxQbHcJCgYm2L6KOKrWRkDSGiXwZPm8LbYus7RKfo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Py2YGmy86wcxHPArJ9qMsjVuxLQJQJaJMhs9cSzGpNMwiNNwgCxtUxQxklvslS36l hUjE4Z8g9PNKd51+Qs3Akk/ErBA8hRaMFYUDzD0mHpkxRrXf7LneDrNuEsmD0jz4oN AUlrXYJgQFcOD/NgGDLxw4hRnF8AYEeTzzxKClKg= Date: Tue, 26 May 2026 09:42:42 -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: <20260526094242.adf161e66ee7adbb445d81ee@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(). > Thanks. Sashiko thinks we should fix kernel_migrate_pages() also: https://sashiko.dev/#/patchset/ahWxQ3JxdR5ff2qf@redhat.com