Bug 2236982 (CVE-2023-4732) - CVE-2023-4732 kernel: Race between task migrating pages and another task calling exit_mmap to release those same pages getting invalid opcode BUG in include/linux/swapops.h
Summary: CVE-2023-4732 kernel: Race between task migrating pages and another task call...
Keywords:
Status: NEW
Alias: CVE-2023-4732
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2231554 2237947
Blocks: 2236219
TreeView+ depends on / blocked
 
Reported: 2023-09-02 14:35 UTC by Rohit Keshri
Modified: 2024-02-13 01:12 UTC (History)
41 users (show)

Fixed In Version: Kernel 5.14-rc1
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in pfn_swap_entry_to_page in memory management subsystem in the Linux Kernel. In this flaw, an attacker with a local user privilege may cause a denial of service problem due to a BUG statement referencing pmd_t x.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2023:7268 0 None None None 2023-11-15 18:25:04 UTC
Red Hat Product Errata RHBA-2023:7328 0 None None None 2023-11-16 11:39:14 UTC
Red Hat Product Errata RHBA-2023:7338 0 None None None 2023-11-16 18:04:39 UTC
Red Hat Product Errata RHBA-2023:7343 0 None None None 2023-11-20 01:59:06 UTC
Red Hat Product Errata RHBA-2023:7346 0 None None None 2023-11-20 09:26:06 UTC
Red Hat Product Errata RHSA-2023:6901 0 None None None 2023-11-14 15:16:01 UTC
Red Hat Product Errata RHSA-2023:7077 0 None None None 2023-11-14 15:21:23 UTC
Red Hat Product Errata RHSA-2023:7539 0 None None None 2023-11-28 15:35:48 UTC
Red Hat Product Errata RHSA-2024:0412 0 None None None 2024-01-24 16:45:03 UTC

Description Rohit Keshri 2023-09-02 14:35:45 UTC
A flaw was found in the Linux Kernel's memory management subsytem. In this flaw, A task is exiting and releasing 2MB page in a vma (vm_area_struct) and hits the BUG statement in pfn_swap_entry_to_page() referencing pmd_t x.

    208 static inline struct page *pfn_swap_entry_to_page(swp_entry_t entry)
    209 {
   <omit>
    216         BUG_ON(is_migration_entry(entry) && !PageLocked(p));   <-----  

It finds the entry is of type SWP_MIGRATION_READ and the page is not locked, Another task is calling migrate_pages() on the same addresses and has just completed with the above pmd_t x and is moving to  pmd_t x+1 in try_to_unmap_one().

Comment 1 bugzilla_throwaway 2023-09-04 07:32:40 UTC
Could you please link the fix, if there is one?

Comment 2 Rohit Keshri 2023-09-04 19:41:52 UTC
In reply to comment #1:
> Could you please link the fix, if there is one?

Thank you for reaching to us, the investigation is still in progress, but it seems the issue was seen by the commit 578ede398633 ("userfaultfd: wp: drop _PAGE_UFFD_WP properly when fork"). 

Also it seems that the exploitation is not easy, and will need a special user privilege.

Comment 9 errata-xmlrpc 2023-11-14 15:15:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:6901 https://access.redhat.com/errata/RHSA-2023:6901

Comment 10 errata-xmlrpc 2023-11-14 15:21:20 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:7077 https://access.redhat.com/errata/RHSA-2023:7077

Comment 11 errata-xmlrpc 2023-11-28 15:35:45 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.8 Extended Update Support

Via RHSA-2023:7539 https://access.redhat.com/errata/RHSA-2023:7539

Comment 14 errata-xmlrpc 2024-01-24 16:45:00 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Extended Update Support

Via RHSA-2024:0412 https://access.redhat.com/errata/RHSA-2024:0412


Note You need to log in before you can comment on or make changes to this bug.