[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wih-ibNUxeiKpuKrw3Rd2=QEAZ8zgRWt_CORAjbZykRWQ@mail.gmail.com>
Date: Tue, 17 Nov 2020 10:23:58 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Mimi Zohar <zohar@...ux.ibm.com>
Cc: Christoph Hellwig <hch@...radead.org>,
Roberto Sassu <roberto.sassu@...wei.com>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Silviu Vlasceanu <Silviu.Vlasceanu@...wei.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>
Subject: Re: [RESEND][PATCH] ima: Set and clear FMODE_CAN_READ in ima_calc_file_hash()
On Mon, Nov 16, 2020 at 10:35 AM Mimi Zohar <zohar@...ux.ibm.com> wrote:
>
> We need to differentiate between signed files, which by definition are
> immutable, and those that are mutable. Appending to a mutable file,
> for example, would result in the file hash not being updated.
> Subsequent reads would fail.
Why would that require any reading of the file at all AT WRITE TIME?
Don't do it. Really.
When opening the file write-only, you just invalidate the hash. It
doesn't matter anyway - you're only writing.
Later on, when reading, only at that point does the hash matter, and
then you can do the verification.
Although honestly, I don't even see the point. You know the hash won't
match, if you wrote to the file.
Linus
Powered by blists - more mailing lists