security: clarify task_prctl hook documentation
PATCH 1/1 security: clarify task_prctl hook documentation
The task_prctl hook comment incorrectly described the hook as checking whether a prctl operation is allowed. In reality, the hook exists for LSMs to handle LSM-specific prctl operations.
Update the function description and kernel-doc comment to reflect the actual behavior. The old wording appears to have been copied from other permission-check hooks despite differing semantics.
--- security/security.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
security/security.c +2 -3
@@ -3301,15 +3301,14 @@ int security_task_kill(struct task_struct *p, struct kernel_siginfo *info, }/** -* security_task_prctl() - Check if a prctl op is allowed +* security_task_prctl() - Handle an LSM specific prctl call * @option: operation * @arg2: argument * @arg3: argument * @arg4: argument * @arg5: argument * -* Check permission before performing a process control operation on the -* current process. +* Handle lsm specific prctl operations. * * Return: Return -ENOSYS if no-one wanted to handle this op, any other value * to cause prctl() to return immediately with that value.
Signature · 1 line
2.54.0
Quoted 9 lines · Bill Roberts
The
task_prctlhook comment incorrectly described the hook as checking whether a prctl operation is allowed. In reality, the hook exists for LSMs to handle LSM-specific prctl operations.Update the function description and kernel-doc comment to reflect the actual behavior. The old wording appears to have been copied from other permission-check hooks despite differing semantics.
Signed-off-by Bill Roberts <[email protected]>
Quoted 26 lines
--- security/security.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)security/security.c +2
-3@@ -3301,15 +3301,14 @@ int security_task_kill(struct task_struct *p, struct kernel_siginfo *info, }/** -* security_task_prctl() - Check if a prctl op is allowed +* security_task_prctl() - Handle an LSM specific prctl call * @option: operation * @arg2: argument * @arg3: argument * @arg4: argument * @arg5: argument * -* Check permission before performing a process control operation on the -* current process. +* Handle lsm specific prctl operations. * * Return: Return -ENOSYS if no-one wanted to handle this op, any other value * to cause prctl() to return immediately with that value.
Quoted 5 lines · Casey Schaufler
Quoted 4 lines · Bill Roberts
The
task_prctlhook comment incorrectly described the hook as checking whether a prctl operation is allowed. In reality, the hook exists for LSMs to handle LSM-specific prctl operations.
Quoted 7 lines
Quoted 5 lines
Update the function description and kernel-doc comment to reflect the actual behavior. The old wording appears to have been copied from other permission-check hooks despite differing semantics.
Signed-off-by Bill Roberts <[email protected]>Acked-by Casey Schaufler <[email protected]>
Yeah, this is an important distinction, thanks.
Quoted 26 lines
Quoted 26 lines
--- security/security.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)security/security.c +2
-3@@ -3301,15 +3301,14 @@ int security_task_kill(struct task_struct *p, struct kernel_siginfo *info, }/** -* security_task_prctl() - Check if a prctl op is allowed +* security_task_prctl() - Handle an LSM specific prctl call * @option: operation * @arg2: argument * @arg3: argument * @arg4: argument * @arg5: argument * -* Check permission before performing a process control operation on the -* current process. +* Handle lsm specific prctl operations. * * Return: Return -ENOSYS if no-one wanted to handle this op, any other value * to cause prctl() to return immediately with that value.
Paul Moore
maintainerQuoted 9 lines · On Jun 15, 2026 Bill Roberts <[email protected]> wrote:
The
task_prctlhook comment incorrectly described the hook as checking whether a prctl operation is allowed. In reality, the hook exists for LSMs to handle LSM-specific prctl operations.Update the function description and kernel-doc comment to reflect the actual behavior. The old wording appears to have been copied from other permission-check hooks despite differing semantics.
Quoted 6 lines
Signed-off-by Bill Roberts <[email protected]>Acked-by Casey Schaufler <[email protected]>Reviewed-by Serge Hallyn <[email protected]>--- security/security.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Good catch, thanks! Merged into lsm/dev.
--
paul-moore.com