Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 329c49e5 authored by Huang Yiwei's avatar Huang Yiwei
Browse files

audit: fix NULL Pointer dereference at netlink_unicast



Initialize audit_pid and move the position of mutex lock to
prevent sending skb before audit_sock is assigned.

Change-Id: If846ee01133200fe9dc87444449a3b081a8d3032
Signed-off-by: default avatarHuang Yiwei <hyiwei@codeaurora.org>
parent 36dc3fac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -908,9 +908,9 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
			}
			if (audit_enabled != AUDIT_OFF)
				audit_log_config_change("audit_pid", new_pid, audit_pid, 1);
			mutex_lock(&audit_sock_mutex);
			audit_pid = new_pid;
			audit_nlk_portid = NETLINK_CB(skb).portid;
			mutex_lock(&audit_sock_mutex);
			audit_sock = skb->sk;
			mutex_unlock(&audit_sock_mutex);
		}