psi: make psi_enable static
[linux-2.6-microblaze.git] / kernel / auditsc.c
index 3843495..95ae27e 100644 (file)
@@ -2047,7 +2047,7 @@ void __audit_inode_child(struct inode *parent,
 {
        struct audit_context *context = audit_context();
        struct inode *inode = d_backing_inode(dentry);
-       const char *dname = dentry->d_name.name;
+       const struct qstr *dname = &dentry->d_name;
        struct audit_names *n, *found_parent = NULL, *found_child = NULL;
        struct audit_entry *e;
        struct list_head *list = &audit_filter_list[AUDIT_FILTER_FS];
@@ -2099,7 +2099,7 @@ void __audit_inode_child(struct inode *parent,
                    (n->type != type && n->type != AUDIT_TYPE_UNKNOWN))
                        continue;
 
-               if (!strcmp(dname, n->name->name) ||
+               if (!strcmp(dname->name, n->name->name) ||
                    !audit_compare_dname_path(dname, n->name->name,
                                                found_parent ?
                                                found_parent->name_len :
@@ -2519,6 +2519,28 @@ void __audit_tk_injoffset(struct timespec64 offset)
                  (long long)offset.tv_sec, offset.tv_nsec);
 }
 
+static void audit_log_ntp_val(const struct audit_ntp_data *ad,
+                             const char *op, enum audit_ntp_type type)
+{
+       const struct audit_ntp_val *val = &ad->vals[type];
+
+       if (val->newval == val->oldval)
+               return;
+
+       audit_log(audit_context(), GFP_KERNEL, AUDIT_TIME_ADJNTPVAL,
+                 "op=%s old=%lli new=%lli", op, val->oldval, val->newval);
+}
+
+void __audit_ntp_log(const struct audit_ntp_data *ad)
+{
+       audit_log_ntp_val(ad, "offset", AUDIT_NTP_OFFSET);
+       audit_log_ntp_val(ad, "freq",   AUDIT_NTP_FREQ);
+       audit_log_ntp_val(ad, "status", AUDIT_NTP_STATUS);
+       audit_log_ntp_val(ad, "tai",    AUDIT_NTP_TAI);
+       audit_log_ntp_val(ad, "tick",   AUDIT_NTP_TICK);
+       audit_log_ntp_val(ad, "adjust", AUDIT_NTP_ADJUST);
+}
+
 static void audit_log_task(struct audit_buffer *ab)
 {
        kuid_t auid, uid;