2011-03-09 14:13:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-07 00:12:08 +02:00
|
|
|
|
2011-03-09 14:13:22 -05:00
|
|
|
|
2012-09-12 20:51:32 +03:00
|
|
|
|
2012-12-05 09:29:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:51:32 +03:00
|
|
|
|
2011-03-09 14:13:22 -05:00
|
|
|
|
2012-12-05 09:29:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ima: audit log files opened with O_DIRECT flag
Files are measured or appraised based on the IMA policy. When a
file, in policy, is opened with the O_DIRECT flag, a deadlock
occurs.
The first attempt at resolving this lockdep temporarily removed the
O_DIRECT flag and restored it, after calculating the hash. The
second attempt introduced the O_DIRECT_HAVELOCK flag. Based on this
flag, do_blockdev_direct_IO() would skip taking the i_mutex a second
time. The third attempt, by Dmitry Kasatkin, resolves the i_mutex
locking issue, by re-introducing the IMA mutex, but uncovered
another problem. Reading a file with O_DIRECT flag set, writes
directly to userspace pages. A second patch allocates a user-space
like memory. This works for all IMA hooks, except ima_file_free(),
which is called on __fput() to recalculate the file hash.
Until this last issue is addressed, do not 'collect' the
measurement for measuring, appraising, or auditing files opened
with the O_DIRECT flag set. Based on policy, permit or deny file
access. This patch defines a new IMA policy rule option named
'permit_directio'. Policy rules could be defined, based on LSM
or other criteria, to permit specific applications to open files
with the O_DIRECT flag set.
Changelog v1:
- permit or deny file access based IMA policy rules
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Acked-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Cc: <stable@vger.kernel.org>
2014-05-12 09:28:11 -04:00
|
|
|
|
2014-06-27 18:04:27 +03:00
|
|
|
|
2012-09-12 20:51:32 +03:00
|
|
|
|
2012-12-03 17:08:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-22 10:39:48 -04:00
|
|
|
|
|
|
|
|
|
2012-12-03 17:08:11 -05:00
|
|
|
|
2014-07-22 10:39:48 -04:00
|
|
|
|
|
|
|
|
|
2012-12-03 17:08:11 -05:00
|
|
|
|
2014-07-22 10:39:48 -04:00
|
|
|
|
|
|
|
|
|
2011-03-09 14:13:22 -05:00
|
|
|
|
2011-03-09 14:28:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-12 11:22:51 +03:00
|
|
|
|
2014-10-28 13:31:22 +02:00
|
|
|
|
2011-03-09 14:28:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 10:43:56 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-12 11:22:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 10:44:04 +03:00
|
|
|
|
2013-04-25 10:43:56 +03:00
|
|
|
|
2011-03-09 14:28:20 -05:00
|
|
|
|
2013-04-25 10:44:04 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-10 16:12:03 +09:00
|
|
|
|
2013-04-25 10:44:04 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-09 14:13:22 -05:00
|
|
|
|
|
|
|
|
|
2013-04-25 10:43:56 +03:00
|
|
|
|
2011-03-09 14:13:22 -05:00
|
|
|
|
|
|
|
|
|
2012-12-05 09:29:09 -05:00
|
|
|
|
2012-12-03 17:08:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-22 10:39:48 -04:00
|
|
|
|
2012-09-21 17:00:43 +03:00
|
|
|
|
2013-04-25 10:44:04 +03:00
|
|
|
|
2011-03-09 14:13:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-17 10:34:33 +10:00
|
|
|
|
2014-11-05 17:01:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-17 17:12:07 +02:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
2013-10-10 15:56:13 +09:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
2014-10-01 21:43:07 +03:00
|
|
|
|
2014-11-26 16:55:00 +02:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|
2012-01-17 17:12:07 +02:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
2013-02-07 00:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-05 17:01:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-18 14:48:02 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|