aboutsummaryrefslogtreecommitdiff
path: root/kernel/audit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 53e987df0..9b7565b0a 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -588,10 +588,19 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type)
{
int err = 0;
+ /*
+ * If 'CONFIG_USER_NS' is not defined, current_user_ns()
+ * is already defined as '&init_user_ns'.
+ * In GCC 6 it makes tautological-compare warning.
+ * So just compare when 'CONFIG_USER_NS' is defined.
+ * - jollaman999 -
+ */
+#ifdef CONFIG_USER_NS
/* Only support the initial namespaces for now. */
if ((current_user_ns() != &init_user_ns) ||
(task_active_pid_ns(current) != &init_pid_ns))
return -EPERM;
+#endif
switch (msg_type) {
case AUDIT_LIST: