Bug 2334478 (CVE-2024-56549) - CVE-2024-56549 kernel: cachefiles: Fix NULL pointer dereference in object->file
Summary: CVE-2024-56549 kernel: cachefiles: Fix NULL pointer dereference in object->file
Keywords:
Status: NEW
Alias: CVE-2024-56549
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-12-27 15:04 UTC by OSIDB Bzimport
Modified: 2024-12-29 04:52 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-12-27 15:04:39 UTC
In the Linux kernel, the following vulnerability has been resolved:

cachefiles: Fix NULL pointer dereference in object->file

At present, the object->file has the NULL pointer dereference problem in
ondemand-mode. The root cause is that the allocated fd and object->file
lifetime are inconsistent, and the user-space invocation to anon_fd uses
object->file. Following is the process that triggers the issue:

	  [write fd]				[umount]
cachefiles_ondemand_fd_write_iter
				       fscache_cookie_state_machine
					 cachefiles_withdraw_cookie
  if (!file) return -ENOBUFS
					   cachefiles_clean_up_object
					     cachefiles_unmark_inode_in_use
					     fput(object->file)
					     object->file = NULL
  // file NULL pointer dereference!
  __cachefiles_write(..., file, ...)

Fix this issue by add an additional reference count to the object->file
before write/llseek, and decrement after it finished.

Comment 1 Avinash Hanwate 2024-12-29 04:49:22 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024122730-CVE-2024-56549-ebcd@gregkh/T


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