From: Christoph Hellwig <hch@infradead.org>
To: Roberto Sassu <roberto.sassu@huawei.com>
Cc: Christoph Hellwig <hch@infradead.org>,
"zohar@linux.ibm.com" <zohar@linux.ibm.com>,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Silviu Vlasceanu <Silviu.Vlasceanu@huawei.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [RESEND][PATCH] ima: Set and clear FMODE_CAN_READ in ima_calc_file_hash()
Date: Mon, 16 Nov 2020 16:22:02 +0000 [thread overview]
Message-ID: <20201116162202.GA15010@infradead.org> (raw)
In-Reply-To: <0fd0fb3360194d909ba48f13220f9302@huawei.com>
On Mon, Nov 16, 2020 at 08:52:19AM +0000, Roberto Sassu wrote:
> FMODE_CAN_READ was not set because f_mode does not have
> FMODE_READ. In the patch, I check if the former can be set
> similarly to the way it is done in file_table.c and open.c.
>
> Is there a better way to read a file when the file was not opened
> for reading and a new file descriptor cannot be created?
You can't open a file not open for reading. The file system or device
driver might have to prepare read-specific resources in ->open to
support reads. So what you'll have to do is to open a new instance
of the file that is open for reading.
next prev parent reply other threads:[~2020-11-16 16:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201113080132.16591-1-roberto.sassu@huawei.com>
2020-11-14 11:10 ` [RESEND][PATCH] ima: Set and clear FMODE_CAN_READ in ima_calc_file_hash() Christoph Hellwig
2020-11-16 8:52 ` Roberto Sassu
2020-11-16 16:22 ` Christoph Hellwig [this message]
2020-11-16 16:46 ` Mimi Zohar
2020-11-16 17:37 ` Linus Torvalds
2020-11-16 17:41 ` Christoph Hellwig
2020-11-16 18:09 ` Linus Torvalds
2020-11-16 18:35 ` Mimi Zohar
2020-11-17 18:23 ` Linus Torvalds
2020-11-17 18:54 ` Theodore Y. Ts'o
2020-11-17 23:23 ` Mimi Zohar
2020-11-17 23:29 ` Linus Torvalds
2020-11-17 23:36 ` Linus Torvalds
2020-11-18 18:28 ` Mimi Zohar
2020-11-20 12:52 ` Roberto Sassu
2020-11-16 18:21 ` Mimi Zohar
2020-11-16 18:08 ` Al Viro
2020-11-16 18:49 ` Mimi Zohar
2020-11-17 12:29 ` Roberto Sassu
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=20201116162202.GA15010@infradead.org \
--to=hch@infradead.org \
--cc=Silviu.Vlasceanu@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=roberto.sassu@huawei.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zohar@linux.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).