Messages in this thread | | | Date | Tue, 6 May 2014 17:59:02 +0100 | From | Al Viro <> | Subject | Re: IMA & truncate |
| |
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.
| |