Skip to contentSkip to conversation

CVE-2023-53027: erofs: fix kvcalloc() misuse with __GFP_NOFAIL

DISCUSSION Greg Kroah-Hartman 2 participants 4 messages Mar 27, 2025 – Mar 28, 2025

lore
Share & tools
lore
#0 lore raw

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

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

erofs: fix kvcalloc() misuse with __GFP_NOFAIL

As reported by syzbot [1], kvcalloc() cannot work with __GFP_NOFAIL. Let's use kcalloc() instead.

[1] https://lore.kernel.org/r/[email protected]

The Linux kernel CVE team has assigned CVE-2023-53027 to this issue.

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

	Issue introduced in 6.0 with commit 4f05687fd7036473605a161ca47a2cf9fd3cbfc5 and fixed in 6.1.9 with commit 7b28a8920844042ca9f44934d8f15d210ef42c75
	Issue introduced in 6.0 with commit 4f05687fd7036473605a161ca47a2cf9fd3cbfc5 and fixed in 6.2 with commit 12724ba38992bd045e92a9a88a868a530f89d13e

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-2023-53027

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/zdata.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/7b28a8920844042ca9f44934d8f15d210ef42c75
	https://git.kernel.org/stable/c/12724ba38992bd045e92a9a88a868a530f89d13e
#1 lore raw

Hi,

Quoted 5 lines · Greg Kroah-Hartman

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

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

Quoted 8 lines

erofs: fix kvcalloc() misuse with __GFP_NOFAIL

As reported by syzbot [1], kvcalloc() cannot work with __GFP_NOFAIL. Let's use kcalloc() instead.

[1] https://lore.kernel.org/r/[email protected]

The Linux kernel CVE team has assigned CVE-2023-53027 to this issue.

I think this CVE is invalid since it was then reverted by upstream commit 647dd2c3f0e1 ("erofs: Revert "erofs: fix kvcalloc() misuse with __GFP_NOFAIL"")

since it's not the correct way to fix this.

The original issue was fixed by
commit e9c3cda4d86e ("mm, vmalloc: fix high order __GFP_NOFAIL allocations") instead.

Thanks,
Gao Xiang

#2 lore raw
Quoted 15 lines · Gao Xiang

Hi,

Quoted 12 lines · Greg Kroah-Hartman

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

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

erofs: fix kvcalloc() misuse with __GFP_NOFAIL

As reported by syzbot [1], kvcalloc() cannot work with __GFP_NOFAIL. Let's use kcalloc() instead.

[1] https://lore.kernel.org/r/[email protected]

Quoted 7 lines
Quoted 1 line

The Linux kernel CVE team has assigned CVE-2023-53027 to this issue.

I think this CVE is invalid since it was then reverted by upstream commit 647dd2c3f0e1 ("erofs: Revert "erofs: fix kvcalloc() misuse with __GFP_NOFAIL"")

since it's not the correct way to fix this.

Ah, that commit was not in the "normal" revert style, which is why we didn't notice that.

I've now rejected this CVE id, thanks for letting us know!

greg k-h

#3 lore raw
Quoted 18 lines · Greg Kroah-Hartman
Quoted 17 lines · Gao Xiang

Hi,

Quoted 13 lines · Greg Kroah-Hartman

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

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

erofs: fix kvcalloc() misuse with __GFP_NOFAIL

As reported by syzbot [1], kvcalloc() cannot work with __GFP_NOFAIL. Let's use kcalloc() instead.

[1] https://lore.kernel.org/r/[email protected]

The Linux kernel CVE team has assigned CVE-2023-53027 to this issue.

Quoted 8 lines
Quoted 5 lines

I think this CVE is invalid since it was then reverted by upstream commit 647dd2c3f0e1 ("erofs: Revert "erofs: fix kvcalloc() misuse with __GFP_NOFAIL"")

since it's not the correct way to fix this.

Ah, that commit was not in the "normal" revert style, which is why we didn't notice that.

Yeah, that is somewhat awkward.. Anyway, backport this incorrect fix due to a CVE just makes it worse.

Quoted 2 lines

I've now rejected this CVE id, thanks for letting us know!

Thanks!

Thanks,
Gao Xiang

Quoted 2 lines

greg k-h