Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ima: Don't modify file descriptor mode on the fly
Commit a408e4a ("ima: open a new file instance if no read permissions") already introduced a second open to measure a file when the original file descriptor does not allow it. However, it didn't remove the existing method of changing the mode of the original file descriptor, which is still necessary if the current process does not have enough privileges to open a new one. Changing the mode isn't really an option, as the filesystem might need to do preliminary steps to make the read possible. Thus, this patch removes the code and keeps the second open as the only option to measure a file when it is unreadable with the original file descriptor. Cc: <[email protected]> # 4.20.x: 0014cc0 ima: Set file->f_mode Fixes: 2fe5d6d ("ima: integrity appraisal extension") Signed-off-by: Roberto Sassu <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
- Loading branch information