From: Al Viro <viro@ZenIV.linux.org.uk>
To: "J. R. Okajima" <hooanon05g@gmail.com>
Cc: Dmitry Kasatkin <d.kasatkin@samsung.com>,
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, 9 May 2014 18:56:02 +0100 [thread overview]
Message-ID: <20140509175602.GA18016@ZenIV.linux.org.uk> (raw)
In-Reply-To: <29977.1399605003@jrobl>
On Fri, May 09, 2014 at 12:10:03PM +0900, 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.
> How can we stop reading the file from IMA?
Disabling it would be a good start... And no, I'm not kidding - the mess
you are proposing is such that it's not at all obvious that this stuff
is worth the trouble.
Why the devil is it playing with ->i_mutex? IMA, that is. Its use for
data is absolutely fs-dependent. Again, filesystem is *NOT* required
to take ->i_mutex anywhere on the write path. At all.
next prev parent reply other threads:[~2014-05-09 17:56 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
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 [this message]
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=20140509175602.GA18016@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.