public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. R. Okajima" <hooanon05g@gmail.com>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Dmitry Kasatkin <d.kasatkin@samsung.com>,
	viro@zeniv.linux.org.uk, ebiederm@xmission.com,
	linux-security-module@vger.kernel.org, eparis@redhat.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: Sat, 10 May 2014 01:01:27 +0900	[thread overview]
Message-ID: <18674.1399651287@jrobl> (raw)
In-Reply-To: <1399647534.2232.8.camel@dhcp-9-2-203-236.watson.ibm.com>


Mimi Zohar:
> Another approach was posted here
> http://marc.info/?l=linux-security-module&m=138919062430367&w=2 which
> also was not upstreamed.

It might be better a little than previous one which handles the flag
temporarily. But, in order to make the code cleaner particulary for
do_blockdev_direct_IO(), I'd suggest
- make two new static inline functions like
  r = ima_aware_file_inode_mutex_lock(file) and ..._unlock(r, file).
- these new functions are complied when CONFIG_IMA is enabled, otherwise
  they are plain mutex_lock/unlock().
- then do_blockdev_direct_IO() can call them blindly.
- of course, O_DIRECT_HAVELOCK should be complied only when CONFIG_IMA
  is enabled too.

I can guess that several people thinks that is still "ugly locking", but
the deadlock is much ugly in real world. And we need some workaround for
it.


J. R. Okajima

  reply	other threads:[~2014-05-09 16:01 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 [this message]
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=18674.1399651287@jrobl \
    --to=hooanon05g@gmail.com \
    --cc=d.kasatkin@samsung.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=eparis@redhat.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