CVE-2022-48892: sched/core: Fix use-after-free bug in dup_user_cpus_ptr()

Published Aug 21, 2024
·
Updated

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

sched/core: Fix use-after-free bug in dupusercpusptr()

Since commit 07ec77a1d4e8 ("sched: Allow task CPU affinity to be restricted on asymmetric systems"), the setting and clearing of usercpusptr are done under pilock for arm64 architecture. However, dupusercpusptr() accesses usercpusptr without any lock protection. Since schedsetaffinity() can be invoked from another process, the process being modified may be undergoing fork() at the same time. When racing with the clearing of usercpusptr in setcpusallowedptrlocked(), it can lead to user-after-free and possibly double-free in arm64 kernel.

Commit 8f9ea86fdf99 ("sched: Always preserve the user requested cpumask") fixes this problem as usercpusptr, once set, will never be cleared in a task's lifetime. However, this bug was re-introduced in commit 851a723e45d1 ("sched: Always clear usercpusptr in dosetcpusallowed()") which allows the clearing of usercpusptr in dosetcpusallowed(). This time, it will affect all arches.

Fix this bug by always clearing the usercpusptr of the newly cloned/forked task before the copying process starts and check the usercpusptr state of the source task under pilock.

Note to stable, this patch won't be applicable to stable releases. Just copy the new dupusercpusptr() function over.

Affected Software

6 affected componentsFixes available
Linux Linux kernel>=5.15<5.15.89
Linux Linux kernel>=5.16<6.1.7
debian/linux<6.1.7-1
6.1.7-1
debian/linux<6.1.7-1
6.1.7-1
debian/linux<6.1.7-1
6.1.7-1
debian/linux
6.1.7-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.7-1
  2. Compensating control

    Fix dup_user_cpus_ptr() by always clearing user_cpus_ptr of the newly cloned/forked task before copying, checking the source task's user_cpus_ptr under pi_lock, and ensuring accesses are lock-protected.

Event History

Aug 21, 2024
CVE Published
via MITRE·06:10 AM
Data Sourced
via MITRE·06:10 AM
Description
Data Sourced
via NVD·07:15 AM
Description
Data Sourced
via OSV·07:15 AM
DescriptionSeverityAffected Software
Aug 29, 2024
Data Sourced
via NVD·02:35 AM
RemedySeverityWeaknessAffected Software
Aug 4, 2026
Data Sourced
via MITRE·09:03 AM
Severity
Updated
via NVD·10:17 AM
SeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-48892?

CVE-2022-48892 has a moderate severity rating due to the potential for a use-after-free vulnerability in the Linux kernel.

2

How do I fix CVE-2022-48892?

To fix CVE-2022-48892, users should upgrade their Linux kernel to a version beyond 5.15.89 or between 5.16 and 6.1.7.

3

Which versions of Linux are affected by CVE-2022-48892?

CVE-2022-48892 affects Linux kernel versions from 5.15 to 5.15.89 and from 5.16 to 6.1.7.

4

What type of vulnerability is CVE-2022-48892?

CVE-2022-48892 is a use-after-free vulnerability related to task CPU affinity handling in the Linux kernel.

5

What impact could CVE-2022-48892 have on systems?

CVE-2022-48892 could potentially lead to system instability or exploitation if an attacker takes advantage of the vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203