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 810E73C2BA8 for ; Wed, 27 May 2026 10:03:00 +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=1779876182; cv=none; b=ei41cn0bR46RTGN35JmFOJ/jxPTrHpOwUDuUjWdSfPvlLTCg8Vqrd3iryhiYz2QlUC1rCY6RGY2K1svXyB3tZODMNJJSI37PjDAzx2GqhUzr8yn0iOvgHbB9ZwLuJKeNSbDnz7M4LiCzlIP9T12XxJK3nJ4wBJlZPIRVrH79Z8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779876182; c=relaxed/simple; bh=z2adFsX7jkGvB/QFfboMITsC3la9SVEZJatB42Ng8nM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UGaZsPSC2xh0Lkp21PnnolmHgoA0tXN5XybIoub39wNcBj/syVaOxizbFnvXhs8rLmTMEtLA8UXrWgZ3h+iocf/hVGVfAqz4oz7rIAWRfBRHuQ5Z67mDCb7+0b8fQ0zEuCbypDN9oVik3w45wQQqamk1nZ9IjIOPQMKi6A56CKo= 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=QQvAE7p4; 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="QQvAE7p4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779876179; 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=z2adFsX7jkGvB/QFfboMITsC3la9SVEZJatB42Ng8nM=; b=QQvAE7p48RvhsrXb9RPpBgIpJeu8CoPLpJjATSL/oJqg2jyKvavDXJEEwC2QparZn3rsrV Tl7NcxaPZXAUtYyReMjLDHGhsgS1/bcrzTTBTftzgfnpMoev2tLUZAt9MW4un10J+zdXzV lSQYJBQgRNf2cgXKpDlytxjgEUXJSgs= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-381-a13UjwWEPkWaDF_NMBgG6Q-1; Wed, 27 May 2026 06:02:53 -0400 X-MC-Unique: a13UjwWEPkWaDF_NMBgG6Q-1 X-Mimecast-MFC-AGG-ID: a13UjwWEPkWaDF_NMBgG6Q_1779876171 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1D06A180056E; Wed, 27 May 2026 10:02:51 +0000 (UTC) Received: from fedora (unknown [10.44.33.166]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id B34F230001BB; Wed, 27 May 2026 10:02:45 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 27 May 2026 12:02:50 +0200 (CEST) Date: Wed, 27 May 2026 12:02:43 +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: <20260526132423.bb6a37e0ca145e0150a0356e@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: <20260526132423.bb6a37e0ca145e0150a0356e@linux-foundation.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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(). > > > > Do you think we should backport this into earlier kernels? Probably not... The race is very unlikely and iiuc the impact is not serious... Up to maintainers. Oleg.