提交 833fc48d 编写于 作者: R Richard Guy Briggs 提交者: Paul Moore

audit: skip sessionid sentinel value when auto-incrementing

The value (unsigned int)-1 is used as a sentinel to indicate the
sessionID is unset.  Skip this value when the session_id value wraps.
Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: NPaul Moore <paul@paul-moore.com>
上级 8443075e
......@@ -2025,8 +2025,11 @@ int audit_set_loginuid(kuid_t loginuid)
goto out;
/* are we setting or clearing? */
if (uid_valid(loginuid))
if (uid_valid(loginuid)) {
sessionid = (unsigned int)atomic_inc_return(&session_id);
if (unlikely(sessionid == (unsigned int)-1))
sessionid = (unsigned int)atomic_inc_return(&session_id);
}
task->sessionid = sessionid;
task->loginuid = loginuid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册