Skip to contentSkip to conversation

CVE-2026-80697: erofs: ensure valid f_path for page cache sharing

DISCUSSION Greg Kroah-Hartman 2 participants 5 messages Aug 28

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

erofs: ensure valid f_path for page cache sharing

Previously, backing files for page cache sharing were set up with f_path left as NULL (only f_inode was valid). It worked, but a recent mincore fix relies on f_path.mnt and crashes (found by "erofs/028" on 7.2-rc4):

 BUG: kernel NULL pointer dereference, address: 0000000000000018
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP PTI
 CPU: 3 UID: 0 PID: 675528 Comm: fincore Not tainted 7.2.0-rc4-00002-g[]-dirty #1 PREEMPT(lazy)
 Hardware name: Red Hat KVM, BIOS 1.16.0-4.al8 04/01/2014
 RIP: 0010:__do_sys_mincore+0xc0/0x2c0
 ...

Specify valid paths using valid disconnected dentries together with erofs_ishare_mnt instead of leaving f_path empty, so they are more like real backing files in a pseudo filesystem and standard backing_file_open() can be used directly.

The Linux kernel CVE team has assigned CVE-2026-80697 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 7.1.4 with commit 04ba248d02d9eaa3d9077b00a6134caa75fa3e90 and fixed in 7.1.8 with commit 3879657c4ffd81b9a42cf575fc6cb60201032587
	Issue introduced in 5.15.217 with commit 7368bec565bac3e536cd43579dbde1e715e6ba61
	Issue introduced in 6.1.184 with commit b2f3d94ea310bea9d36d53e9d9b3f45e86c1d893
	Issue introduced in 6.6.145 with commit 744b23aa430d52f5c8e4dbff7d71496d6643bed2
	Issue introduced in 6.12.96 with commit 8344bdf0629457e532797b42d9d2bbf2a2900bbf
	Issue introduced in 6.18.39 with commit 5c942ad7df75925ee166e7f0fb36892d8dde376b

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-80697

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/erofs/Kconfig
fs/erofs/internal.h
fs/erofs/ishare.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/3879657c4ffd81b9a42cf575fc6cb60201032587
	https://git.kernel.org/stable/c/96b2dbbe58a1ea5df8d29c2fe24b5f04715f4443
#1 lore raw

Hi Greg,

Quoted 35 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

erofs: ensure valid f_path for page cache sharing

Previously, backing files for page cache sharing were set up with f_path left as NULL (only f_inode was valid). It worked, but a recent mincore fix relies on f_path.mnt and crashes (found by "erofs/028" on 7.2-rc4):

 BUG: kernel NULL pointer dereference, address: 0000000000000018
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP PTI
 CPU: 3 UID: 0 PID: 675528 Comm: fincore Not tainted 7.2.0-rc4-00002-g[]-dirty #1 PREEMPT(lazy)
 Hardware name: Red Hat KVM, BIOS 1.16.0-4.al8 04/01/2014
 RIP: 0010:__do_sys_mincore+0xc0/0x2c0
 ...

Specify valid paths using valid disconnected dentries together with erofs_ishare_mnt instead of leaving f_path empty, so they are more like real backing files in a pseudo filesystem and standard backing_file_open() can be used directly.

The Linux kernel CVE team has assigned CVE-2026-80697 to this issue.

Affected and fixed versions
===========================

Quoted 6 lines
	Issue introduced in 7.1.4 with commit 04ba248d02d9eaa3d9077b00a6134caa75fa3e90 and fixed in 7.1.8 with commit 3879657c4ffd81b9a42cf575fc6cb60201032587
	Issue introduced in 5.15.217 with commit 7368bec565bac3e536cd43579dbde1e715e6ba61
	Issue introduced in 6.1.184 with commit b2f3d94ea310bea9d36d53e9d9b3f45e86c1d893
	Issue introduced in 6.6.145 with commit 744b23aa430d52f5c8e4dbff7d71496d6643bed2
	Issue introduced in 6.12.96 with commit 8344bdf0629457e532797b42d9d2bbf2a2900bbf
	Issue introduced in 6.18.39 with commit 5c942ad7df75925ee166e7f0fb36892d8dde376b

I don't think that is correct, although commit e187bc02f8fa ("mm: do file ownership checks with the proper mount idmap") directly causes this issue, the entire page cache sharing feature was introduced in Linux 7.0.

There is not any codebase below Linux 7.0 so it's possible to fix 5.15/6.1/6.6/6.12/6.18 in any case. The affected versions are only Linux 7.0+.

Thanks,
Gao Xiang

author
#2 lore raw
Quoted 45 lines · Gao Xiang

Hi Greg,

Quoted 35 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

erofs: ensure valid f_path for page cache sharing

Previously, backing files for page cache sharing were set up with f_path left as NULL (only f_inode was valid). It worked, but a recent mincore fix relies on f_path.mnt and crashes (found by "erofs/028" on 7.2-rc4):

 BUG: kernel NULL pointer dereference, address: 0000000000000018
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP PTI
 CPU: 3 UID: 0 PID: 675528 Comm: fincore Not tainted 7.2.0-rc4-00002-g[]-dirty #1 PREEMPT(lazy)
 Hardware name: Red Hat KVM, BIOS 1.16.0-4.al8 04/01/2014
 RIP: 0010:__do_sys_mincore+0xc0/0x2c0
 ...

Specify valid paths using valid disconnected dentries together with erofs_ishare_mnt instead of leaving f_path empty, so they are more like real backing files in a pseudo filesystem and standard backing_file_open() can be used directly.

The Linux kernel CVE team has assigned CVE-2026-80697 to this issue.

Affected and fixed versions
===========================

Quoted 6 lines
	Issue introduced in 7.1.4 with commit 04ba248d02d9eaa3d9077b00a6134caa75fa3e90 and fixed in 7.1.8 with commit 3879657c4ffd81b9a42cf575fc6cb60201032587
	Issue introduced in 5.15.217 with commit 7368bec565bac3e536cd43579dbde1e715e6ba61
	Issue introduced in 6.1.184 with commit b2f3d94ea310bea9d36d53e9d9b3f45e86c1d893
	Issue introduced in 6.6.145 with commit 744b23aa430d52f5c8e4dbff7d71496d6643bed2
	Issue introduced in 6.12.96 with commit 8344bdf0629457e532797b42d9d2bbf2a2900bbf
	Issue introduced in 6.18.39 with commit 5c942ad7df75925ee166e7f0fb36892d8dde376b
Quoted 4 lines

I don't think that is correct, although commit e187bc02f8fa ("mm: do file ownership checks with the proper mount idmap") directly causes this issue, the entire page cache sharing feature was introduced in Linux 7.0.

Yes, but it was backported to all of the above stable kernels as well, which is why they are listed that way.

Quoted 3 lines

There is not any codebase below Linux 7.0 so it's possible to fix 5.15/6.1/6.6/6.12/6.18 in any case. The affected versions are only Linux 7.0+.

Even though e187bc02f8fa ("mm: do file ownership checks with the proper mount idmap") was backported to those older trees?

thanks,

greg k-h

#3 lore raw
Quoted 46 lines · Greg KH
Quoted 45 lines · Gao Xiang

Hi Greg,

Quoted 41 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

erofs: ensure valid f_path for page cache sharing

Previously, backing files for page cache sharing were set up with f_path left as NULL (only f_inode was valid). It worked, but a recent mincore fix relies on f_path.mnt and crashes (found by "erofs/028" on 7.2-rc4):

 BUG: kernel NULL pointer dereference, address: 0000000000000018
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP PTI
 CPU: 3 UID: 0 PID: 675528 Comm: fincore Not tainted 7.2.0-rc4-00002-g[]-dirty #1 PREEMPT(lazy)
 Hardware name: Red Hat KVM, BIOS 1.16.0-4.al8 04/01/2014
 RIP: 0010:__do_sys_mincore+0xc0/0x2c0
 ...

Specify valid paths using valid disconnected dentries together with erofs_ishare_mnt instead of leaving f_path empty, so they are more like real backing files in a pseudo filesystem and standard backing_file_open() can be used directly.

The Linux kernel CVE team has assigned CVE-2026-80697 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 7.1.4 with commit 04ba248d02d9eaa3d9077b00a6134caa75fa3e90 and fixed in 7.1.8 with commit 3879657c4ffd81b9a42cf575fc6cb60201032587
	Issue introduced in 5.15.217 with commit 7368bec565bac3e536cd43579dbde1e715e6ba61
	Issue introduced in 6.1.184 with commit b2f3d94ea310bea9d36d53e9d9b3f45e86c1d893
	Issue introduced in 6.6.145 with commit 744b23aa430d52f5c8e4dbff7d71496d6643bed2
	Issue introduced in 6.12.96 with commit 8344bdf0629457e532797b42d9d2bbf2a2900bbf
	Issue introduced in 6.18.39 with commit 5c942ad7df75925ee166e7f0fb36892d8dde376b
Quoted 7 lines
Quoted 4 lines

I don't think that is correct, although commit e187bc02f8fa ("mm: do file ownership checks with the proper mount idmap") directly causes this issue, the entire page cache sharing feature was introduced in Linux 7.0.

Yes, but it was backported to all of the above stable kernels as well, which is why they are listed that way.

I know e187bc02f8fa was backported to these kernels, but as I said, this commit directly caused the issue (without e187bc02f8fa, there is no panic at all, so "Fixes:" points to it), but the fact that backporting e187bc02f8fa to older stable kernels doesn't mean the fix ("erofs: ensure valid f_path for page cache sharing") need to be backported to these old kernels too since the page cache sharing feature won't exist in kernels below 7.0 in any way.

Quoted 7 lines
Quoted 4 lines

There is not any codebase below Linux 7.0 so it's possible to fix 5.15/6.1/6.6/6.12/6.18 in any case. The affected versions are only Linux 7.0+.

Even though e187bc02f8fa ("mm: do file ownership checks with the proper mount idmap") was backported to those older trees?

Yes, it's just impossible to apply "erofs: ensure valid f_path for page cache sharing" to stable kernels < 7.0 since the feature was introduced by upstream commit 5ef3208e3be5 ("erofs: introduce the page cache share feature") [1].

[1] https://lwn.net/Articles/1057769/#:~:text=The%20filesystem%20also%20shares%20page%2Dcache%20entries%20for%20identical%20files

Thanks,
Gao Xiang

Quoted 4 lines

thanks,

greg k-h

author
#4 lore raw
Quoted 71 lines · Gao Xiang
Quoted 46 lines · Greg KH
Quoted 45 lines · Gao Xiang

Hi Greg,

Quoted 41 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

erofs: ensure valid f_path for page cache sharing

Previously, backing files for page cache sharing were set up with f_path left as NULL (only f_inode was valid). It worked, but a recent mincore fix relies on f_path.mnt and crashes (found by "erofs/028" on 7.2-rc4):

 BUG: kernel NULL pointer dereference, address: 0000000000000018
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP PTI
 CPU: 3 UID: 0 PID: 675528 Comm: fincore Not tainted 7.2.0-rc4-00002-g[]-dirty #1 PREEMPT(lazy)
 Hardware name: Red Hat KVM, BIOS 1.16.0-4.al8 04/01/2014
 RIP: 0010:__do_sys_mincore+0xc0/0x2c0
 ...

Specify valid paths using valid disconnected dentries together with erofs_ishare_mnt instead of leaving f_path empty, so they are more like real backing files in a pseudo filesystem and standard backing_file_open() can be used directly.

The Linux kernel CVE team has assigned CVE-2026-80697 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 7.1.4 with commit 04ba248d02d9eaa3d9077b00a6134caa75fa3e90 and fixed in 7.1.8 with commit 3879657c4ffd81b9a42cf575fc6cb60201032587
	Issue introduced in 5.15.217 with commit 7368bec565bac3e536cd43579dbde1e715e6ba61
	Issue introduced in 6.1.184 with commit b2f3d94ea310bea9d36d53e9d9b3f45e86c1d893
	Issue introduced in 6.6.145 with commit 744b23aa430d52f5c8e4dbff7d71496d6643bed2
	Issue introduced in 6.12.96 with commit 8344bdf0629457e532797b42d9d2bbf2a2900bbf
	Issue introduced in 6.18.39 with commit 5c942ad7df75925ee166e7f0fb36892d8dde376b
Quoted 7 lines
Quoted 4 lines

I don't think that is correct, although commit e187bc02f8fa ("mm: do file ownership checks with the proper mount idmap") directly causes this issue, the entire page cache sharing feature was introduced in Linux 7.0.

Yes, but it was backported to all of the above stable kernels as well, which is why they are listed that way.

I know e187bc02f8fa was backported to these kernels, but as I said, this commit directly caused the issue (without e187bc02f8fa, there is no panic at all, so "Fixes:" points to it), but the fact that backporting e187bc02f8fa to older stable kernels doesn't mean the fix ("erofs: ensure valid f_path for page cache sharing") need to be backported to these old kernels too since the page cache sharing feature won't exist in kernels below 7.0 in any way.

Quoted 7 lines
Quoted 4 lines

There is not any codebase below Linux 7.0 so it's possible to fix 5.15/6.1/6.6/6.12/6.18 in any case. The affected versions are only Linux 7.0+.

Even though e187bc02f8fa ("mm: do file ownership checks with the proper mount idmap") was backported to those older trees?

Quoted 6 lines

Yes, it's just impossible to apply "erofs: ensure valid f_path for page cache sharing" to stable kernels < 7.0 since the feature was introduced by upstream commit 5ef3208e3be5 ("erofs: introduce the page cache share feature") [1].

[1] https://lwn.net/Articles/1057769/#:~:text=The%20filesystem%20also%20shares%20page%2Dcache%20entries%20for%20identical%20files

Ah, that makes more sense. I've fixed this up now and adjusted the "Fixes:" tag to point to the correct commit.

The report now looks like:

	Issue introduced in 7.0 with commit 5ef3208e3be50aa08b4e7a2832f34e16d42c08b3 and fixed in 7.1.8 with commit 3879657c4ffd81b9a42cf575fc6cb60201032587
	Issue introduced in 7.0 with commit 5ef3208e3be50aa08b4e7a2832f34e16d42c08b3 and fixed in 7.2 with commit 96b2dbbe58a1ea5df8d29c2fe24b5f04715f4443

thanks,

greg k-h