linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lsm: add comment block for security_sk_classify_flow LSM hook
@ 2023-07-31 14:36 Khadija Kamran
  2023-07-31 16:56 ` Alison Schofield
  2023-07-31 20:07 ` Paul Moore
  0 siblings, 2 replies; 4+ messages in thread
From: Khadija Kamran @ 2023-07-31 14:36 UTC (permalink / raw)
  To: ztarkhani, alison.schofield, Paul Moore, James Morris,
	Serge E. Hallyn, linux-security-module, linux-kernel

security_sk_classify_flow LSM hook has no comment block. Add a comment
block with a brief description of LSM hook and its function parameters.

Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
---
 security/security.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/security/security.c b/security/security.c
index d5ff7ff45b77..ffc5519e49cd 100644
--- a/security/security.c
+++ b/security/security.c
@@ -4396,6 +4396,13 @@ void security_sk_clone(const struct sock *sk, struct sock *newsk)
 }
 EXPORT_SYMBOL(security_sk_clone);
 
+/**
+ * security_sk_classify_flow() - Set a flow's secid based on socket
+ * @sk:  original socket
+ * @flic: target flow
+ *
+ * Set the target flow's secid to socket's secid.
+ */
 void security_sk_classify_flow(struct sock *sk, struct flowi_common *flic)
 {
 	call_void_hook(sk_getsecid, sk, &flic->flowic_secid);
-- 
2.34.1


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

* Re: [PATCH] lsm: add comment block for security_sk_classify_flow LSM hook
  2023-07-31 14:36 [PATCH] lsm: add comment block for security_sk_classify_flow LSM hook Khadija Kamran
@ 2023-07-31 16:56 ` Alison Schofield
  2023-08-07  6:27   ` Khadija Kamran
  2023-07-31 20:07 ` Paul Moore
  1 sibling, 1 reply; 4+ messages in thread
From: Alison Schofield @ 2023-07-31 16:56 UTC (permalink / raw)
  To: Khadija Kamran
  Cc: ztarkhani, Paul Moore, James Morris, Serge E. Hallyn,
	linux-security-module, linux-kernel

On Mon, Jul 31, 2023 at 07:36:47PM +0500, Khadija Kamran wrote:
> security_sk_classify_flow LSM hook has no comment block. Add a comment
> block with a brief description of LSM hook and its function parameters.

When referring to functions, in the one line commit message, or here
in the commit log, it is customary to add the parenthesis to be clear
it is a function name.

ie. security_sk_classify_flow()

> 
> Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
> ---
>  security/security.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/security/security.c b/security/security.c
> index d5ff7ff45b77..ffc5519e49cd 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -4396,6 +4396,13 @@ void security_sk_clone(const struct sock *sk, struct sock *newsk)
>  }
>  EXPORT_SYMBOL(security_sk_clone);
>  
> +/**
> + * security_sk_classify_flow() - Set a flow's secid based on socket
> + * @sk:  original socket
           ^errant space

> + * @flic: target flow
> + *
> + * Set the target flow's secid to socket's secid.
> + */
>  void security_sk_classify_flow(struct sock *sk, struct flowi_common *flic)
>  {
>  	call_void_hook(sk_getsecid, sk, &flic->flowic_secid);
> -- 
> 2.34.1
> 

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

* Re: [PATCH] lsm: add comment block for security_sk_classify_flow LSM  hook
  2023-07-31 14:36 [PATCH] lsm: add comment block for security_sk_classify_flow LSM hook Khadija Kamran
  2023-07-31 16:56 ` Alison Schofield
@ 2023-07-31 20:07 ` Paul Moore
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Moore @ 2023-07-31 20:07 UTC (permalink / raw)
  To: Khadija Kamran
  Cc: Alison Schofield, ztarkhani, James Morris, Serge E. Hallyn,
	linux-security-module, linux-kernel

On Jul 31, 2023 Khadija Kamran wrote:
> 
> security_sk_classify_flow LSM hook has no comment block. Add a comment
> block with a brief description of LSM hook and its function parameters.
> 
> Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
> ---
>  security/security.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Thanks Khadija.  I did make a small change to your patch (see below)
when merging it into the lsm/next branch.

> diff --git a/security/security.c b/security/security.c
> index d5ff7ff45b77..ffc5519e49cd 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -4396,6 +4396,13 @@ void security_sk_clone(const struct sock *sk, struct sock *newsk)
>  }
>  EXPORT_SYMBOL(security_sk_clone);
>  
> +/**
> + * security_sk_classify_flow() - Set a flow's secid based on socket
> + * @sk:  original socket

As has been pointed out previously, there is a double-space between
"sk:" and "original socket".

> + * @flic: target flow
> + *
> + * Set the target flow's secid to socket's secid.
> + */
>  void security_sk_classify_flow(struct sock *sk, struct flowi_common *flic)
>  {
>  	call_void_hook(sk_getsecid, sk, &flic->flowic_secid);
> -- 
> 2.34.1

--
paul-moore.com

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

* Re: [PATCH] lsm: add comment block for security_sk_classify_flow LSM hook
  2023-07-31 16:56 ` Alison Schofield
@ 2023-08-07  6:27   ` Khadija Kamran
  0 siblings, 0 replies; 4+ messages in thread
From: Khadija Kamran @ 2023-08-07  6:27 UTC (permalink / raw)
  To: Alison Schofield
  Cc: ztarkhani, Paul Moore, James Morris, Serge E. Hallyn,
	linux-security-module, linux-kernel

On Mon, Jul 31, 2023 at 09:56:04AM -0700, Alison Schofield wrote:
> On Mon, Jul 31, 2023 at 07:36:47PM +0500, Khadija Kamran wrote:
> > security_sk_classify_flow LSM hook has no comment block. Add a comment
> > block with a brief description of LSM hook and its function parameters.
> 
> When referring to functions, in the one line commit message, or here
> in the commit log, it is customary to add the parenthesis to be clear
> it is a function name.
> 
> ie. security_sk_classify_flow()
> 
> > 
> > Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
> > ---
> >  security/security.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/security/security.c b/security/security.c
> > index d5ff7ff45b77..ffc5519e49cd 100644
> > --- a/security/security.c
> > +++ b/security/security.c
> > @@ -4396,6 +4396,13 @@ void security_sk_clone(const struct sock *sk, struct sock *newsk)
> >  }
> >  EXPORT_SYMBOL(security_sk_clone);
> >  
> > +/**
> > + * security_sk_classify_flow() - Set a flow's secid based on socket
> > + * @sk:  original socket
>            ^errant space
>

Hey Alison,
Noted. Thank you.

> > + * @flic: target flow
> > + *
> > + * Set the target flow's secid to socket's secid.
> > + */
> >  void security_sk_classify_flow(struct sock *sk, struct flowi_common *flic)
> >  {
> >  	call_void_hook(sk_getsecid, sk, &flic->flowic_secid);
> > -- 
> > 2.34.1
> > 

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

end of thread, other threads:[~2023-08-07  6:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-31 14:36 [PATCH] lsm: add comment block for security_sk_classify_flow LSM hook Khadija Kamran
2023-07-31 16:56 ` Alison Schofield
2023-08-07  6:27   ` Khadija Kamran
2023-07-31 20:07 ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).