In the Linux kernel, the following vulnerability has been resolved:
sched/deadline: Fix task_struct reference leak
During the execution of the following stress test with linux-rt:
stress-ng --cyclic 30 --timeout 30 --minimize --quiet
kmemleak frequently reported a memory leak concerning the task_struct:
unreferenced object 0xffff8881305b8000 (size 16136): comm "stress-ng", pid 614, jiffies 4294883961 (age 286.412s) object hex dump (first 32 bytes): 02 40 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 ................ debug hex dump (first 16 bytes): 53 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 S............... backtrace: [<00000000046b6790>] duptaskstruct+0x30/0x540 [<00000000c5ca0f0b>] copyprocess+0x3d9/0x50e0 [<00000000ced59777>] kernelclone+0xb0/0x770 [<00000000a50befdc>] _dosysclone+0xb6/0xf0 [<000000001dbf2008>] dosyscall64+0x5d/0xf0 [<00000000552900ff>] entrySYSCALL64after_hwframe+0x6e/0x76
The issue occurs in startdltimer(), which increments the taskstruct reference count and sets a timer. The timer callback, dltasktimer, is supposed to decrement the reference count upon expiration. However, if enqueuetask_dl() is called before the timer expires and cancels it, the reference count is not decremented, leading to the leak.
This patch fixes the reference leak by ensuring the task_struct reference count is properly decremented when the timer is canceled.
{ "vanir_signatures": [ { "id": "CVE-2024-41023-3051ac98", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7a54d31face626f62de415ebe77b43f76c3ffaf4", "deprecated": false, "signature_version": "v1", "signature_type": "Line", "digest": { "threshold": 0.9, "line_hashes": [ "43192025204423834974110187415441026938", "52109764605828800057447891671844272350", "42098957276382102254513979154463998437", "162305355972870514274163589861114629986" ] }, "target": { "file": "kernel/sched/deadline.c" } }, { "id": "CVE-2024-41023-5367944d", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b58652db66c910c2245f5bee7deca41c12d707b9", "deprecated": false, "signature_version": "v1", "signature_type": "Function", "digest": { "length": 809.0, "function_hash": "199421220914189895108820445433573143733" }, "target": { "file": "kernel/sched/deadline.c", "function": "enqueue_task_dl" } }, { "id": "CVE-2024-41023-bee441b0", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b58652db66c910c2245f5bee7deca41c12d707b9", "deprecated": false, "signature_version": "v1", "signature_type": "Line", "digest": { "threshold": 0.9, "line_hashes": [ "43192025204423834974110187415441026938", "52109764605828800057447891671844272350", "42098957276382102254513979154463998437", "162305355972870514274163589861114629986" ] }, "target": { "file": "kernel/sched/deadline.c" } }, { "id": "CVE-2024-41023-ec57f83c", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7a54d31face626f62de415ebe77b43f76c3ffaf4", "deprecated": false, "signature_version": "v1", "signature_type": "Function", "digest": { "length": 809.0, "function_hash": "199421220914189895108820445433573143733" }, "target": { "file": "kernel/sched/deadline.c", "function": "enqueue_task_dl" } } ] }