mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
ima: relax requiring a file signature for new files with zero length
[ Upstream commitb7e27bc1d4] Custom policies can require file signatures based on LSM labels. These files are normally created and only afterwards labeled, requiring them to be signed. Instead of requiring file signatures based on LSM labels, entire filesystems could require file signatures. In this case, we need the ability of writing new files without requiring file signatures. The definition of a "new" file was originally defined as any file with a length of zero. Subsequent patches redefined a "new" file to be based on the FILE_CREATE open flag. By combining the open flag with a file size of zero, this patch relaxes the file signature requirement. Fixes:1ac202e978ima: accept previously set IMA_NEW_FILE Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
be272b01f8
commit
76bda31c54
|
|
@ -206,7 +206,8 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint,
|
|||
if (opened & FILE_CREATED)
|
||||
iint->flags |= IMA_NEW_FILE;
|
||||
if ((iint->flags & IMA_NEW_FILE) &&
|
||||
!(iint->flags & IMA_DIGSIG_REQUIRED))
|
||||
(!(iint->flags & IMA_DIGSIG_REQUIRED) ||
|
||||
(inode->i_size == 0)))
|
||||
status = INTEGRITY_PASS;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user