Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH] security: clarify task_prctl hook documentation
@ 2026-06-15 20:03 Bill Roberts
  2026-06-16 16:07 ` Casey Schaufler
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Roberts @ 2026-06-15 20:03 UTC (permalink / raw)
  To: Paul Moore, James Morris, Serge E. Hallyn
  Cc: casey, Bill Roberts, linux-security-module, linux-kernel

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.

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
---
 security/security.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/security/security.c b/security/security.c
index 4e999f023651..96e6ef088801 100644
--- a/security/security.c
+++ b/security/security.c
@@ -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.
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] security: clarify task_prctl hook documentation
  2026-06-15 20:03 [PATCH] security: clarify task_prctl hook documentation Bill Roberts
@ 2026-06-16 16:07 ` Casey Schaufler
  2026-06-16 17:14   ` Serge E. Hallyn
  0 siblings, 1 reply; 3+ messages in thread
From: Casey Schaufler @ 2026-06-16 16:07 UTC (permalink / raw)
  To: Bill Roberts, Paul Moore, James Morris, Serge E. Hallyn
  Cc: linux-security-module, linux-kernel, Casey Schaufler

On 6/15/2026 1:03 PM, Bill Roberts wrote:
> 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.
>
> Signed-off-by: Bill Roberts <bill.roberts@arm.com>

Acked-by: Casey Schaufler <casey@schaufler-ca.com>

> ---
>  security/security.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/security/security.c b/security/security.c
> index 4e999f023651..96e6ef088801 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] security: clarify task_prctl hook documentation
  2026-06-16 16:07 ` Casey Schaufler
@ 2026-06-16 17:14   ` Serge E. Hallyn
  0 siblings, 0 replies; 3+ messages in thread
From: Serge E. Hallyn @ 2026-06-16 17:14 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: Bill Roberts, Paul Moore, James Morris, Serge E. Hallyn,
	linux-security-module, linux-kernel

On Tue, Jun 16, 2026 at 09:07:40AM -0700, Casey Schaufler wrote:
> On 6/15/2026 1:03 PM, Bill Roberts wrote:
> > 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.
> >
> > Signed-off-by: Bill Roberts <bill.roberts@arm.com>
> 
> Acked-by: Casey Schaufler <casey@schaufler-ca.com>

Yeah, this is an important distinction, thanks.

Reviewed-by: Serge Hallyn <serge@hallyn.com>

> > ---
> >  security/security.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/security/security.c b/security/security.c
> > index 4e999f023651..96e6ef088801 100644
> > --- a/security/security.c
> > +++ b/security/security.c
> > @@ -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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-16 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 20:03 [PATCH] security: clarify task_prctl hook documentation Bill Roberts
2026-06-16 16:07 ` Casey Schaufler
2026-06-16 17:14   ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox