projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'fsnotify_for_v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git]
/
kernel
/
audit_tree.c
diff --git
a/kernel/audit_tree.c
b/kernel/audit_tree.c
index
c99ebaa
..
ea43181
100644
(file)
--- a/
kernel/audit_tree.c
+++ b/
kernel/audit_tree.c
@@
-168,7
+168,8
@@
static __cacheline_aligned_in_smp DEFINE_SPINLOCK(hash_lock);
/* Function to return search key in our hash from inode. */
static unsigned long inode_to_key(const struct inode *inode)
{
/* Function to return search key in our hash from inode. */
static unsigned long inode_to_key(const struct inode *inode)
{
- return (unsigned long)inode;
+ /* Use address pointed to by connector->obj as the key */
+ return (unsigned long)&inode->i_fsnotify_marks;
}
/*
}
/*
@@
-183,7
+184,7
@@
static unsigned long chunk_to_key(struct audit_chunk *chunk)
*/
if (WARN_ON_ONCE(!chunk->mark.connector))
return 0;
*/
if (WARN_ON_ONCE(!chunk->mark.connector))
return 0;
- return (unsigned long)chunk->mark.connector->
inode
;
+ return (unsigned long)chunk->mark.connector->
obj
;
}
static inline struct list_head *chunk_hash(unsigned long key)
}
static inline struct list_head *chunk_hash(unsigned long key)
@@
-258,7
+259,7
@@
static void untag_chunk(struct node *p)
spin_lock(&entry->lock);
/*
* mark_mutex protects mark from getting detached and thus also from
spin_lock(&entry->lock);
/*
* mark_mutex protects mark from getting detached and thus also from
- * mark->connector->
inode
getting NULL.
+ * mark->connector->
obj
getting NULL.
*/
if (chunk->dead || !(entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
spin_unlock(&entry->lock);
*/
if (chunk->dead || !(entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
spin_unlock(&entry->lock);
@@
-288,8
+289,8
@@
static void untag_chunk(struct node *p)
if (!new)
goto Fallback;
if (!new)
goto Fallback;
- if (fsnotify_add_
inode_mark_locked(&new->mark, entry->connector->inode
,
-
1)) {
+ if (fsnotify_add_
mark_locked(&new->mark, entry->connector->obj
,
+
FSNOTIFY_OBJ_TYPE_INODE,
1)) {
fsnotify_put_mark(&new->mark);
goto Fallback;
}
fsnotify_put_mark(&new->mark);
goto Fallback;
}
@@
-423,7
+424,7
@@
static int tag_chunk(struct inode *inode, struct audit_tree *tree)
spin_lock(&old_entry->lock);
/*
* mark_mutex protects mark from getting detached and thus also from
spin_lock(&old_entry->lock);
/*
* mark_mutex protects mark from getting detached and thus also from
- * mark->connector->
inode
getting NULL.
+ * mark->connector->
obj
getting NULL.
*/
if (!(old_entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
/* old_entry is being shot, lets just lie */
*/
if (!(old_entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
/* old_entry is being shot, lets just lie */
@@
-434,8
+435,8
@@
static int tag_chunk(struct inode *inode, struct audit_tree *tree)
return -ENOENT;
}
return -ENOENT;
}
- if (fsnotify_add_
inode_mark_locked(chunk_entry
,
-
old_entry->connector->inode
, 1)) {
+ if (fsnotify_add_
mark_locked(chunk_entry, old_entry->connector->obj
,
+
FSNOTIFY_OBJ_TYPE_INODE
, 1)) {
spin_unlock(&old_entry->lock);
mutex_unlock(&old_entry->group->mark_mutex);
fsnotify_put_mark(chunk_entry);
spin_unlock(&old_entry->lock);
mutex_unlock(&old_entry->group->mark_mutex);
fsnotify_put_mark(chunk_entry);
@@
-497,6
+498,8
@@
static void audit_tree_log_remove_rule(struct audit_krule *rule)
{
struct audit_buffer *ab;
{
struct audit_buffer *ab;
+ if (!audit_enabled)
+ return;
ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
if (unlikely(!ab))
return;
ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
if (unlikely(!ab))
return;