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.133.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 8BE7C37998A for ; Mon, 1 Jun 2026 12:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780317765; cv=none; b=NxjM2fx3H6gKZ82la08zZ3hcx2KKFKT0i2tpfSySWd8XbUmrXiaGsc5qVgEkuYYFMcQCWEAnppCCihBScfnLZi/7H5+/XDKALhoUBkeQe4yhKhKeL2EyK1R3+4ZJUwhFCXdmQ+XNskYDViy70Eu1OKf85dqGY8ZSymOlm3tWtTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780317765; c=relaxed/simple; bh=Ycw4dTtO45oISXUPE2pd5uVPI0PqpuBW8imgPVhVttQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u9wwLKZctjPaCYwxm0tielKaw8ya1USN8TxrRXIUkYhlZO8U49wUQYsSR8UnkveOR6FccqFHI/XQyDuE1HpSPg8ugZv+G3uRcpeF1qq9dYDcZ4usk+aH6GWfo8xDFq04wb3qTNTayja08XW/6EnwiLnaL2l8QOVujPcovW09ivE= 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=E7mtZrFp; arc=none smtp.client-ip=170.10.133.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="E7mtZrFp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780317762; 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=6Hwq13SDbpVOpqhNfmfrEwK4V0aUm9u8GnF85w9/4CA=; b=E7mtZrFpw1z0/0FT2eQPFbUf6kwEUZCshcbR8rTFpVjjNcCRn0RDeQB9BDlnw+ww/8b6tH WPKO5yg/nVfX8xXSJ0HbIm8nOWyanXDySCVDq0tInFkMtZQXnGKVu2Nyndg1gDBhhPrdtj AXNx0jXp07BiUY8qKKTgXco1uUliNBM= Received: from mx-prod-mc-08.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-82-Bn2Cp5duPQGMUbXlL13P2Q-1; Mon, 01 Jun 2026 08:42:37 -0400 X-MC-Unique: Bn2Cp5duPQGMUbXlL13P2Q-1 X-Mimecast-MFC-AGG-ID: Bn2Cp5duPQGMUbXlL13P2Q_1780317755 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 74EEE18002D0; Mon, 1 Jun 2026 12:42:35 +0000 (UTC) Received: from fedora (unknown [10.44.48.10]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id D5D1A19560A2; Mon, 1 Jun 2026 12:42:31 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 1 Jun 2026 14:42:35 +0200 (CEST) Date: Mon, 1 Jun 2026 14:42:30 +0200 From: Oleg Nesterov To: Lorenzo Stoakes Cc: Andrew Morton , Christian Brauner , David Hildenbrand , Jann Horn , Kees Cook , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Liam R. Howlett" Subject: Re: [PATCH v2] mm_access: simplify the security checks Message-ID: References: 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: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 06/01, Lorenzo Stoakes wrote: > > +cc Liam for mm lifecycle stuff :) > > The subject here seems not quite right - you're adding complexity here in that > now there's a racey fast path. OK. See my reply to David. If it doesn't look like a simplification - lets forget this patch ;) > One behavioural change here though is that down_read_killable() was used > previously, so such a situation would return -EINTR, but now would instead > succeed. I don't really follow... SIGKILL from de_thread() or anything else can come right after down_read_killable(). > > All we need for correctness is READ_ONCE() to ensure the compiler > > won't reload task->mm. This is not enough for KCSAN, but we already > > I'm not sure 'this is not enough for KCSAN' is really reassuring :) If I understand correctly KCSAN will complain if (say) we race with the exiting task which does current->mm = NULL without WRITE_ONCE in exit_mm(). > It's useful to put a revision history (ideally with links to prior revisions) > below the --- line to explain how vN differs from v(N-1). Yes... I didn't do it this time because V2 doesn't differ from V1, I just removed the duplicated paragraph from the changelog. > Overall I'm not really convinced about this patch - this isn't simplifying > things, it's introducing subtle assumptions and I don't really see the > benefit? Thanks for review! lets forget this patch then. Oleg.