Bug 1218840 (CVE-2024-0582) - VUL-0: CVE-2024-0582: kernel: io_uring: page use-after-free vulnerability via buffer ring mmap
Summary: VUL-0: CVE-2024-0582: kernel: io_uring: page use-after-free vulnerability via...
Status: RESOLVED FIXED
Alias: CVE-2024-0582
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/391282/
Whiteboard: CVSSv3.1:SUSE:CVE-2024-0582:7.0:(AV:L...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-16 11:14 UTC by SMASH SMASH
Modified: 2024-01-16 11:15 UTC (History)
1 user (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SMASH SMASH 2024-01-16 11:14:11 UTC
Since commit c56e022c0a27 ("io_uring: add support for user mapped provided buffer ring"), landed in Linux 6.4, io_uring makes it possible to allocate, mmap, and deallocate "buffer rings".

A "buffer ring" can be allocated with io_uring_register(..., IORING_REGISTER_PBUF_RING, ...) and later deallocated with io_uring_register(..., IORING_UNREGISTER_PBUF_RING, ...). It can be mapped into userspace using mmap() with offset IORING_OFF_PBUF_RING|..., which creates a VM_PFNMAP mapping, meaning the MM subsystem will treat the mapping as a set of opaque page frame numbers not associated with any corresponding pages; this implies that the calling code is responsible for ensuring that the mapped memory can not be freed before the userspace mapping is removed.

However, there is no mechanism to ensure this in io_uring: It is possible to just register a buffer ring with IORING_REGISTER_PBUF_RING, mmap() it, and then free the buffer ring's pages with IORING_UNREGISTER_PBUF_RING, leaving free pages mapped into userspace, which is a fairly easily exploitable situation.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2024-0582
https://bugzilla.redhat.com/show_bug.cgi?id=2254050
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c392cbecd8eca4c53f2bf508731257d9d0a21c2d
Comment 1 Andrea Mattiazzo 2024-01-16 11:15:54 UTC
Codestreams that include io_uring are already fixed:
-stable
-SLE15-SP6