]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ima: re-initialize iint->atomic_flags
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Tue, 23 Jan 2018 15:00:41 +0000 (10:00 -0500)
committerSultan Alsawaf <sultan.alsawaf@canonical.com>
Wed, 24 Jul 2019 15:44:54 +0000 (09:44 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836968
commit e2598077dc6a26c9644393e5c21f22a90dbdccdb upstream.

Intermittently security.ima is not being written for new files.  This
patch re-initializes the new slab iint->atomic_flags field before
freeing it.

Fixes: commit 0d73a55208e9 ("ima: re-introduce own integrity cache lock")
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
security/integrity/iint.c

index d726ba23a17881dea99acc0ad0e0dc93144c8ec5..12158e7adbc3decddd8ae04f4c21e5b95ff512c9 100644 (file)
@@ -74,6 +74,7 @@ static void iint_free(struct integrity_iint_cache *iint)
        iint->ima_hash = NULL;
        iint->version = 0;
        iint->flags = 0UL;
+       iint->atomic_flags = 0UL;
        iint->ima_file_status = INTEGRITY_UNKNOWN;
        iint->ima_mmap_status = INTEGRITY_UNKNOWN;
        iint->ima_bprm_status = INTEGRITY_UNKNOWN;