public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output.
@ 2008-07-31  2:11 zhangxiliang
  2008-07-31  3:15 ` Eric Paris
  0 siblings, 1 reply; 4+ messages in thread
From: zhangxiliang @ 2008-07-31  2:11 UTC (permalink / raw)
  To: sgrubb, viro, eparis, Linux Audit, Linux Kernel Mailing List

When the "status_get->mask" is "AUDIT_STATUS_RATE_LIMIT || AUDIT_STATUS_BACKLOG_LIMIT".
If "audit_set_rate_limit" fails and "audit_set_backlog_limit" succeeds, the "err" value will be greater than or equal to 0. It will miss the failure of rate set. 

Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
---
 kernel/audit.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index e092f1c..38a4080 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -725,9 +725,11 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 			audit_pid = new_pid;
 			audit_nlk_pid = NETLINK_CB(skb).pid;
 		}
-		if (status_get->mask & AUDIT_STATUS_RATE_LIMIT)
+		if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) {
 			err = audit_set_rate_limit(status_get->rate_limit,
 						   loginuid, sessionid, sid);
+			if (err < 0) return err;
+		}
 		if (status_get->mask & AUDIT_STATUS_BACKLOG_LIMIT)
 			err = audit_set_backlog_limit(status_get->backlog_limit,
 						      loginuid, sessionid, sid);
-- 
1.5.4.2


-- 
Regards
Zhang Xiliang


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

* Re: [PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output.
  2008-07-31  2:11 [PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output zhangxiliang
@ 2008-07-31  3:15 ` Eric Paris
  2008-07-31 16:04   ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Paris @ 2008-07-31  3:15 UTC (permalink / raw)
  To: zhangxiliang; +Cc: sgrubb, viro, Linux Audit, Linux Kernel Mailing List

On Thu, 2008-07-31 at 10:11 +0800, zhangxiliang wrote:
> When the "status_get->mask" is "AUDIT_STATUS_RATE_LIMIT || AUDIT_STATUS_BACKLOG_LIMIT".
> If "audit_set_rate_limit" fails and "audit_set_backlog_limit" succeeds, the "err" value will be greater than or equal to 0. It will miss the failure of rate set. 
> 
> Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>

man, it gives me the heebee jeebies with the coding style but it follows
everything else

Acked-by: Eric Paris <eparis@redhat.com>


> ---
>  kernel/audit.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/audit.c b/kernel/audit.c
> index e092f1c..38a4080 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -725,9 +725,11 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
>  			audit_pid = new_pid;
>  			audit_nlk_pid = NETLINK_CB(skb).pid;
>  		}
> -		if (status_get->mask & AUDIT_STATUS_RATE_LIMIT)
> +		if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) {
>  			err = audit_set_rate_limit(status_get->rate_limit,
>  						   loginuid, sessionid, sid);
> +			if (err < 0) return err;
> +		}
>  		if (status_get->mask & AUDIT_STATUS_BACKLOG_LIMIT)
>  			err = audit_set_backlog_limit(status_get->backlog_limit,
>  						      loginuid, sessionid, sid);
> -- 
> 1.5.4.2
> 
> 


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

* Re: [PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output.
  2008-07-31  3:15 ` Eric Paris
@ 2008-07-31 16:04   ` Al Viro
  2008-07-31 21:59     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2008-07-31 16:04 UTC (permalink / raw)
  To: Eric Paris; +Cc: zhangxiliang, sgrubb, Linux Audit, Linux Kernel Mailing List

On Wed, Jul 30, 2008 at 11:15:50PM -0400, Eric Paris wrote:
> On Thu, 2008-07-31 at 10:11 +0800, zhangxiliang wrote:
> > When the "status_get->mask" is "AUDIT_STATUS_RATE_LIMIT || AUDIT_STATUS_BACKLOG_LIMIT".
> > If "audit_set_rate_limit" fails and "audit_set_backlog_limit" succeeds, the "err" value will be greater than or equal to 0. It will miss the failure of rate set. 
> > 
> > Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
> 
> man, it gives me the heebee jeebies with the coding style but it follows
> everything else

Sanitized, applied, pushed to audit-current (audit.b53)

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

* Re: [PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output.
  2008-07-31 16:04   ` Al Viro
@ 2008-07-31 21:59     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2008-07-31 21:59 UTC (permalink / raw)
  To: Al Viro; +Cc: eparis, zhangxiliang, sgrubb, linux-audit, linux-kernel

On Thu, 31 Jul 2008 17:04:38 +0100
Al Viro <viro@ZenIV.linux.org.uk> wrote:

> On Wed, Jul 30, 2008 at 11:15:50PM -0400, Eric Paris wrote:
> > On Thu, 2008-07-31 at 10:11 +0800, zhangxiliang wrote:
> > > When the "status_get->mask" is "AUDIT_STATUS_RATE_LIMIT || AUDIT_STATUS_BACKLOG_LIMIT".
> > > If "audit_set_rate_limit" fails and "audit_set_backlog_limit" succeeds, the "err" value will be greater than or equal to 0. It will miss the failure of rate set. 
> > > 
> > > Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
> > 
> > man, it gives me the heebee jeebies with the coding style but it follows
> > everything else
> 
> Sanitized, applied, pushed to audit-current (audit.b53)

That tree doesn't appear to be in the linux-next lineup.  Fixable, please?

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

end of thread, other threads:[~2008-07-31 22:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-31  2:11 [PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output zhangxiliang
2008-07-31  3:15 ` Eric Paris
2008-07-31 16:04   ` Al Viro
2008-07-31 21:59     ` Andrew Morton

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