]> git.hungrycats.org Git - linux/commit
ima: provide flag to identify new empty files
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Fri, 27 Jun 2014 15:04:27 +0000 (18:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:43:16 +0000 (09:43 -0700)
commitf072a54f6892b611e592fbd87d7871deb04a9db4
tree29d302662fc7f54f3b874084eb228320db2fd44e
parent90c62d0e9cc95caa56c4c78f310edac6789974c5
ima: provide flag to identify new empty files

commit b151d6b00bbb798c58f2f21305e7d43fa763f34f upstream.

On ima_file_free(), newly created empty files are not labeled with
an initial security.ima value, because the iversion did not change.
Commit dff6efc "fs: fix iversion handling" introduced a change in
iversion behavior.  To verify this change use the shell command:

  $ (exec >foo)
  $ getfattr -h -e hex -d -m security foo

This patch defines the IMA_NEW_FILE flag.  The flag is initially
set, when IMA detects that a new file is created, and subsequently
checked on the ima_file_free() hook to set the initial security.ima
value.

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/integrity/ima/ima_appraise.c
security/integrity/ima/ima_main.c
security/integrity/integrity.h