Bug 1905497 (CVE-2020-29534) - CVE-2020-29534 kernel: io_uring takes a non-refcounted reference to the files_struct of the process that submitted a request, causing execve() to incorrectly optimize unshare_fd() allowing for privileges escalation
Summary: CVE-2020-29534 kernel: io_uring takes a non-refcounted reference to the files...
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2020-29534
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1905498 1906390
Blocks: 1905499
TreeView+ depends on / blocked
 
Reported: 2020-12-08 13:58 UTC by Marian Rehak
Modified: 2020-12-10 12:21 UTC (History)
39 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-08 15:41:47 UTC
Embargoed:


Attachments (Terms of Use)

Description Marian Rehak 2020-12-08 13:58:52 UTC
io_uring takes a non-refcounted reference to the files_struct of the process that submitted a request (relying on ->flush() for being notified before the files_struct can go away). Unfortunately, unshare_fd(), which is used by bprm_execve() via unshare_files(), doesn't know about that, and assumes that if the files_struct's refcount is 1, it is okay to keep using the old files_struct. Therefore, an attacker can cause io_uring to fiddle around in the file descriptor table of a privileged process, and in particular steal file descriptors using IORING_OP_FILES_UPDATE.

References:

https://bugs.chromium.org/p/project-zero/issues/detail?id=2089
https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.9.3
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f2122045b946241a9e549c2a76cea54fa58a7ff

Comment 1 Marian Rehak 2020-12-08 13:59:31 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1905498]

Comment 2 Justin M. Forbes 2020-12-08 15:13:32 UTC
This was fixed for Fedora with the 5.8.18 stable kernel updates.


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