Skip to content
Snippets Groups Projects
Commit 67ab712f authored by Cui GaoSheng's avatar Cui GaoSheng Committed by Yang Yingliang
Browse files

audit: bugfix for infinite loop when flush the hold queue

hulk inclusion
category: bugfix
bugzilla: 186105, https://gitee.com/openeuler/kernel/issues/I4RGWS?from=project-issue


CVE: NA

-----------------------------------------------------------------

When we add "audit=1" to the cmdline, if we keep the audit_hold_queue
non-empty, flush the hold queue will fall into an infinite loop. So we
need to fix it by stoping flush the hold queue when netlink abnormal.

Fixes: 3413ddc9 ("audit: improve robustness of the audit queue handling")
Signed-off-by: default avatarCui GaoSheng <cuigaosheng1@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: default avatarweiyang wang <wangweiyang2@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent a17cb07b
No related branches found
No related tags found
No related merge requests found
......@@ -740,6 +740,8 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
if (!sk) {
if (err_hook)
(*err_hook)(skb);
if (queue == &audit_hold_queue)
goto out;
continue;
}
......@@ -756,6 +758,8 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
(*err_hook)(skb);
if (rc == -EAGAIN)
rc = 0;
if (queue == &audit_hold_queue)
goto out;
/* continue to drain the queue */
continue;
} else
......@@ -767,6 +771,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
}
}
out:
return (rc >= 0 ? 0 : rc);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment