posix-cpu-timers: Fix pid refcount leak in do_cpu_nanosleep() error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 7776f9226e99eb49d97492b0b445027cfcb189da| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
posix-cpu-timers: Fix pid refcount leak in do_cpu_nanosleep() error path
In do_cpu_nanosleep(), posix_cpu_timer_create() takes a pid reference via get_pid() and stores it in timer.it.cpu.pid. If the subsequent posix_cpu_timer_set() call fails, the function returns immediately without calling posix_cpu_timer_del() to release the pid reference, causing a leak.
Fix it by calling posix_cpu_timer_del() before the unlock-and-return on the error path, consistent with the other exit paths in the same function.
From the CVE record · Linux
In the Linux kernel, do_cpu_nanosleep() leaks a pid reference if posix_cpu_timer_set() fails after a timer is created. The input does not establish how an attacker could trigger the failure, whether authentication or local access is required, or whether user interaction is needed.
Operators running the Linux kernel should check their deployments; affected versions are not specified.