linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dmitry Kasatkin <d.kasatkin@samsung.com>
Cc: linux-security-module <linux-security-module@vger.kernel.org>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: IMA & truncate
Date: Tue, 6 May 2014 17:59:02 +0100	[thread overview]
Message-ID: <20140506165901.GS18016@ZenIV.linux.org.uk> (raw)
In-Reply-To: <5368E46B.9050708@samsung.com>

On Tue, May 06, 2014 at 04:32:27PM +0300, Dmitry Kasatkin wrote:
> Hi,
> 
> I have discovered one IMA related issue.
> 
> IMA file hash is re-calculate if needed on file close.
> 
> It works with ftruncate(fd, length) syscall, because it operates on
> "opened" file.
> Recalculation is happening on file close.
> 
> truncate(path, length) syscall works with path and no file open/close
> takes place.
> Recalculation does not happen.
> IMA denies file access later.
> 
> It looks like vfs_truncate() should possibly call IMA to recalculate the
> hash.

Who said that it has permissions to read the file?  Reread truncate(2)
manpage; it requires the file to be *writable* for caller, but it doesn't
need it to be readable.

  parent reply	other threads:[~2014-05-06 16:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06 13:32 IMA & truncate Dmitry Kasatkin
2014-05-06 13:47 ` Javier González
2014-05-06 16:59 ` Al Viro [this message]
2014-05-06 18:39   ` Mimi Zohar
2014-05-06 19:11     ` Al Viro
2014-05-07  5:46       ` Dmitry Kasatkin
2014-05-07  5:45   ` Dmitry Kasatkin

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=20140506165901.GS18016@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=d.kasatkin@samsung.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 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).