Crashes with a page fault on audit_prune_tree
by Smith, Gary R
Hi all,
I've seen a several systems crash with what appears to a page fault on audit_prune_tree. The systems are 2.6.18-164.11.1.el5 and audit-1.7.17-3.el5. I've seen crashes with traces like this:
crash> bt
PID: 16570 TASK: ffff810108f447a0 CPU: 6 COMMAND: "audit_prune_tre"
#0 [ffff81012e009bd0] crash_kexec at ffffffff800ad060
#1 [ffff81012e009c90] __die at ffffffff80065157
#2 [ffff81012e009cd0] do_page_fault at ffffffff80066dd7
#3 [ffff81012e009dc0] error_exit at ffffffff8005dde9
[exception RIP: pin_inotify_watch+20]
RIP: ffffffff800f6034 RSP: ffff81012e009e70 RFLAGS: 00010282
RAX: 0000000000000190 RBX: ffff8100af8f4ec0 RCX: ffff8100af8f4ef0
RDX: ffffffff8030fbe0 RSI: ffff810108f447a0 RDI: ffffffff80311d70
RBP: ffff8100383bb730 R8: ffff81012e008000 R9: 000000000000003a
R10: ffff81012fd54038 R11: 0000000000000280 R12: ffff8100383bb720
R13: 0000000000000000 R14: ffff8100383bb730 R15: ffffffff8009fea7
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0000
#4 [ffff81012e009e88] untag_chunk at ffffffff800b835d
#5 [ffff81012e009ec8] prune_one at ffffffff800b8711
#6 [ffff81012e009ed8] prune_tree_thread at ffffffff800b8f93
#7 [ffff81012e009ee8] kthread at ffffffff8003298c
#8 [ffff81012e009f48] kernel_thread at ffffffff8005dfb1
crash>
I looked on bugzilla and did not see anything related to this.
I looked at the kernel stack dump below and saw that there appeared to be duplicates of the audit processes running (auditd, audispd, audisp-prelide) I'm wondering if for some reason a second set of audit processes got started up and that caused a race condition and the kernel crashed.
15599 1 3 ffff8100171e3860 IN 0.0 92684 1676 auditd
15600 1 1 ffff8100171e3100 IN 0.0 92684 1676 auditd
15601 15599 5 ffff8100b5952820 IN 0.0 147336 964 audispd
15602 15601 4 ffff8100b59520c0 IN 0.1 38252 2504 audisp-prelude
15603 15599 7 ffff81004a964860 IN 0.0 147336 964 audispd
15606 15601 4 ffff81004a964100 IN 0.1 38252 2504 audisp-prelude
16554 14228 6 ffff81002a875820 IN 0.0 8700 952 module:auditd
16555 16554 6 ffff8100a66c9860 IN 0.0 66212 1548 auditd
16559 16555 1 ffff81010be17100 UN 0.0 6176 816 auditctl
> 16570 73 6 ffff810108f447a0 RU 0.0 0 0 [audit_prune_tre]
Any thoughts are appreciated.
Best regards,
Gary Smith
14 years, 6 months
[PATCH 0/6] Fix gcc warnings of unused variables etc..
by Justin P. Mattock
This set of patches, basically shuts-up
the warning messages by gcc-4.6.0.
As of now I just went through some
of the trivial ones that might be dead
code reported by gcc(but could be wrong).
Please have a look, if somebody has a better
way of dealing with this, let me know, and
I can test some patches..
Justin P. Mattock
14 years, 6 months
Re: [PATCH 5/6]kernel:module.c variable 'nowarn' set but not used
by Justin P. Mattock
> Also wrong, you removed the creation of the links in sysfs.
>
> The assignment to nowarn was there to avoid another compiler warning,
> as sysfs_create_link() is marked __must_check.
I also went back to this one and made the following changes.. let me
know if it's wrong etc..
From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
From: Justin P. Mattock <justinmattock(a)gmail.com>
Date: Fri, 18 Jun 2010 22:01:07 -0700
Subject: [PATCH 5/5] module.c
Signed-off-by: Justin P. Mattock <justinmattock(a)gmail.com>
---
kernel/module.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index 8c6b428..48fc5c8 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
{
#ifdef CONFIG_MODULE_UNLOAD
struct module_use *use;
- int nowarn;
mutex_lock(&module_mutex);
list_for_each_entry(use, &mod->target_list, target_list) {
- nowarn = sysfs_create_link(use->target->holders_dir,
+ sysfs_create_link(use->target->holders_dir,
&mod->mkobj.kobj, mod->name);
}
mutex_unlock(&module_mutex);
--
1.7.1.rc1.21.gf3bd6
if it looks good, then I can resend it out.
Justin P. Mattock
14 years, 6 months
[PATCH 2/6 v2]kernel:audit.c Fix warning: variable 'nlh' set but not used
by Justin P. Mattock
This is a resend from the original due to some whitespace issues,
and done incorrectly.
The below patch fixes this warning from gcc 4.6.0
CC kernel/audit.o
kernel/audit.c: In function 'audit_buffer_alloc':
kernel/audit.c:1044:19: warning: variable 'nlh' set but not used
Signed-off-by: Justin P. Mattock <justinmattock(a)gmail.com>
---
kernel/audit.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index c71bd26..1d51258 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1041,7 +1041,6 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
{
unsigned long flags;
struct audit_buffer *ab = NULL;
- struct nlmsghdr *nlh;
spin_lock_irqsave(&audit_freelist_lock, flags);
if (!list_empty(&audit_freelist)) {
@@ -1065,7 +1064,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
if (!ab->skb)
goto nlmsg_failure;
- nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
+ NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
return ab;
--
1.7.1.rc1.21.gf3bd6
14 years, 6 months
Re: [PATCH 2/6]kernel:audit.c Fix warning: variable 'nlh' set but not used
by Justin P. Mattock
>
> This is not dead code. NLMSG_NEW() sets up an nlmsg in ab->skb.
> If you remove the code, it's no longer initialized.
I played around with this code some more, but am still getting confused
with nlmsg_new and NLMSG_NEW. if I remove the nlmsghdr struct I can get
a clean build without a warning, but still am a bit confused.
here is an updated patch let me know if it still needs work..
or if it's legit I can resend this.
From 7515a08ba921d3beed33fa5c6b1fbe59cf52e069 Mon Sep 17 00:00:00 2001
From: Justin P. Mattock <justinmattock(a)gmail.com>
Date: Fri, 18 Jun 2010 19:44:30 -0700
Subject: [PATCH 4/4] audit
Signed-off-by: Justin P. Mattock <justinmattock(a)gmail.com>
---
kernel/audit.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index c71bd26..1d51258 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1041,7 +1041,6 @@ static struct audit_buffer *
audit_buffer_alloc(struct audit_context *ctx,
{
unsigned long flags;
struct audit_buffer *ab = NULL;
- struct nlmsghdr *nlh;
spin_lock_irqsave(&audit_freelist_lock, flags);
if (!list_empty(&audit_freelist)) {
@@ -1065,7 +1064,7 @@ static struct audit_buffer *
audit_buffer_alloc(struct audit_context *ctx,
if (!ab->skb)
goto nlmsg_failure;
- nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
+ NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
return ab;
--
1.7.1.rc1.21.gf3bd6
Justin P. Mattock
14 years, 6 months
audit compilation : I miss audit_tty_status
by Eric Durand
Hello,
during the configure. I have the following error that I guess prevent me to
get the pam_audit_tty feature:
checking for struct audit_tty_status... no
#uname -a
Linux lfslc5 2.6.18.8-xenU-64b #1 SMP Tue May 6 18:09:10 CEST 2008 x86_64
x86_64 x86_64 GNU/Linux
Is anybody can tell me what's miss ?
Regards
F
14 years, 6 months
Re: [PATCH 1/6]scripts:conf.c Fix warning: variable 'type' set but not used
by Justin P. Mattock
On 06/11/2010 03:19 PM, Michal Marek wrote:
> On 11.6.2010 22:41, Justin P. Mattock wrote:
>> Not sure if this is correct or not, but with
>> make menuconfig
>> HOSTCC scripts/kconfig/conf.o
>> scripts/kconfig/conf.c: In function 'conf_sym':
>> scripts/kconfig/conf.c:159:6: warning: variable 'type' set but not used
>> scripts/kconfig/conf.c: In function 'conf_choice':
>> scripts/kconfig/conf.c:231:6: warning: variable 'type' set but not used
>> HOSTLD scripts/kconfig/mconf
>>
>> I get this using gcc 4.6.0 the below change fixes this form me.
>> please have a look and let me know.
>>
>> Signed-off-by: Justin P. Mattock<justinmattock(a)gmail.com>
>
> Thanks, applied.
>
> Michal
>
o.k...
Justin P. Mattock
14 years, 6 months
Re: [PATCH 5/6]kernel:module.c variable 'nowarn' set but not used
by Justin P. Mattock
On 06/11/2010 02:17 PM, Geert Uytterhoeven wrote:
> On Fri, Jun 11, 2010 at 22:41, Justin P. Mattock
> <justinmattock(a)gmail.com> wrote:
>> The below patch fixes a warning message
>> reported by gcc 4.6.0.
>>
>> CC kernel/module.o
>> kernel/module.c: In function 'add_usage_links':
>> kernel/module.c:1343:6: warning: variable 'nowarn' set but not used
>>
>> Signed-off-by: Justin P. Mattock<justinmattock(a)gmail.com>
>>
>> ---
>> kernel/module.c | 8 ++------
>> 1 files changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 8c6b428..a71027a 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -1340,13 +1340,9 @@ static void add_usage_links(struct module *mod)
>> {
>> #ifdef CONFIG_MODULE_UNLOAD
>> struct module_use *use;
>> - int nowarn;
>> -
>> +
>> mutex_lock(&module_mutex);
>> - list_for_each_entry(use,&mod->target_list, target_list) {
>> - nowarn = sysfs_create_link(use->target->holders_dir,
>> -&mod->mkobj.kobj, mod->name);
>> - }
>> + list_for_each_entry(use,&mod->target_list, target_list);
>> mutex_unlock(&module_mutex);
>> #endif
>> }
>
> Also wrong, you removed the creation of the links in sysfs.
>
that's not good..
> The assignment to nowarn was there to avoid another compiler warning,
> as sysfs_create_link() is marked __must_check.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert(a)linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
alright.. thanks for having a look
and a response. if somebody has a fix
for this then let me know, and I can
test it out over here(I can also try
fixing this as well, but my knowledge
of code only goes so far)..
Justin P. Mattock
14 years, 6 months
Re: [PATCH 2/6]kernel:audit.c Fix warning: variable 'nlh' set but not used
by Justin P. Mattock
On 06/11/2010 02:14 PM, Geert Uytterhoeven wrote:
> On Fri, Jun 11, 2010 at 22:41, Justin P. Mattock
> <justinmattock(a)gmail.com> wrote:
>> Removing dead code(hopefully), fixes a warning
>
> This is not dead code. NLMSG_NEW() sets up an nlmsg in ab->skb.
> If you remove the code, it's no longer initialized.
>
o.k... this one did confuse me a bit, so at the end
I just sent in this one which does remove the function
but does not fix the warning of nlh not being used
>> when compiling the kernel.
>>
>> CC kernel/audit.o
>> kernel/audit.c: In function 'audit_buffer_alloc':
>> kernel/audit.c:1044:19: warning: variable 'nlh' set but not used
>> CC kernel/auditfilter.o
>>
>> Signed-off-by: Justin P. Mattock<justinmattock(a)gmail.com>
>>
>> ---
>> kernel/audit.c | 6 ++----
>> 1 files changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/audit.c b/kernel/audit.c
>> index c71bd26..783d958 100644
>> --- a/kernel/audit.c
>> +++ b/kernel/audit.c
>> @@ -1041,8 +1041,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
>> {
>> unsigned long flags;
>> struct audit_buffer *ab = NULL;
>> - struct nlmsghdr *nlh;
>> -
>> +
>> spin_lock_irqsave(&audit_freelist_lock, flags);
>> if (!list_empty(&audit_freelist)) {
>> ab = list_entry(audit_freelist.next,
>> @@ -1065,8 +1064,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
>> if (!ab->skb)
>> goto nlmsg_failure;
>>
>> - nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
>> -
>> +
>> return ab;
>>
>> nlmsg_failure: /* Used by NLMSG_NEW */
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert(a)linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
if you have any ideas/patches then let me know
I can test it out and see.
Justin P. Mattock
14 years, 6 months