]> asedeno.scripts.mit.edu Git - linux.git/commit
ima: prevent a file already mmap'ed write to be mmap'ed execute
authorMimi Zohar <zohar@linux.ibm.com>
Tue, 30 Apr 2019 12:34:44 +0000 (08:34 -0400)
committerMimi Zohar <zohar@linux.ibm.com>
Tue, 4 Jun 2019 20:47:30 +0000 (16:47 -0400)
commit2cd4737bc850225de426a8dbee7a7a312a4f5304
tree9cb0e2215945a1bee0ed3cae6494049125eb980d
parent980ef4d22a95a3cd84a9b8ffaa7b81b391d173c6
ima: prevent a file already mmap'ed write to be mmap'ed execute

The kernel calls deny_write_access() to prevent a file already opened
for write from being executed and also prevents files being executed
from being opened for write.  For some reason this does not extend to
files being mmap'ed execute.

From an IMA perspective, measuring/appraising the integrity of a file
being mmap'ed shared execute, without first making sure the file cannot
be modified, makes no sense.  This patch prevents files, in policy,
already mmap'ed shared write, from being mmap'ed execute.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/ima/ima_main.c