smack: fix cred UAF in smack_file_send_sigiotask()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3b11a1decef07c19443d24ae926982bc8ec9f4c0 · < b791401bf389a1546a830d2b381ca60fe94c7870| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
smack: fix cred UAF in smack_file_send_sigiotask()
When inspecting the credentials of another task, objective credentials (->real_cred, accessed with __task_cred()) must always be used.
Accessing ->cred on a non-current task is forbidden unless that task is being created or destroyed; a task is allowed to change its own ->cred pointer with no synchronization, and changing ->cred should only affect the current syscall.
smack_file_send_sigiotask() was accessing both sets of credentials: First tsk->cred, then __task_cred(tsk).
Fix it, always access the objective credentials here.
I have tested that this bug can lead to a KASAN-reported UAF of struct cred in smack_file_send_sigiotask(), and that this fix prevents the race.
From the CVE record · Linux
The Linux kernel’s Smack code can race while inspecting another task’s credentials, causing a use-after-free in smack_file_send_sigiotask(). The input does not establish how an attacker could trigger the race or whether access or user interaction is required.
Anyone running a Linux kernel with the affected Smack code should check their kernel version; affected versions are not specified.