]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitb03f28e2c3d095e13fa8f9211341ce8611bc3514
treecc241301edb571b6c9481045d86618e03b19b2af
parent103fa02633e910b2b1e970e746a4c04200436dfc
ima: open a new file instance if no read permissions

BugLink: https://bugs.launchpad.net/bugs/1838576
[ Upstream commit a408e4a86b36bf98ad15b9ada531cf0e5118ac67 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
security/integrity/ima/ima_crypto.c