# CVE-2024-56628: LoongArch: Add architecture specific huge\_pte\_clear()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 18, 2026-11-28)
- **Published:** 2024-12-27T14:51:30.583Z
- **Modified:** 2026-08-05T11:45:33.447Z

## Who should check

- Anyone running Linux \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< dba3c45e333a3a2a01395b5f5e5f88f8baba74e4; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 7dfbf011a57b9e1a40f5ce8080a53c497e105c6c; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 9b602190cf2d8ac957be0011e418ed6c3b49b9a3; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 7cd1f5f77925ae905a57296932f0f9ef0dc364f8
- Anyone running Linux 5.19

## Description

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

LoongArch: Add architecture specific huge\_pte\_clear()

When executing mm selftests run\_vmtests.sh, there is such an error:

 BUG: Bad page state in process uffd-unit-tests  pfn:00000
 page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x0
 flags: 0xffff0000002000(reserved\|node=0\|zone=0\|lastcpupid=0xffff)
 raw: 00ffff0000002000 ffffbf0000000008 ffffbf0000000008 0000000000000000
 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
 page dumped because: PAGE\_FLAGS\_CHECK\_AT\_FREE flag(s) set
 Modules linked in: snd\_seq\_dummy snd\_seq snd\_seq\_device rfkill vfat fat
    virtio\_balloon efi\_pstore virtio\_net pstore net\_failover failover fuse
    nfnetlink virtio\_scsi virtio\_gpu virtio\_dma\_buf dm\_multipath efivarfs
 CPU: 2 UID: 0 PID: 1913 Comm: uffd-unit-tests Not tainted 6.12.0 \#184
 Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 2/2/2022
 Stack : 900000047c8ac000 0000000000000000 9000000000223a7c 900000047c8ac000
         900000047c8af690 900000047c8af698 0000000000000000 900000047c8af7d8
         900000047c8af7d0 900000047c8af7d0 900000047c8af5b0 0000000000000001
         0000000000000001 900000047c8af698 10b3c7d53da40d26 0000010000000000
         0000000000000022 0000000fffffffff fffffffffe000000 ffff800000000000
         000000000000002f 0000800000000000 000000017a6d4000 90000000028f8940
         0000000000000000 0000000000000000 90000000025aa5e0 9000000002905000
         0000000000000000 90000000028f8940 ffff800000000000 0000000000000000
         0000000000000000 0000000000000000 9000000000223a94 000000012001839c
         00000000000000b0 0000000000000004 0000000000000000 0000000000071c1d
         ...
 Call Trace:
 \[\<9000000000223a94\>\] show\_stack+0x5c/0x180
 \[\<9000000001c3fd64\>\] dump\_stack\_lvl+0x6c/0xa0
 \[\<900000000056aa08\>\] bad\_page+0x1a0/0x1f0
 \[\<9000000000574978\>\] free\_unref\_folios+0xbf0/0xd20
 \[\<90000000004e65cc\>\] folios\_put\_refs+0x1a4/0x2b8
 \[\<9000000000599a0c\>\] free\_pages\_and\_swap\_cache+0x164/0x260
 \[\<9000000000547698\>\] tlb\_batch\_pages\_flush+0xa8/0x1c0
 \[\<9000000000547f30\>\] tlb\_finish\_mmu+0xa8/0x218
 \[\<9000000000543cb8\>\] exit\_mmap+0x1a0/0x360
 \[\<9000000000247658\>\] \_\_mmput+0x78/0x200
 \[\<900000000025583c\>\] do\_exit+0x43c/0xde8
 \[\<9000000000256490\>\] do\_group\_exit+0x68/0x110
 \[\<9000000000256554\>\] sys\_exit\_group+0x1c/0x20
 \[\<9000000001c413b4\>\] do\_syscall+0x94/0x130
 \[\<90000000002216d8\>\] handle\_syscall+0xb8/0x158
 Disabling lock debugging due to kernel taint
 BUG: non-zero pgtables\_bytes on freeing mm: -16384

On LoongArch system, invalid huge pte entry should be invalid\_pte\_table
or a single \_PAGE\_HUGE bit rather than a zero value. And it should be
the same with invalid pmd entry, since pmd\_none() is called by function
free\_pgd\_range() and pmd\_none() return 0 by huge\_pte\_clear(). So single
\_PAGE\_HUGE bit is also treated as a valid pte table and free\_pte\_range()
will be called in free\_pmd\_range().

  free\_pmd\_range()
        pmd = pmd\_offset(pud, addr);
        do {
                next = pmd\_addr\_end(addr, end);
                if (pmd\_none\_or\_clear\_bad(pmd))
                        continue;
                free\_pte\_range(tlb, pmd, addr);
        } while (pmd++, addr = next, addr != end);

Here invalid\_pte\_table is used for both invalid huge pte entry and
pmd entry.

## Affected and fixed versions

- Linux: \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< dba3c45e333a3a2a01395b5f5e5f88f8baba74e4; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 7dfbf011a57b9e1a40f5ce8080a53c497e105c6c; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 9b602190cf2d8ac957be0011e418ed6c3b49b9a3; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 7cd1f5f77925ae905a57296932f0f9ef0dc364f8 (cvelist)
- Linux: 5.19 (cvelist)

## Mitigation

- Upgrade Linux to 7cd1f5f77925ae905a57296932f0f9ef0dc364f8 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-56628. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-56628.md
Affected: Linux >= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, < dba3c45e333a3a2a01395b5f5e5f88f8baba74e4; >= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, < 7dfbf011a57b9e1a40f5ce8080a53c497e105c6c; >= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, < 9b602190cf2d8ac957be0011e418ed6c3b49b9a3; >= 09cfefb7fa70c3af011b0db…
Fixed in: Linux 7dfbf011a57b9e1a40f5ce8080a53c497e105c6c, Linux 9b602190cf2d8ac957be0011e418ed6c3b49b9a3, Linux 7cd1f5f77925ae905a57296932f0f9ef0dc364f8

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-56628 being exploited?

There is no confirmed exploitation: CVE-2024-56628 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2024-56628?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-56628?

Linux \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< dba3c45e333a3a2a01395b5f5e5f88f8baba74e4; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 7dfbf011a57b9e1a40f5ce8080a53c497e105c6c; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 9b602190cf2d8ac957be0011e418ed6c3b49b9a3; \>= 09cfefb7fa70c3af011b0db0a513fd80b2f18abc, \< 7cd1f5f77925ae905a57296932f0f9ef0dc364f8; Linux 5.19.

### Is there a fix for CVE-2024-56628?

Yes. Fixed in Linux 7dfbf011a57b9e1a40f5ce8080a53c497e105c6c, Linux 9b602190cf2d8ac957be0011e418ed6c3b49b9a3, Linux 7cd1f5f77925ae905a57296932f0f9ef0dc364f8. Upgrade Linux to 7cd1f5f77925ae905a57296932f0f9ef0dc364f8 or later.

### How do I check if I'm affected by CVE-2024-56628?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/dba3c45e333a3a2a01395b5f5e5f88f8baba74e4>
- patch: <https://git.kernel.org/stable/c/7dfbf011a57b9e1a40f5ce8080a53c497e105c6c>
- patch: <https://git.kernel.org/stable/c/9b602190cf2d8ac957be0011e418ed6c3b49b9a3>
- patch: <https://git.kernel.org/stable/c/7cd1f5f77925ae905a57296932f0f9ef0dc364f8>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-56628>

HTML: <https://flawdb.com/CVE-2024-56628> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-56628>
