]> git.baikalelectronics.ru Git - kernel.git/commit
ima: open a new file instance if no read permissions
authorGoldwyn Rodrigues <rgoldwyn@suse.de>
Tue, 9 Oct 2018 15:12:33 +0000 (10:12 -0500)
committerMimi Zohar <zohar@linux.ibm.com>
Wed, 10 Oct 2018 19:18:00 +0000 (15:18 -0400)
commita3b443941bdc8918eb162a55de9b7d0ec8177f0a
tree7c801d1417656f68fd2c6ee70a01cf34ba389eb7
parent474fb8c083de7965f9a1e0d9f1656e8992dc8aa1
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: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: stable@vger.kernel.org (linux-4.19)
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/ima/ima_crypto.c