summaryrefslogtreecommitdiffstats
path: root/kernel/audit_watch.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-04-26 20:09:49 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2019-04-26 20:09:49 +0200
commit6921d4ebe418e7cce9f65c1f38c93ea82a1f546c (patch)
tree23555d96ba79388c2ac2935e8da5b928d78ade97 /kernel/audit_watch.c
parentinotify_handle_event(): don't bother with strlen() (diff)
downloadlinux-6921d4ebe418e7cce9f65c1f38c93ea82a1f546c.tar.xz
linux-6921d4ebe418e7cce9f65c1f38c93ea82a1f546c.zip
audit_update_watch(): switch to const struct qstr *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/audit_watch.c')
-rw-r--r--kernel/audit_watch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index 3c12fd5b680e..d832ce9df065 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -255,18 +255,19 @@ static void audit_watch_log_rule_change(struct audit_krule *r, struct audit_watc
/* Update inode info in audit rules based on filesystem event. */
static void audit_update_watch(struct audit_parent *parent,
- const char *dname, dev_t dev,
+ const struct qstr *dname, dev_t dev,
unsigned long ino, unsigned invalidating)
{
struct audit_watch *owatch, *nwatch, *nextw;
struct audit_krule *r, *nextr;
struct audit_entry *oentry, *nentry;
+ const unsigned char *name = dname->name;
mutex_lock(&audit_filter_mutex);
/* Run all of the watches on this parent looking for the one that
* matches the given dname */
list_for_each_entry_safe(owatch, nextw, &parent->watches, wlist) {
- if (audit_compare_dname_path(dname, owatch->path,
+ if (audit_compare_dname_path(name, owatch->path,
AUDIT_NAME_FULL))
continue;
@@ -507,9 +508,9 @@ static int audit_watch_handle_event(struct fsnotify_group *group,
}
if (mask & (FS_CREATE|FS_MOVED_TO) && inode)
- audit_update_watch(parent, dname->name, inode->i_sb->s_dev, inode->i_ino, 0);
+ audit_update_watch(parent, dname, inode->i_sb->s_dev, inode->i_ino, 0);
else if (mask & (FS_DELETE|FS_MOVED_FROM))
- audit_update_watch(parent, dname->name, AUDIT_DEV_UNSET, AUDIT_INO_UNSET, 1);
+ audit_update_watch(parent, dname, AUDIT_DEV_UNSET, AUDIT_INO_UNSET, 1);
else if (mask & (FS_DELETE_SELF|FS_UNMOUNT|FS_MOVE_SELF))
audit_remove_parent_watches(parent);