All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] audit: Make audit_filter_syscall() return void
@ 2021-01-26 13:11 ` menglong8.dong
  0 siblings, 0 replies; 4+ messages in thread
From: menglong8.dong @ 2021-01-26 13:11 UTC (permalink / raw)
  To: paul; +Cc: eparis, linux-audit, linux-kernel, Yang Yang

From: Yang Yang <yang.yang29@zte.com.cn>

No invoker users the return value of audit_filter_syscall().
So make it return void.

Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
---
 kernel/auditsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ce8c9e2279ba..c8e16b9c0f21 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -804,7 +804,7 @@ static int audit_in_mask(const struct audit_krule *rule, unsigned long val)
  * also not high enough that we already know we have to write an audit
  * record (i.e., the state is AUDIT_SETUP_CONTEXT or AUDIT_BUILD_CONTEXT).
  */
-static enum audit_state audit_filter_syscall(struct task_struct *tsk,
+static void audit_filter_syscall(struct task_struct *tsk,
 					     struct audit_context *ctx,
 					     struct list_head *list)
 {
@@ -812,7 +812,7 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
 	enum audit_state state;
 
 	if (auditd_test_task(tsk))
-		return AUDIT_DISABLED;
+		return;
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(e, list, list) {
@@ -821,11 +821,11 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
 				       &state, false)) {
 			rcu_read_unlock();
 			ctx->current_state = state;
-			return state;
+			return;
 		}
 	}
 	rcu_read_unlock();
-	return AUDIT_BUILD_CONTEXT;
+	return;
 }
 
 /*
-- 
2.25.1


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

* [PATCH] audit: Make audit_filter_syscall() return void
@ 2021-01-26 13:11 ` menglong8.dong
  0 siblings, 0 replies; 4+ messages in thread
From: menglong8.dong @ 2021-01-26 13:11 UTC (permalink / raw)
  To: paul; +Cc: Yang Yang, linux-audit, linux-kernel

From: Yang Yang <yang.yang29@zte.com.cn>

No invoker users the return value of audit_filter_syscall().
So make it return void.

Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
---
 kernel/auditsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ce8c9e2279ba..c8e16b9c0f21 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -804,7 +804,7 @@ static int audit_in_mask(const struct audit_krule *rule, unsigned long val)
  * also not high enough that we already know we have to write an audit
  * record (i.e., the state is AUDIT_SETUP_CONTEXT or AUDIT_BUILD_CONTEXT).
  */
-static enum audit_state audit_filter_syscall(struct task_struct *tsk,
+static void audit_filter_syscall(struct task_struct *tsk,
 					     struct audit_context *ctx,
 					     struct list_head *list)
 {
@@ -812,7 +812,7 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
 	enum audit_state state;
 
 	if (auditd_test_task(tsk))
-		return AUDIT_DISABLED;
+		return;
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(e, list, list) {
@@ -821,11 +821,11 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
 				       &state, false)) {
 			rcu_read_unlock();
 			ctx->current_state = state;
-			return state;
+			return;
 		}
 	}
 	rcu_read_unlock();
-	return AUDIT_BUILD_CONTEXT;
+	return;
 }
 
 /*
-- 
2.25.1

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


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

* Re: [PATCH] audit: Make audit_filter_syscall() return void
  2021-01-26 13:11 ` menglong8.dong
@ 2021-01-26 19:04   ` Richard Guy Briggs
  -1 siblings, 0 replies; 4+ messages in thread
From: Richard Guy Briggs @ 2021-01-26 19:04 UTC (permalink / raw)
  To: menglong8.dong; +Cc: paul, Yang Yang, linux-audit, linux-kernel

On 2021-01-26 05:11, menglong8.dong@gmail.com wrote:
> From: Yang Yang <yang.yang29@zte.com.cn>
> 
> No invoker users the return value of audit_filter_syscall().
> So make it return void.

That was my oversight when ripping out the AUDIT_FILTER_ENTRY list:
5260ecc2e048 <rgb@redhat.com> 2018-02-14 ("audit: deprecate the AUDIT_FILTER_ENTRY filter")

Might as well also amend the function comment block to remove the
reference to syscall entry since that is no longer relevant.

> Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>

> ---
>  kernel/auditsc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index ce8c9e2279ba..c8e16b9c0f21 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -804,7 +804,7 @@ static int audit_in_mask(const struct audit_krule *rule, unsigned long val)
>   * also not high enough that we already know we have to write an audit
>   * record (i.e., the state is AUDIT_SETUP_CONTEXT or AUDIT_BUILD_CONTEXT).
>   */
> -static enum audit_state audit_filter_syscall(struct task_struct *tsk,
> +static void audit_filter_syscall(struct task_struct *tsk,
>  					     struct audit_context *ctx,
>  					     struct list_head *list)
>  {
> @@ -812,7 +812,7 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
>  	enum audit_state state;
>  
>  	if (auditd_test_task(tsk))
> -		return AUDIT_DISABLED;
> +		return;
>  
>  	rcu_read_lock();
>  	list_for_each_entry_rcu(e, list, list) {
> @@ -821,11 +821,11 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
>  				       &state, false)) {
>  			rcu_read_unlock();
>  			ctx->current_state = state;
> -			return state;
> +			return;
>  		}
>  	}
>  	rcu_read_unlock();
> -	return AUDIT_BUILD_CONTEXT;
> +	return;
>  }
>  
>  /*
> -- 
> 2.25.1
> 
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit

- RGB

--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635


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

* Re: [PATCH] audit: Make audit_filter_syscall() return void
@ 2021-01-26 19:04   ` Richard Guy Briggs
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Guy Briggs @ 2021-01-26 19:04 UTC (permalink / raw)
  To: menglong8.dong; +Cc: Yang Yang, linux-audit, linux-kernel

On 2021-01-26 05:11, menglong8.dong@gmail.com wrote:
> From: Yang Yang <yang.yang29@zte.com.cn>
> 
> No invoker users the return value of audit_filter_syscall().
> So make it return void.

That was my oversight when ripping out the AUDIT_FILTER_ENTRY list:
5260ecc2e048 <rgb@redhat.com> 2018-02-14 ("audit: deprecate the AUDIT_FILTER_ENTRY filter")

Might as well also amend the function comment block to remove the
reference to syscall entry since that is no longer relevant.

> Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>

> ---
>  kernel/auditsc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index ce8c9e2279ba..c8e16b9c0f21 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -804,7 +804,7 @@ static int audit_in_mask(const struct audit_krule *rule, unsigned long val)
>   * also not high enough that we already know we have to write an audit
>   * record (i.e., the state is AUDIT_SETUP_CONTEXT or AUDIT_BUILD_CONTEXT).
>   */
> -static enum audit_state audit_filter_syscall(struct task_struct *tsk,
> +static void audit_filter_syscall(struct task_struct *tsk,
>  					     struct audit_context *ctx,
>  					     struct list_head *list)
>  {
> @@ -812,7 +812,7 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
>  	enum audit_state state;
>  
>  	if (auditd_test_task(tsk))
> -		return AUDIT_DISABLED;
> +		return;
>  
>  	rcu_read_lock();
>  	list_for_each_entry_rcu(e, list, list) {
> @@ -821,11 +821,11 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
>  				       &state, false)) {
>  			rcu_read_unlock();
>  			ctx->current_state = state;
> -			return state;
> +			return;
>  		}
>  	}
>  	rcu_read_unlock();
> -	return AUDIT_BUILD_CONTEXT;
> +	return;
>  }
>  
>  /*
> -- 
> 2.25.1
> 
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit

- RGB

--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


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

end of thread, other threads:[~2021-01-27  1:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 13:11 [PATCH] audit: Make audit_filter_syscall() return void menglong8.dong
2021-01-26 13:11 ` menglong8.dong
2021-01-26 19:04 ` Richard Guy Briggs
2021-01-26 19:04   ` Richard Guy Briggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.