]> err.no Git - linux-2.6/commitdiff
[PATCH] fix audit_init failure path
authorAmy Griffis <amy.griffis@hp.com>
Tue, 7 Mar 2006 03:40:05 +0000 (22:40 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 20 Mar 2006 19:08:55 +0000 (14:08 -0500)
Make audit_init() failure path handle situations where the audit_panic()
action is not AUDIT_FAIL_PANIC (default is AUDIT_FAIL_PRINTK).  Other uses
of audit_sock are not reached unless audit's netlink message handler is
properly registered.  Bug noticed by Peter Staubach.

Signed-off-by: Amy Griffis <amy.griffis@hp.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
kernel/audit.c

index c9345d3e8adacbe29698756d4f4a1636320f5532..04fe2e301b611eb5e7666d8190458f1cf86b1bb5 100644 (file)
@@ -558,8 +558,9 @@ static int __init audit_init(void)
                                           THIS_MODULE);
        if (!audit_sock)
                audit_panic("cannot initialize netlink socket");
+       else
+               audit_sock->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT;
 
-       audit_sock->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT;
        skb_queue_head_init(&audit_skb_queue);
        audit_initialized = 1;
        audit_enabled = audit_default;