CVE-2026-64560

Source
https://cve.org/CVERecord?id=CVE-2026-64560
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64560.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-64560
Downstream
Published
2026-07-29T16:47:17.602Z
Modified
2026-07-30T04:02:49.720999709Z
Summary
posix-cpu-timers: Prevent UAF caused by non-leader exec() race
Details

In the Linux kernel, the following vulnerability has been resolved:

posix-cpu-timers: Prevent UAF caused by non-leader exec() race

Wongi and Jungwoo decoded and reported a non-leader exec() related race which can result in an UAF:

systimerdelete() exec() posixcputimerdel() // Observes old leader p = pidtask(pid, pidtype); dethread() switchleader(); releasetask(oldleader) exitsignal(oldleader) sighand = lock(oldleader, sighand); posixcputimers*exit(); sighand = locktasksighand(p) unhashtask(oldleader); sh = lock(p, sighand) oldleader->sighand = NULL; unlock(sighand); (p->sighand == NULL) unlock(sh) return NULL;

// Returns without action if(!sighand) return 0; freeposixtimer();

This is "harmless" unless the deleted timer was armed and enqueued in p->signal because on exec() a TGID targeted timer is inherited.

As systimerdelete() freed the underlying posix timer object runposixcpu_timers() or any timerqueue related add/delete operations on other timers will access the freed object's timerqueue node, which results in an UAF.

There is a similar problem vs. posixcputimerset(). For regular posix timers it just transiently returns -ESRCH to user space, but for the use case in docpunanosleep() it's the same UAF just that the kitimer is allocated on the stack.

Also posixcputimer_rearm() fails to rearm the timer, which means it stops to expire.

While debating solutions Frederic pointed out another problem:

posixcputimerdel(tmr) exitsignal(p) posixcputimers*exit(p); unhashtask(p); p->sighand = NULL; sh = locktasksighand(p) sighand = p->sighand; if (!sighand) return NULL; lock(sighand);

 if (!sh)
WARN_ON_ONCE(timer_queued(tmr));

On weakly ordered architectures it is not guaranteed that posixcputimerdel() will observe the stores in posixcpu_timers*_exit() when p->sighand is observed as NULL, which means the WARN() can be a false positive.

Solve these issues by:

1) Changing the store in _exitsignal() to smpstorerelease().

2) Adding a smp_acquire__afterctrldep() into the !sighand path of locktasksighand().

3) Creating a helper function for looking up the task and locking sighand which does not return when sighand == NULL. Instead it retries the task lookup and only if that fails it gives up.

4) Using that helper in the three affected functions.

1/#2 ensures that the reader side which observes sighand == NULL also

observes all preceeding stores, i.e. the stores in posixcputimers*exit() and the ones in unhashtask().

3 ensures that the above described non-leader exec() situation is handled

gracefully. When the task lookup returns the old leader, but sighand == NULL then it retries. In the non-leader exec() case the subsequent task lookup will observe the new leader due to #1/#2. In normal exit() scenarios the subsequent lookup fails.

When the task lookup fails, the function also checks whether the timer is still enqueued and issues a warning if that's the case. Unfortunately there is nothing which can be done about it, but as the task is already not longer visible the timer should not be accessed anymore. This check also requires memory ordering, which is not provided when the first lookup fails. To achieve that the check is preceeded by a smprmb() which pairs with the smpwmb() in write_seqlock() in _exitsignal(). That ensures that the stores in posixcputimers*_exit() are visible.

The history of the non-leader exec() issue goes back to the early days of posix CPU timers, which stored a pointer to the group leader task in the timer. That obviously fails when a non-leader exec() switches the leader. commit e0a70217107e ("posix-cpu-timers: workaround to suppress the problems with mt exec") added a temporary workaround for that in 2010 which surv ---truncated---

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64560.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
55e8c8eb2c7b6bf30e99423ccfe7ca032f498f59
Fixed
ad1cafa1bdaa71da85d71cac053838bbe97852b6
Fixed
920f893f735e92ba3a1cd9256899a186b161928d

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64560.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.7.0
Fixed
7.1.5

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64560.json"