diff options
| -rw-r--r-- | kernel/audit.h | 2 | ||||
| -rw-r--r-- | kernel/audit_fsnotify.c | 2 | ||||
| -rw-r--r-- | kernel/audit_watch.c | 3 | ||||
| -rw-r--r-- | kernel/auditfilter.c | 6 | ||||
| -rw-r--r-- | kernel/auditsc.c | 4 |
5 files changed, 8 insertions, 9 deletions
diff --git a/kernel/audit.h b/kernel/audit.h index 958d5b8fc1b3..2071725a999f 100644 --- a/kernel/audit.h +++ b/kernel/audit.h | |||
| @@ -231,7 +231,7 @@ extern int audit_comparator(const u32 left, const u32 op, const u32 right); | |||
| 231 | extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right); | 231 | extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right); |
| 232 | extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t right); | 232 | extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t right); |
| 233 | extern int parent_len(const char *path); | 233 | extern int parent_len(const char *path); |
| 234 | extern int audit_compare_dname_path(const char *dname, const char *path, int plen); | 234 | extern int audit_compare_dname_path(const struct qstr *dname, const char *path, int plen); |
| 235 | extern struct sk_buff *audit_make_reply(int seq, int type, int done, int multi, | 235 | extern struct sk_buff *audit_make_reply(int seq, int type, int done, int multi, |
| 236 | const void *payload, int size); | 236 | const void *payload, int size); |
| 237 | extern void audit_panic(const char *message); | 237 | extern void audit_panic(const char *message); |
diff --git a/kernel/audit_fsnotify.c b/kernel/audit_fsnotify.c index fb241805569c..b5737b826951 100644 --- a/kernel/audit_fsnotify.c +++ b/kernel/audit_fsnotify.c | |||
| @@ -188,7 +188,7 @@ static int audit_mark_handle_event(struct fsnotify_group *group, | |||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | if (mask & (FS_CREATE|FS_MOVED_TO|FS_DELETE|FS_MOVED_FROM)) { | 190 | if (mask & (FS_CREATE|FS_MOVED_TO|FS_DELETE|FS_MOVED_FROM)) { |
| 191 | if (audit_compare_dname_path(dname->name, audit_mark->path, AUDIT_NAME_FULL)) | 191 | if (audit_compare_dname_path(dname, audit_mark->path, AUDIT_NAME_FULL)) |
| 192 | return 0; | 192 | return 0; |
| 193 | audit_update_mark(audit_mark, inode); | 193 | audit_update_mark(audit_mark, inode); |
| 194 | } else if (mask & (FS_DELETE_SELF|FS_UNMOUNT|FS_MOVE_SELF)) | 194 | } else if (mask & (FS_DELETE_SELF|FS_UNMOUNT|FS_MOVE_SELF)) |
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index d832ce9df065..b50c574223fa 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c | |||
| @@ -261,13 +261,12 @@ static void audit_update_watch(struct audit_parent *parent, | |||
| 261 | struct audit_watch *owatch, *nwatch, *nextw; | 261 | struct audit_watch *owatch, *nwatch, *nextw; |
| 262 | struct audit_krule *r, *nextr; | 262 | struct audit_krule *r, *nextr; |
| 263 | struct audit_entry *oentry, *nentry; | 263 | struct audit_entry *oentry, *nentry; |
| 264 | const unsigned char *name = dname->name; | ||
| 265 | 264 | ||
| 266 | mutex_lock(&audit_filter_mutex); | 265 | mutex_lock(&audit_filter_mutex); |
| 267 | /* Run all of the watches on this parent looking for the one that | 266 | /* Run all of the watches on this parent looking for the one that |
| 268 | * matches the given dname */ | 267 | * matches the given dname */ |
| 269 | list_for_each_entry_safe(owatch, nextw, &parent->watches, wlist) { | 268 | list_for_each_entry_safe(owatch, nextw, &parent->watches, wlist) { |
| 270 | if (audit_compare_dname_path(name, owatch->path, | 269 | if (audit_compare_dname_path(dname, owatch->path, |
| 271 | AUDIT_NAME_FULL)) | 270 | AUDIT_NAME_FULL)) |
| 272 | continue; | 271 | continue; |
| 273 | 272 | ||
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 63f8b3f26fab..f9fff93c3351 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
| @@ -1290,12 +1290,12 @@ int parent_len(const char *path) | |||
| 1290 | * @parentlen: length of the parent if known. Passing in AUDIT_NAME_FULL | 1290 | * @parentlen: length of the parent if known. Passing in AUDIT_NAME_FULL |
| 1291 | * here indicates that we must compute this value. | 1291 | * here indicates that we must compute this value. |
| 1292 | */ | 1292 | */ |
| 1293 | int audit_compare_dname_path(const char *dname, const char *path, int parentlen) | 1293 | int audit_compare_dname_path(const struct qstr *dname, const char *path, int parentlen) |
| 1294 | { | 1294 | { |
| 1295 | int dlen, pathlen; | 1295 | int dlen, pathlen; |
| 1296 | const char *p; | 1296 | const char *p; |
| 1297 | 1297 | ||
| 1298 | dlen = strlen(dname); | 1298 | dlen = dname->len; |
| 1299 | pathlen = strlen(path); | 1299 | pathlen = strlen(path); |
| 1300 | if (pathlen < dlen) | 1300 | if (pathlen < dlen) |
| 1301 | return 1; | 1301 | return 1; |
| @@ -1306,7 +1306,7 @@ int audit_compare_dname_path(const char *dname, const char *path, int parentlen) | |||
| 1306 | 1306 | ||
| 1307 | p = path + parentlen; | 1307 | p = path + parentlen; |
| 1308 | 1308 | ||
| 1309 | return strncmp(p, dname, dlen); | 1309 | return strncmp(p, dname->name, dlen); |
| 1310 | } | 1310 | } |
| 1311 | 1311 | ||
| 1312 | int audit_filter(int msgtype, unsigned int listtype) | 1312 | int audit_filter(int msgtype, unsigned int listtype) |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index d1eab1d4a930..92d0ae63febd 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
| @@ -2045,7 +2045,7 @@ void __audit_inode_child(struct inode *parent, | |||
| 2045 | { | 2045 | { |
| 2046 | struct audit_context *context = audit_context(); | 2046 | struct audit_context *context = audit_context(); |
| 2047 | struct inode *inode = d_backing_inode(dentry); | 2047 | struct inode *inode = d_backing_inode(dentry); |
| 2048 | const char *dname = dentry->d_name.name; | 2048 | const struct qstr *dname = &dentry->d_name; |
| 2049 | struct audit_names *n, *found_parent = NULL, *found_child = NULL; | 2049 | struct audit_names *n, *found_parent = NULL, *found_child = NULL; |
| 2050 | struct audit_entry *e; | 2050 | struct audit_entry *e; |
| 2051 | struct list_head *list = &audit_filter_list[AUDIT_FILTER_FS]; | 2051 | struct list_head *list = &audit_filter_list[AUDIT_FILTER_FS]; |
| @@ -2099,7 +2099,7 @@ void __audit_inode_child(struct inode *parent, | |||
| 2099 | (n->type != type && n->type != AUDIT_TYPE_UNKNOWN)) | 2099 | (n->type != type && n->type != AUDIT_TYPE_UNKNOWN)) |
| 2100 | continue; | 2100 | continue; |
| 2101 | 2101 | ||
| 2102 | if (!strcmp(dname, n->name->name) || | 2102 | if (!strcmp(dname->name, n->name->name) || |
| 2103 | !audit_compare_dname_path(dname, n->name->name, | 2103 | !audit_compare_dname_path(dname, n->name->name, |
| 2104 | found_parent ? | 2104 | found_parent ? |
| 2105 | found_parent->name_len : | 2105 | found_parent->name_len : |
