linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] audit: fix oops removing watch if audit disabled
@ 2007-06-20 22:38 Tony Jones
  2007-06-23 16:51 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Tony Jones @ 2007-06-20 22:38 UTC (permalink / raw)
  To: linux-audit; +Cc: linux-kernel

Removing a watched file will oops if audit is disabled (auditctl -e 0).

To reproduce:
- auditctl -e 1
- touch /tmp/foo
- auditctl -w /tmp/foo
- auditctl -e 0
- rm /tmp/foo (or mv)

Signed-off-by: Tony Jones <tonyj@suse.de>
---

diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 74cc0fc..ce61f42 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -947,7 +947,7 @@ static void audit_update_watch(struct au
 
 		/* If the update involves invalidating rules, do the inode-based
 		 * filtering now, so we don't omit records. */
-		if (invalidating &&
+		if (invalidating && current->audit_context &&
 		    audit_filter_inodes(current, current->audit_context) == AUDIT_RECORD_CONTEXT)
 			audit_set_auditable(current->audit_context);
 

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

* Re: [PATCH 1/1] audit: fix oops removing watch if audit disabled
  2007-06-20 22:38 [PATCH 1/1] audit: fix oops removing watch if audit disabled Tony Jones
@ 2007-06-23 16:51 ` Andrew Morton
  2007-06-23 16:58   ` S.Çağlar Onur
  2007-06-23 19:16   ` Al Viro
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2007-06-23 16:51 UTC (permalink / raw)
  To: Tony Jones; +Cc: linux-audit, linux-kernel, Al Viro

> On Wed, 20 Jun 2007 15:38:20 -0700 Tony Jones <tonyj@suse.de> wrote:
> Removing a watched file will oops if audit is disabled (auditctl -e 0).
> 
> To reproduce:
> - auditctl -e 1
> - touch /tmp/foo
> - auditctl -w /tmp/foo
> - auditctl -e 0
> - rm /tmp/foo (or mv)
> 
> Signed-off-by: Tony Jones <tonyj@suse.de>
> ---
> 
> diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
> index 74cc0fc..ce61f42 100644
> --- a/kernel/auditfilter.c
> +++ b/kernel/auditfilter.c
> @@ -947,7 +947,7 @@ static void audit_update_watch(struct au
>  
>  		/* If the update involves invalidating rules, do the inode-based
>  		 * filtering now, so we don't omit records. */
> -		if (invalidating &&
> +		if (invalidating && current->audit_context &&
>  		    audit_filter_inodes(current, current->audit_context) == AUDIT_RECORD_CONTEXT)
>  			audit_set_auditable(current->audit_context);

This looks like 2.6.22 material to me.

Question is: is it also 2.6.21.x material?

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

* Re: [PATCH 1/1] audit: fix oops removing watch if audit disabled
  2007-06-23 16:51 ` Andrew Morton
@ 2007-06-23 16:58   ` S.Çağlar Onur
  2007-06-23 19:16   ` Al Viro
  1 sibling, 0 replies; 5+ messages in thread
From: S.Çağlar Onur @ 2007-06-23 16:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Tony Jones, linux-audit, linux-kernel, Al Viro

[-- Attachment #1: Type: text/plain, Size: 383 bytes --]

23 Haz 2007 Cts tarihinde, Andrew Morton şunları yazmıştı: 
> This looks like 2.6.22 material to me.
>
> Question is: is it also 2.6.21.x material?

I even can reproduce same oops with 2.6.18 :)

Cheers
-- 
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH 1/1] audit: fix oops removing watch if audit disabled
  2007-06-23 16:51 ` Andrew Morton
  2007-06-23 16:58   ` S.Çağlar Onur
@ 2007-06-23 19:16   ` Al Viro
  2007-06-23 19:19     ` Andrew Morton
  1 sibling, 1 reply; 5+ messages in thread
From: Al Viro @ 2007-06-23 19:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Tony Jones, linux-audit, linux-kernel, Al Viro

On Sat, Jun 23, 2007 at 09:51:53AM -0700, Andrew Morton wrote:
> This looks like 2.6.22 material to me.
> 
> Question is: is it also 2.6.21.x material?

Yes, it is.

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

* Re: [PATCH 1/1] audit: fix oops removing watch if audit disabled
  2007-06-23 19:16   ` Al Viro
@ 2007-06-23 19:19     ` Andrew Morton
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2007-06-23 19:19 UTC (permalink / raw)
  To: Al Viro; +Cc: Tony Jones, linux-audit, linux-kernel, Al Viro

On Sat, 23 Jun 2007 20:16:09 +0100 Al Viro <viro@ftp.linux.org.uk> wrote:

> On Sat, Jun 23, 2007 at 09:51:53AM -0700, Andrew Morton wrote:
> > This looks like 2.6.22 material to me.
> > 
> > Question is: is it also 2.6.21.x material?
> 
> Yes, it is.

OK, thanks, I queued it for both kernels.

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

end of thread, other threads:[~2007-06-23 19:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-20 22:38 [PATCH 1/1] audit: fix oops removing watch if audit disabled Tony Jones
2007-06-23 16:51 ` Andrew Morton
2007-06-23 16:58   ` S.Çağlar Onur
2007-06-23 19:16   ` Al Viro
2007-06-23 19:19     ` Andrew Morton

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).