lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <x49y4wbu54y.fsf@segfault.boston.devel.redhat.com>
Date:	Wed, 02 Jul 2014 11:55:41 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Dmitry Kasatkin <d.kasatkin@...sung.com>
Cc:	linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	akpm@...ux-foundation.org, viro@...IV.linux.org.uk,
	Mimi Zohar <zohar@...ux.vnet.ibm.com>,
	linux-security-module <linux-security-module@...r.kernel.org>,
	Greg KH <gregkh@...uxfoundation.org>,
	Dmitry Kasatkin <dmitry.kasatkin@...il.com>
Subject: Re: IMA: kernel reading files opened with O_DIRECT

Hi, Dmitry,

Dmitry Kasatkin <d.kasatkin@...sung.com> writes:

> Hi,
>
> We are looking for advice on reading files opened for direct_io.

[snip]

> 2. Temporarily clear O_DIRECT in file->f_flags.

[snip]

> 3. Open another instance of the file with 'dentry_open'

[snip]

> Is temporarily clearing O_DIRECT flag really unacceptable or not?

It's acceptable.  However, what you're proposing to do is read the
entire file into the page cache to calculate your checksum.  Then, when
the application goes to read the file using O_DIRECT, it will ignore the
cached copy and re-read the portions of the file it wants from disk.  So
yes, you can do that, but it's not going to be fast.  If you want to
avoid polluting the cache, you can call invalidate_inode_pages2_range
after you're done calculating your checksum.

> Or may be there is a way to allocate "special" user-space like buffer
> for kernel and use it with O_DIRECT?

In-kernel O_DIRECT support has been proposed in the past, but there is
no solution for that yet.

Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ