]> git.baikalelectronics.ru Git - kernel.git/commit
Smack: Rework file hooks
authorCasey Schaufler <casey@schaufler-ca.com>
Sat, 13 Dec 2014 01:19:19 +0000 (17:19 -0800)
committerCasey Schaufler <casey@schaufler-ca.com>
Wed, 21 Jan 2015 00:32:17 +0000 (16:32 -0800)
commit560b79da6bf8e11a3960cc9362335e8719dd7b3f
tree586640992a1e76584e85a73f6651c018dffc8843
parent4ed48ab3f76c4aefdfb8c372faa7f218f118f280
Smack: Rework file hooks

This is one of those cases where you look at code you did
years ago and wonder what you might have been thinking.
There are a number of LSM hooks that work off of file pointers,
and most of them really want the security data from the inode.
Some, however, really want the security context that the process
had when the file was opened. The difference went undetected in
Smack until it started getting used in a real system with real
testing. At that point it was clear that something was amiss.

This patch corrects the misuse of the f_security value in several
of the hooks. The behavior will not usually be any different, as
the process had to be able to open the file in the first place, and
the old check almost always succeeded, as will the new, but for
different reasons.

Thanks to the Samsung Tizen development team that identified this.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
security/smack/smack_lsm.c