From: Mimi Zohar <firstname.lastname@example.org> To: Jonathan McDowell <email@example.com> Cc: Thomas Gleixner <firstname.lastname@example.org>, Ingo Molnar <email@example.com>, Borislav Petkov <firstname.lastname@example.org>, Dave Hansen <email@example.com>, "firstname.lastname@example.org" <email@example.com>, "H. Peter Anvin" <firstname.lastname@example.org>, Dmitry Kasatkin <email@example.com>, James Morris <firstname.lastname@example.org>, "Serge E. Hallyn" <email@example.com>, "firstname.lastname@example.org" <email@example.com>, "firstname.lastname@example.org" <email@example.com>, "firstname.lastname@example.org" <email@example.com> Subject: Re: [PATCH] Carry forward IMA measurement log on kexec on x86_64 Date: Thu, 28 Apr 2022 08:25:39 -0400 [thread overview] Message-ID: <firstname.lastname@example.org> (raw) In-Reply-To: <YmpvJ5JziMS+M3j+@noodles-fedora-PC23Y6EG> On Thu, 2022-04-28 at 10:40 +0000, Jonathan McDowell wrote: > On Tue, Apr 26, 2022 at 02:10:58PM -0400, Mimi Zohar wrote: > > On Tue, 2022-04-26 at 16:48 +0000, Jonathan McDowell wrote: > > > Also there's an issue about the fact that we measure the kexec pieces > > > even if we don't actually do the kexec; there's no marker that confirms > > > the kexec took place. It's separate to this patch (in that it affects > > > the device tree kexec infrastructure too) but it's conceivable that an > > > attacker could measure in the new kernel details and not actually do the > > > kexec, and that's not distinguishable from the kexec happening. > > > > > > One approach might be to add a marker in the kexec ima buffer such that > > > if it's not present we know the kexec hasn't happened, but I need to > > > think through that a bit more. > > > > I'm not quite sure what you mean by "we measure the kexec pieces". The > > kexec file load syscall calls kernel_read_file_from_fd() to read the > > kernel image into a buffer. The measurement record included in the IMA > > measurement list a hash of the buffer data, which is exactly the same > > as the hash of the kernel image. > > > > The kernel kexec self tests only do the kexec load, not the execute. > > For each kexec execute you'll see an additional "boot_aggregate" record > > in the IMA measurement list. At least for the moment I don't see a > > need for additional marker. > > You're right, of course. I'd missed the fact we measure the > boot_aggregate into IMA_MEASURE_PCR_IDX on boot, so although we'll > update PCRs related to the kexec on load the IMA PCR won't get updated > until we've actually done the reboot. So no need for anything extra. To clarify, after the kexec load, the IMA measurement list contains the kexec'ed kernel image measurement. The TPM was also extended with that measurement. Nothing prevents verifying the IMA measurement list at this point, before the kexec execute, though depending on policy it might result in additional measurements. The IMA "pcr=" policy rule option allows specifying a different PCR than the default IMA_MEASURE_PCR_IDX. To summarize, with CONFIG_IMA_ARCH_POLICY enabled, both measurements - kexec'ed kernel image, boot_aggregate - are being added to the IMA measurement list and extended into the default TPM PCR. Measuring the kexec'ed kernel image and extending the TPM with the measurement happens at some point before the system is rebooted. The "boot_aggregate" is the first measurement after boot/soft boot. thanks, Mimi
next prev parent reply other threads:[~2022-04-28 12:26 UTC|newest] Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-22 13:50 Jonathan McDowell 2022-04-25 16:29 ` Mimi Zohar 2022-04-26 12:08 ` Jonathan McDowell 2022-04-26 13:49 ` Mimi Zohar 2022-04-26 16:48 ` Jonathan McDowell 2022-04-26 18:10 ` Mimi Zohar 2022-04-28 10:40 ` Jonathan McDowell 2022-04-28 12:25 ` Mimi Zohar [this message] 2022-04-26 16:52 ` [PATCH v2] " Jonathan McDowell 2022-04-29 21:30 ` Mimi Zohar 2022-05-03 12:02 ` Jonathan McDowell 2022-05-04 13:49 ` Mimi Zohar 2022-05-09 10:40 ` Jonathan McDowell 2022-05-09 11:25 ` Boris Petkov 2022-05-09 17:46 ` Jonathan McDowell 2022-05-09 18:09 ` Borislav Petkov 2022-05-09 18:41 ` Jonathan McDowell 2022-05-09 19:40 ` Borislav Petkov 2022-05-10 8:02 ` Jonathan McDowell 2022-05-10 10:46 ` Borislav Petkov 2022-05-11 9:59 ` [PATCH v3] x86/kexec: Carry forward IMA measurement log on kexec Jonathan McDowell 2022-05-11 17:53 ` Mimi Zohar 2022-05-11 17:56 ` Borislav Petkov 2022-05-11 19:12 ` Mimi Zohar 2022-05-12 1:34 ` Mimi Zohar 2022-05-12 16:25 ` [PATCH v4] " Jonathan McDowell 2022-05-13 17:19 ` Lakshmi Ramasubramanian 2022-05-16 15:15 ` Jonathan McDowell 2022-05-17 17:19 ` Lakshmi Ramasubramanian 2022-05-18 10:42 ` Jonathan McDowell 2022-05-18 14:43 ` Mimi Zohar 2022-05-30 8:40 ` Jonathan McDowell 2022-06-03 15:55 ` Dave Hansen 2022-06-03 15:55 ` Dave Hansen 2022-06-06 3:54 ` Baoquan He 2022-06-06 3:54 ` Baoquan He 2022-06-06 4:06 ` Baoquan He 2022-06-10 9:52 ` Jonathan McDowell 2022-06-10 9:52 ` Jonathan McDowell 2022-06-13 10:30 ` [PATCH v5] " Jonathan McDowell 2022-06-13 10:30 ` Jonathan McDowell 2022-06-13 21:01 ` Mimi Zohar 2022-06-13 21:01 ` Mimi Zohar 2022-06-16 2:59 ` Baoquan He 2022-06-16 2:59 ` Baoquan He 2022-06-16 15:30 ` [PATCH v6] " Jonathan McDowell 2022-06-16 15:30 ` Jonathan McDowell 2022-06-30 8:36 ` [PATCH v7] " Jonathan McDowell 2022-06-30 8:36 ` Jonathan McDowell 2022-06-30 11:54 ` Mimi Zohar 2022-06-30 11:54 ` Mimi Zohar 2022-07-04 2:36 ` Baoquan He 2022-07-04 2:36 ` Baoquan He 2022-06-27 11:56 ` [tip: x86/kdump] " tip-bot2 for Jonathan McDowell 2022-07-01 14:37 ` tip-bot2 for Jonathan McDowell 2022-07-07 16:52 ` [tip: x86/boot] " tip-bot2 for Jonathan McDowell 2022-07-07 17:37 ` Jonathan McDowell 2022-07-07 17:50 ` Dave Hansen
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 \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH] Carry forward IMA measurement log on kexec on x86_64' \ /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
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.