Skip to content
Commit a408e4a8 authored by Goldwyn Rodrigues's avatar Goldwyn Rodrigues Committed by Mimi Zohar
Browse files

ima: open a new file instance if no read permissions



Open a new file instance as opposed to changing file->f_mode when
the file is not readable.  This is done to accomodate overlayfs
stacked file operations change.  The real struct file is hidden
behind the overlays struct file.  So, any file->f_mode manipulations are
not reflected on the real struct file.  Open the file again in read mode
if original file cannot be read, read and calculate the hash.

Signed-off-by: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
Cc: stable@vger.kernel.org (linux-4.19)
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 1e4c8daf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment