Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cramfs: fix incorrect physical page address calculation

Commit 21aa65bf82a7 ("mm: remove callers of pfn_t functionality")
incorrectly replaced the pfn with the physical address when calling
vmf_insert_mixed(). Instead the phys_to_pfn_t() call should have been
replaced with PHYS_PFN().

Found by inspection after a similar issue was noted in fuse virtio_fs.

Link: https://lkml.kernel.org/r/20250923005333.3165032-1-apopple@nvidia.com
Fixes: 21aa65bf82a7 ("mm: remove callers of pfn_t functionality")
Signed-off-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Haiyue Wang <haiyuewa@163.com>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Alistair Popple and committed by
Andrew Morton
20a8e045 634cdfd6

+1 -1
+1 -1
fs/cramfs/inode.c
··· 412 412 vm_fault_t vmf; 413 413 unsigned long off = i * PAGE_SIZE; 414 414 vmf = vmf_insert_mixed(vma, vma->vm_start + off, 415 - address + off); 415 + PHYS_PFN(address + off)); 416 416 if (vmf & VM_FAULT_ERROR) 417 417 ret = vm_fault_to_errno(vmf, 0); 418 418 }