smack: fix incorrect task context in smack_msg_queue_msgrcv
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e114e473771c848c3cfec05f0123e70f1cdbdc99 · < c2ab27c2e11591524b1378c24ad18882a425d1fa| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
smack: fix incorrect task context in smack_msg_queue_msgrcv
The smack_msg_queue_msgrcv() function incorrectly checks the permissions of the 'current' task instead of the 'target' task.
In the msgsnd() syscall path, if a receiver is already waiting, the pipelined_send() optimization is used to push the message directly to the receiver task:
ipc/msg.c`pipelined_send(): ` smp_store_release(&msr->r_msg, msg)
In this case, the 'sender' (current) task performs the check on behalf of the 'receiver' task (msr->r_tsk, passed as the 'target' parameter):
ipc/msg.c`pipelined_send(): ` security_msg_queue_msgrcv(,, target := msr->r_tsk,,)
However, smack_msg_queue_msgrcv() ignores the 'target' and checks 'current':
From the CVE record · Linux
The Linux kernel’s Smack check for System V message queues can check the sender’s permissions instead of a waiting receiver’s. When a sender delivers a message directly to a waiting receiver, that receiver can receive a message its Smack policy does not permit it to access. This requires local message-queue use; the input does not specify authentication requirements.
Operators of Linux systems using Smack and System V message queues should check their kernels; affected versions are not specified.