[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] fix audit_init failure path



This bug was pointed out by Peter Staubach in a recent patch review:

Make audit_init() failure path handle situations where audit_panic()
action is not AUDIT_FAIL_PANIC.  Other uses of audit_sock are not
reached unless audit_receive() is properly registered with netlink.

Signed-off-by: Amy Griffis <amy griffis hp com>

diff --git a/kernel/audit.c b/kernel/audit.c
index 4eb97b6..c32b864 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]