From: Mimi Zohar <zohar@linux.ibm.com>
To: Raphael Gianotti <raphgi@linux.microsoft.com>
Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
tusharsu@linux.microsoft.com, nramas@linux.microsoft.com,
tyhicks@linux.microsoft.com
Subject: Re: [PATCH v3] IMA: Measure kernel version in early boot
Date: Tue, 26 Jan 2021 11:14:43 -0500 [thread overview]
Message-ID: <1e60a5577d42470e83900de4f8a8c631b0949112.camel@linux.ibm.com> (raw)
In-Reply-To: <20210126005044.2010-1-raphgi@linux.microsoft.com>
On Mon, 2021-01-25 at 16:50 -0800, Raphael Gianotti wrote:
> The integrity of a kernel can be verified by the boot loader on cold
> boot, and during kexec, by the current running kernel, before it is
> loaded. However, it is still possible that the new kernel being
> loaded is older than the current kernel, and/or has known
> vulnerabilities. Therefore, it is imperative that an attestation
> service be able to verify the version of the kernel being loaded on
> the client, from cold boot and subsequent kexec system calls,
> ensuring that only kernels with versions known to be good are loaded.
>
> Measure the kernel version using ima_measure_critical_data() early on
> in the boot sequence, reducing the chances of known kernel
> vulnerabilities being exploited. With IMA being part of the kernel,
> this overall approach makes the measurement itself more trustworthy.
>
> To enable measuring the kernel version "ima_policy=critical_data"
> needs to be added to the kernel command line arguments.
> For example,
> BOOT_IMAGE=/boot/vmlinuz-5.11.0-rc3+ root=UUID=fd643309-a5d2-4ed3-b10d-3c579a5fab2f ro nomodeset ima_policy=critical_data
>
> If runtime measurement of the kernel version is ever needed, the
> following should be added to /etc/ima/ima-policy:
>
> measure func=CRITICAL_DATA label=kernel_info
>
> To extract the measured data after boot, the following command can be used:
>
> grep -m 1 "kernel_version" \
> /sys/kernel/security/integrity/ima/ascii_runtime_measurements
>
> Sample output from the command above:
>
> 10 a8297d408e9d5155728b619761d0dd4cedf5ef5f ima-buf
> sha256:5660e19945be0119bc19cbbf8d9c33a09935ab5d30dad48aa11f879c67d70988
> kernel_version 352e31312e302d7263332d31363138372d676564623634666537383234342d6469727479
>
> The above corresponds to the following (decoded) version string:
Instead of the above, the following is clearer.
The above hex-ascii string corresponds to the kernel version
(e.g. xxd -r -p):
>
> 5.11.0-rc3-16187-gedb64fe78244-dirty
>
> Signed-off-by: Raphael Gianotti <raphgi@linux.microsoft.com>
Assuming the above or similar change,
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
prev parent reply other threads:[~2021-01-26 16:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 0:50 Raphael Gianotti
2021-01-26 16:14 ` Mimi Zohar [this message]
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=1e60a5577d42470e83900de4f8a8c631b0949112.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nramas@linux.microsoft.com \
--cc=raphgi@linux.microsoft.com \
--cc=tusharsu@linux.microsoft.com \
--cc=tyhicks@linux.microsoft.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
all inboxes | Powered by JetHome®