CyberSecBulletin
CVE-2023-53311NVD status: Modified

Linux: Use After Free

CVE-2023-53311 is a high-severity use after free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 11afd67f1b3c28eb216e50a3ca8dbcb69bb71793, a3c3b4cbf9b8554120fb230e6516e980c6277487, d2c539c216cce74837a9cf5804eb205939b82227 as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.16% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to 11afd67f1b3c28eb216e50a3ca8dbcb69bb71793 or a3c3b4cbf9b8554120fb230e6516e980c6277487 or d2c539c216cce74837a9cf5804eb205939b82227 or 37207240872456fbab44a110bde6640445233963, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.14.323 or 4.19.292 or 5.4.254 or 5.10.191, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, 11afd67f1b3c28eb216e50a3ca8dbcb69bb71793; 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, a3c3b4cbf9b8554120fb230e6516e980c6277487; 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, d2c539c216cce74837a9cf5804eb205939b82227; 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, 37207240872456fbab44a110bde6640445233963; 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, 3645510cf926e6af2f4d44899370d7e5331c93bd; 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, 7532ff6edbf5242376b24a95a2fefb59bb653e5a; 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, 5828d5f5dc877dcfdd7b23102e978e2ecfd86d82; 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8 up to, but not including, f8654743a0e6909dc634cbfad6db6816f10f3399; and 1 more ranges11afd67f1b3c28eb216e50a3ca8dbcb69bb71793, a3c3b4cbf9b8554120fb230e6516e980c6277487, d2c539c216cce74837a9cf5804eb205939b82227, 37207240872456fbab44a110bde6640445233963, 3645510cf926e6af2f4d44899370d7e5331c93bd, 7532ff6edbf5242376b24a95a2fefb59bb653e5a
LinuxLinux Kernel4.0 up to, but not including, 4.14.323; 4.15 up to, but not including, 4.19.292; 4.20 up to, but not including, 5.4.254; 5.5 up to, but not including, 5.10.191; 5.11 up to, but not including, 5.15.127; 5.16 up to, but not including, 6.1.46; 6.2 up to, but not including, 6.4.11; 6.54.14.323, 4.19.292, 5.4.254, 5.10.191, 5.15.127, 6.1.46

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighNVD
CVSS 3.17.8HighCISA (ADP)

Official description

In the Linux kernel, the following vulnerability has been resolved: nilfs2: fix use-after-free of nilfs_root in dirtying inodes via iput During unmount process of nilfs2, nothing holds nilfs_root structure after nilfs2 detaches its writer in nilfs_detach_log_writer(). Previously, nilfs_evict_inode() could cause use-after-free read for nilfs_root if inodes are left in "garbage_list" and released by nilfs_dispose_list at the end of nilfs_detach_log_writer(), and this bug was fixed by commit 9b5a04ac3ad9 ("nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()"). However, it turned out that there is another possibility of UAF in the call path where mark_inode_dirty_sync() is called from iput(): nilfs_detach_log_writer() nilfs_dispose_list() iput() mark_inode_dirty_sync() __mark_inode_dirty() nilfs_dirty_inode() __nilfs_mark_inode_dirty() nilfs_load_inode_block() --> causes UAF of nilfs_root struct This can happen after commit 0ae45f63d4ef ("vfs: add support for a lazytime mount option"), which changed iput() to call mark_inode_dirty_sync() on its final reference if i_state has I_DIRTY_TIME flag and i_nlink is non-zero. This issue appears after commit 28a65b49eb53 ("nilfs2: do not write dirty data after degenerating to read-only") when using the syzbot reproducer, but the issue has potentially existed before. Fix this issue by adding a "purging flag" to the nilfs structure, setting that flag while disposing the "garbage_list" and checking it in __nilfs_mark_inode_dirty(). Unlike commit 9b5a04ac3ad9 ("nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()"), this patch does not rely on ns_writer to determine whether to skip operations, so as not to break recovery on mount. The nilfs_salvage_orphan_logs routine dirties the buffer of salvaged data before attaching the log writer, so changing __nilfs_mark_inode_dirty() to skip the operation when ns_writer is NULL will cause recovery write to fail. The purpose of using the cleanup-only flag is to allow for narrowing of such conditions.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.