[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202007281242.B6016AE4B@keescook>
Date: Tue, 28 Jul 2020 12:43:56 -0700
From: Kees Cook <keescook@...omium.org>
To: Mimi Zohar <zohar@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Scott Branden <scott.branden@...adcom.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Jessica Yu <jeyu@...nel.org>, SeongJae Park <sjpark@...zon.de>,
KP Singh <kpsingh@...omium.org>, linux-efi@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-integrity@...r.kernel.org, selinux@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 12/19] firmware_loader: Use security_post_load_data()
On Mon, Jul 27, 2020 at 06:57:45AM -0400, Mimi Zohar wrote:
> On Fri, 2020-07-24 at 14:36 -0700, Kees Cook wrote:
> > Now that security_post_load_data() is wired up, use it instead
> > of the NULL file argument style of security_post_read_file(),
> > and update the security_kernel_load_data() call to indicate that a
> > security_kernel_post_load_data() call is expected.
> >
> > Wire up the IMA check to match earlier logic. Perhaps a generalized
> > change to ima_post_load_data() might look something like this:
> >
> > return process_buffer_measurement(buf, size,
> > kernel_load_data_id_str(load_id),
> > read_idmap[load_id] ?: FILE_CHECK,
> > 0, NULL);
> >
> > Signed-off-by: Kees Cook <keescook@...omium.org>
>
> process_measurement() measures, verifies a file signature - both
> signatures stored as an xattr and as an appended buffer signature -
> and augments audit records with the file hash. (Support for measuring,
> augmenting audit records, and/or verifying fs-verity signatures has
> yet to be added.)
>
> As explained in my response to 11/19, the file descriptor provides the
> file pathname associated with the buffer data. In addition, IMA
> policy rules may be defined in terms of other file descriptor info -
> uid, euid, uuid, etc.
>
> Recently support was added for measuring the kexec boot command line,
> certificates being loaded onto a keyring, and blacklisted file hashes
> (limited to appended signatures). None of these buffers are signed.
> process_buffer_measurement() was added for this reason and as a
> result is limited to just measuring the buffer data.
>
> Whether process_measurement() or process_buffer_measurement() should
> be modified, needs to be determined. In either case to support the
> init_module syscall, would at minimum require the associated file
> pathname.
Right -- I don't intend to make changes to the init_module() syscall
since it's deprecated, so this hook is more of a "fuller LSM coverage
for old syscalls" addition.
IMA can happily continue to ignore it, which is what I have here, but I
thought I'd at least show what it *might* look like. Perhaps BPF LSM is
a better example.
Does anything need to change for this patch?
--
Kees Cook
Powered by blists - more mailing lists