mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-24 05:01:03 +02:00
lsm: security_task_getsecid_subj() -> security_current_getsecid_subj()
The security_task_getsecid_subj() LSM hook invites misuse by allowing callers to specify a task even though the hook is only safe when the current task is referenced. Fix this by removing the task_struct argument to the hook, requiring LSM implementations to use the current task. While we are changing the hook declaration we also rename the function to security_current_getsecid_subj() in an effort to reinforce that the hook captures the subjective credentials of the current task and not an arbitrary task on the system. Reviewed-by: Serge Hallyn <serge@hallyn.com> Reviewed-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
@@ -719,11 +719,9 @@
|
||||
* @p.
|
||||
* @p contains the task_struct for the process.
|
||||
* Return 0 if permission is granted.
|
||||
* @task_getsecid_subj:
|
||||
* Retrieve the subjective security identifier of the task_struct in @p
|
||||
* and return it in @secid. Special care must be taken to ensure that @p
|
||||
* is the either the "current" task, or the caller has exclusive access
|
||||
* to @p.
|
||||
* @current_getsecid_subj:
|
||||
* Retrieve the subjective security identifier of the current task and
|
||||
* return it in @secid.
|
||||
* In case of failure, @secid will be set to zero.
|
||||
* @task_getsecid_obj:
|
||||
* Retrieve the objective security identifier of the task_struct in @p
|
||||
|
Reference in New Issue
Block a user