]> git.baikalelectronics.ru Git - kernel.git/commit
ima: fix ima_d_path() possible race with rename
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Tue, 17 Jan 2017 11:45:41 +0000 (06:45 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Fri, 27 Jan 2017 19:16:02 +0000 (14:16 -0500)
commit22d7c98fc6961c619c29f6c66ecae57f705a0492
tree7ab298e6fac6256585436cd3f78b8b1fa36daa02
parentb190259c9aba342a6f4ba038e45f05f91f9e2442
ima: fix ima_d_path() possible race with rename

On failure to return a pathname from ima_d_path(), a pointer to
dname is returned, which is subsequently used in the IMA measurement
list, the IMA audit records, and other audit logging.  Saving the
pointer to dname for later use has the potential to race with rename.

Intead of returning a pointer to dname on failure, this patch returns
a pointer to a copy of the filename.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
security/integrity/ima/ima.h
security/integrity/ima/ima_api.c
security/integrity/ima/ima_main.c