cachefiles: fix memory leak in cachefiles_add_cache()
The following memory leak was reported after unbinding /dev/cachefiles:
==================================================================
unreferenced object 0xffff9b674176e3c0 (size 192):
comm "cachefilesd2", pid 680, jiffies 4294881224
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc ea38a44b):
[<ffffffff8eb8a1a5>] kmem_cache_alloc+0x2d5/0x370
[<ffffffff8e917f86>] prepare_creds+0x26/0x2e0
[<ffffffffc002eeef>] cachefiles_determine_cache_security+0x1f/0x120
[<ffffffffc00243ec>] cachefiles_add_cache+0x13c/0x3a0
[<ffffffffc0025216>] cachefiles_daemon_write+0x146/0x1c0
[<ffffffff8ebc4a3b>] vfs_write+0xcb/0x520
[<ffffffff8ebc5069>] ksys_write+0x69/0xf0
[<ffffffff8f6d4662>] do_syscall_64+0x72/0x140
[<ffffffff8f8000aa>] entry_SYSCALL_64_after_hwframe+0x6e/0x76
==================================================================
Put the reference count of cache_cred in cachefiles_daemon_unbind() to
fix the problem. And also put cache_cred in cachefiles_add_cache() error
branch to avoid memory leaks.
Metrics
Affected Vendors & Products
| Source | ID | Title |
|---|---|---|
Debian DLA |
DLA-3840-1 | linux security update |
Debian DLA |
DLA-3842-1 | linux-5.10 security update |
Debian DSA |
DSA-5681-1 | linux security update |
Ubuntu USN |
USN-6820-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6820-2 | Linux kernel (NVIDIA) vulnerabilities |
Ubuntu USN |
USN-6821-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6821-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6821-3 | Linux kernel (AWS) vulnerabilities |
Ubuntu USN |
USN-6821-4 | Linux kernel (Azure) vulnerabilities |
Ubuntu USN |
USN-6828-1 | Linux kernel (Intel IoTG) vulnerabilities |
Ubuntu USN |
USN-6831-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6871-1 | Linux kernel (HWE) vulnerabilities |
Ubuntu USN |
USN-6892-1 | Linux kernel (IBM) vulnerabilities |
Ubuntu USN |
USN-6919-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6926-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6926-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6926-3 | Linux kernel (Azure) vulnerabilities |
Ubuntu USN |
USN-6938-1 | Linux kernel vulnerabilities |
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
Wed, 16 Jul 2025 13:45:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
epss
|
epss
|
Wed, 14 May 2025 15:00:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Redhat rhel Eus
|
|
| CPEs | cpe:/a:redhat:rhel_eus:9.4 | |
| Vendors & Products |
Redhat rhel Eus
|
Tue, 07 Jan 2025 17:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Linux
Linux linux Kernel |
|
| Weaknesses | CWE-401 | |
| CPEs | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.8:rc1:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.8:rc2:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.8:rc3:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.8:rc4:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.8:rc5:*:*:*:*:*:* |
|
| Vendors & Products |
Linux
Linux linux Kernel |
|
| Metrics |
cvssV3_1
|
cvssV3_1
|
Thu, 19 Dec 2024 09:15:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Wed, 13 Nov 2024 02:45:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| CPEs | cpe:/a:redhat:enterprise_linux:9 cpe:/o:redhat:enterprise_linux:9 |
Thu, 08 Aug 2024 19:15:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Redhat
Redhat enterprise Linux |
|
| CPEs | cpe:/a:redhat:enterprise_linux:8::nfv cpe:/o:redhat:enterprise_linux:8 |
|
| Vendors & Products |
Redhat
Redhat enterprise Linux |
Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-05-04T08:57:42.799Z
Reserved: 2024-02-19T14:20:24.182Z
Link: CVE-2024-26840
Updated: 2024-08-02T00:14:13.702Z
Status : Analyzed
Published: 2024-04-17T10:15:09.910
Modified: 2025-01-07T17:13:19.863
Link: CVE-2024-26840
OpenCVE Enrichment
No data.
Debian DLA
Debian DSA
Ubuntu USN