Re: [PATCH 05/35] audit_tree: Use mark flags to check whether mark is alive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 3, 2017 at 11:33 AM, Jan Kara <jack@xxxxxxx> wrote:
> Currently audit code uses checking of mark->inode to verify whether mark
> is still alive. Switch that to checking mark flags as that is more
> logical and current way will become unreliable in future.
>
> Reviewed-by: Miklos Szeredi <mszeredi@xxxxxxxxxx>
> Signed-off-by: Jan Kara <jack@xxxxxxx>
> ---
>  kernel/audit_tree.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Should audit_tree.c:insert_hash() also be updated in a similar manner?

> diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
> index 11c7ac441624..f12bd40fb8f1 100644
> --- a/kernel/audit_tree.c
> +++ b/kernel/audit_tree.c
> @@ -248,7 +248,7 @@ static void untag_chunk(struct node *p)
>
>         mutex_lock(&entry->group->mark_mutex);
>         spin_lock(&entry->lock);
> -       if (chunk->dead || !entry->inode) {
> +       if (chunk->dead || !(entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
>                 spin_unlock(&entry->lock);
>                 mutex_unlock(&entry->group->mark_mutex);
>                 if (new)
> @@ -408,7 +408,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
>
>         mutex_lock(&old_entry->group->mark_mutex);
>         spin_lock(&old_entry->lock);
> -       if (!old_entry->inode) {
> +       if (!(old_entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
>                 /* old_entry is being shot, lets just lie */
>                 spin_unlock(&old_entry->lock);
>                 mutex_unlock(&old_entry->group->mark_mutex);
> --
> 2.10.2
>

-- 
paul moore
www.paul-moore.com



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux