From: Dmitry Kasatkin <d.kasatkin@samsung.com>
To: "J. R. Okajima" <hooanon05g@gmail.com>
Cc: viro@zeniv.linux.org.uk, ebiederm@xmission.com,
linux-security-module@vger.kernel.org, eparis@redhat.com,
zohar@linux.vnet.ibm.com, dmitry.kasatkin@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: IMA + O_DIRECT (Re: [PATCH 0/1] fix IMA + Apparmor kernel panic)
Date: Fri, 09 May 2014 11:14:28 +0300 [thread overview]
Message-ID: <536C8E64.6000009@samsung.com> (raw)
In-Reply-To: <29977.1399605003@jrobl>
On 09/05/14 06:10, J. R. Okajima wrote:
> Dmitry Kasatkin:
>> Following patch replaces IMA usage of kernel_read() with special
>> version which skips security check that triggers kernel panic
>> when Apparmor and IMA appraisal are enabled together.
> I know this is related to exit(2), but this behaviour of IMA is related
> to open(2) too.
> When O_DIRECT is specified, some filesystems (for example, ext2) call
> do_blockdev_direct_IO() which acquires i_mutex. But
> IMA:process_measurement() already acquires i_mutex before kernel_read().
> It causes a deadlock even if you replace kernel_read() by a simpler one.
Hi,
It is a different issue.
I made patch more than a year ago which fix the problem
https://lkml.org/lkml/2013/2/20/601
I think we had to declare the purpose of the patch in a bit different way.
IMA really does not need direct-io, and can temporarily drop the flag.
As side affect, it would fix the deadlock problem
But I have a different patch now. I will post it today.
> How can we stop reading the file from IMA?
It is actually very interesting question...
1) if you would like to use IMA without it reading a file, then I think
I must disappoint you.
It is not possible.. IMA needs reading a file.
2) if you do not use IMA, then there is no problem for you, because IMA
will not read file if it is not used...
Have a nice day.
- Dmitry
>
> J. R. Okajima
>
next prev parent reply other threads:[~2014-05-09 8:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 13:16 [PATCH 0/1] fix IMA + Apparmor kernel panic Dmitry Kasatkin
2014-05-08 13:16 ` [PATCH 1/1] ima: introduce ima_kernel_read() Dmitry Kasatkin
2014-05-13 18:01 ` Mimi Zohar
2014-05-09 3:10 ` IMA + O_DIRECT (Re: [PATCH 0/1] fix IMA + Apparmor kernel panic) J. R. Okajima
2014-05-09 8:14 ` Dmitry Kasatkin [this message]
2014-05-09 9:17 ` J. R. Okajima
2014-05-09 14:58 ` Mimi Zohar
2014-05-09 16:01 ` J. R. Okajima
2014-05-09 16:15 ` J. R. Okajima
2014-05-09 19:44 ` Mimi Zohar
2014-05-09 20:07 ` J. R. Okajima
2014-05-10 17:30 ` Dmitry Kasatkin
2014-05-09 17:56 ` Al Viro
2014-05-09 18:28 ` Mimi Zohar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=536C8E64.6000009@samsung.com \
--to=d.kasatkin@samsung.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=ebiederm@xmission.com \
--cc=eparis@redhat.com \
--cc=hooanon05g@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).