From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 911FC234973 for ; Tue, 26 May 2026 17:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779815292; cv=none; b=KCsk0YiVu7ow2Ar8unLTSB6ixecvpqn6w3cZzFGfGVlt45zmhj+ras9axseVHfC738CUh0h6HwJ52uo4li8+M3bIiYYPJGivNWzSQXebOEYlAsBQFaib2taM4/Zn6vHlSGuZ3S8qLACTSQhO50nxtyivQOrk/Cp0wWBpXfmRXmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779815292; c=relaxed/simple; bh=ywrxeEbqVWZjQ3IpQ+15YZo4/lQ+VFzjYZatwx8e4J0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NG8gksKSHAbeLguFsIq548E/HJ8/ksH5jSyjMF4jITcFv8hTjgtnP0lDwGVrmp+ZpXykN95FIFDk8dTS4hlz4qnuWQ4W8QDraU7RXV4dhmkwkFpUqv7Ik4wBBt+fcfu8dsB8kOENBrLH2fvQaKYdLjzcOBrA1icgs/J9oktxKDw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XDvjd5x5; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XDvjd5x5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779815290; 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=n3wcos1obwj7Q08IZk4VCQrr8blDf1SXS18FsOnkuTg=; b=XDvjd5x55hA6swxCmSl2X3EG60n+a7tUqn6QqfpTsWdcWXEtBbl2B2mcbRzce8mxCYWOnq 7SGTQmjPPPZePMyXt/demqzc/uPYtokpKnSiDYNHZGiSAxOwijsygReBm5ldJMLxLWC9+O lI7J3PhgYu92yq61XeTvUZvNCfbomVE= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-355-OKmV876oPbGdzv2yO-e-yw-1; Tue, 26 May 2026 13:08:08 -0400 X-MC-Unique: OKmV876oPbGdzv2yO-e-yw-1 X-Mimecast-MFC-AGG-ID: OKmV876oPbGdzv2yO-e-yw_1779815286 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A021919560AE; Tue, 26 May 2026 17:08:05 +0000 (UTC) Received: from fedora (unknown [10.44.48.14]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id D06E119560AB; Tue, 26 May 2026 17:07:34 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 26 May 2026 19:08:05 +0200 (CEST) Date: Tue, 26 May 2026 19:07:30 +0200 From: Oleg Nesterov To: Andrew Morton 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: References: <20260526094242.adf161e66ee7adbb445d81ee@linux-foundation.org> 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: <20260526094242.adf161e66ee7adbb445d81ee@linux-foundation.org> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 05/26, Andrew Morton wrote: > > 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 Of course ;) That is why I have already sent [PATCH 0/4] mm/mempolicy: kernel_migrate_pages: fix race between security checks and suid exec https://lore.kernel.org/all/ahMt6xyUNnacZU8-@redhat.com/ and mentioned this in 0/4. Sashiko has concern about 3/4 in the series above. I personally do not think this is a problem... Without hidepid != 0 /proc/pid/status reports the same "info leak". But may be I am wrong. Still waiting for review from maintainers. Oleg.