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 78C143CC9F6 for ; Thu, 21 May 2026 17:32:22 +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=1779384743; cv=none; b=CjBxBXm61SyTLKFObG9ipRupxnh5+KkjAZnuloqek/wElCkRqCnIQh1oqyYknLlwuPz94nmjUxIcyCIKKyl83m3bjlsoK9fKBu6KOUXqT6zZTslh+Jb9DmNGDo6iDq/OgOu20rppGrEgZHlBiRgBg0Tvw7j3ZdUMAcf+8t3LMPA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779384743; c=relaxed/simple; bh=l7aLhDLg9swBv1b1CLuWuWqkuvrEpy5rXyrPld20gX0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CMMHaiL4K9P4EZ9b98TBjfezcoGCeRGnIp2ALv83PrOvdbfKVtMHxE8PBeeCfpQDYPNCb4HGqpqnUeXH6cFY3Ll3t7rbtImUxxe7rlmsP+gllgOF+ioRDIL1zmyrvzsuZRYq1X41fUpcQ/ADzDGDJ8vBLFOXumPxfE2KZl3iIes= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WscmP3h2; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WscmP3h2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A276F1F000E9; Thu, 21 May 2026 17:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779384742; bh=IoV/8rGK/BVFZVwjIllhg7KwTXliGdwDTicZ059B8Do=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=WscmP3h27+6dPnRs9IdepI6V27u9RJvQY5frQwCdBikrBlXnZLsIXQ3gLCXTtAzHW cZMKCUJWJpLp5mxY4swYRZ9RkXfD4JVsayBVSCLYGU7yQ7p/luw8JUJQnIjV7pdG0L DehRyqa3slCzWp5dQMWC48+LukF3n9KUE1ggiJyCTuRLNP6rDxXLluQBmtKAuGMoME 5wbbkyKHTZ2939QCGA17bZeo0P8b5DqPUnaZRmqw9UiqpkJVwXa3Xe1ZuFOIe3xR3B 4VrTI/FzuRP4pjLdFYBkTygO5izpaksGnV/tJFgEC0CiIBvwpmcjeFGRFYD3bE3mdm uqs8L8MxGMWfA== Date: Thu, 21 May 2026 18:32:19 +0100 From: Lorenzo Stoakes To: Andrew Morton Cc: Arnd Bergmann , Greg Kroah-Hartman , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/3] drivers/char/mem: eliminate unnecessary use of success_hook Message-ID: References: <68bd08d2c7432f94b87f9e40f379336860a9997c.1779379804.git.ljs@kernel.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: <68bd08d2c7432f94b87f9e40f379336860a9997c.1779379804.git.ljs@kernel.org> Hi Andrew, Ugh sorry, case of the hit send + realise silly mistake situation :) Fix-patch below, can respin tomorrow if easier. And my local AI review didn't find this :( Cheers, Lorenzo ----8<---- >From 1910fc9aa03dd49983cfe7605698f33c57b0923e Mon Sep 17 00:00:00 2001 From: Lorenzo Stoakes Date: Thu, 21 May 2026 18:10:42 +0100 Subject: [PATCH] default descriptor vm_ops to dummy vm_ops We need to default the VMA descriptor's VMA operations to vma_dummy_vm_ops so we can correctly detect the case where the VMA is made anonymous. This is what a new file-backed VMA's vm_ops defaults to, so if an mmap_prepare hook does not specify VMA operations this is what it expects. Previously we treated NULL as 'not set' but now we want to explicitly treat it as meaning 'make anon' as per /dev/zero. We also update compat_set_desc_from_vma() and the VMA tests to reflect this. Signed-off-by: Lorenzo Stoakes --- mm/util.c | 1 + mm/vma.c | 1 + tools/testing/vma/include/dup.h | 1 + 3 files changed, 3 insertions(+) diff --git a/mm/util.c b/mm/util.c index 3cc949a0b7ed..2b2a9df689d7 100644 --- a/mm/util.c +++ b/mm/util.c @@ -1192,6 +1192,7 @@ void compat_set_desc_from_vma(struct vm_area_desc *desc, desc->vm_file = vma->vm_file; desc->vma_flags = vma->flags; desc->page_prot = vma->vm_page_prot; + desc->vm_ops = vma->vm_ops; /* Default. */ desc->action.type = MMAP_NOTHING; diff --git a/mm/vma.c b/mm/vma.c index 07486390c692..9eea2850818a 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -2746,6 +2746,7 @@ static unsigned long __mmap_region(struct file *file, unsigned long addr, .action = { .type = MMAP_NOTHING, /* Default to no further action. */ }, + .vm_ops = &vma_dummy_vm_ops, }; bool allocated_new = false; int error; diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h index 9e0dfd3a85b0..306171d061e7 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -1303,6 +1303,7 @@ static inline void compat_set_desc_from_vma(struct vm_area_desc *desc, desc->vm_file = vma->vm_file; desc->vma_flags = vma->flags; desc->page_prot = vma->vm_page_prot; + desc->vm_ops = vma->vm_ops; /* Default. */ desc->action.type = MMAP_NOTHING; -- 2.54.0