Re: [PATCH 2/2 v3] efi: print appropriate status message when loading certificates

2019-05-07 Thread joeyli
On Fri, May 03, 2019 at 04:23:51PM +0200, Ard Biesheuvel wrote: > On Fri, 3 May 2019 at 10:59, joeyli wrote: > > > > On Fri, May 03, 2019 at 10:07:59AM +0200, Ard Biesheuvel wrote: > > > On Fri, 3 May 2019 at 09:18, joeyli wrote: > > > > > > > > Hi

Re: [PATCH 2/2 v3] efi: print appropriate status message when loading certificates

2019-05-03 Thread joeyli
On Fri, May 03, 2019 at 10:07:59AM +0200, Ard Biesheuvel wrote: > On Fri, 3 May 2019 at 09:18, joeyli wrote: > > > > Hi Ard, > > > > On Thu, May 02, 2019 at 11:04:34AM +0200, Ard Biesheuvel wrote: > > > On Thu, 2 May 2019 at 06:04, Lee, Chun-Yi wrote: >

Re: [PATCH 1/2 v2] efi: add a function to convert the status value to string

2019-05-03 Thread joeyli
On Fri, May 03, 2019 at 08:16:42AM +0200, Ard Biesheuvel wrote: > On Fri, 3 May 2019 at 08:15, joeyli wrote: > > > > On Thu, May 02, 2019 at 10:53:31AM +0200, Ard Biesheuvel wrote: > > > On Thu, 2 May 2019 at 06:04, Lee, Chun-Yi wrote: > > > > > > &g

Re: [PATCH 2/2 v3] efi: print appropriate status message when loading certificates

2019-05-03 Thread joeyli
Hi Ard, On Thu, May 02, 2019 at 11:04:34AM +0200, Ard Biesheuvel wrote: > On Thu, 2 May 2019 at 06:04, Lee, Chun-Yi wrote: > > > > When loading certificates list from UEFI variable, the original error > > message direct shows the efi status code from UEFI firmware. It looks > > ugly: > > > > [

Re: [PATCH 1/2 v2] efi: add a function to convert the status value to string

2019-05-02 Thread joeyli
On Thu, May 02, 2019 at 10:53:31AM +0200, Ard Biesheuvel wrote: > On Thu, 2 May 2019 at 06:04, Lee, Chun-Yi wrote: > > > > This function can be used to convert EFI status value to string > > for printing out debug message. Using this function can improve > > the readability of log. > > > > v2. >

Re: [PATCH 1/2] efi: add a function for transferring status to string

2019-03-29 Thread joeyli
Hi Mimi, On Wed, Mar 27, 2019 at 03:04:02PM -0400, Mimi Zohar wrote: > On Wed, 2019-03-27 at 19:58 +0100, Ard Biesheuvel wrote: > > On Sun, 24 Mar 2019 at 01:26, Lee, Chun-Yi wrote: > > > > > > This function can be used to transfer EFI status code to string > > > for printing out debug message. U

Re: [PATCH 1/2] efi: add a function for transferring status to string

2019-03-29 Thread joeyli
Hi Ard, On Wed, Mar 27, 2019 at 07:58:03PM +0100, Ard Biesheuvel wrote: > On Sun, 24 Mar 2019 at 01:26, Lee, Chun-Yi wrote: > > > > This function can be used to transfer EFI status code to string > > for printing out debug message. Using this function can improve > > the readability of log. > > >

Re: [PATCH 0/6][RFC] Add EFI secure key to key retention service

2018-08-05 Thread joeyli
Hi James, On Sun, Aug 05, 2018 at 10:47:26AM -0700, James Bottomley wrote: > On Sun, 2018-08-05 at 09:25 +0200, Ard Biesheuvel wrote: > > Hello Chun,yi, > > > > On 5 August 2018 at 05:21, Lee, Chun-Yi > > wrote: > > > When secure boot is enabled, only signed EFI binary can access > > > EFI boot

Re: [PATCH 0/6][RFC] Add EFI secure key to key retention service

2018-08-05 Thread joeyli
On Sun, Aug 05, 2018 at 09:25:56AM +0200, Ard Biesheuvel wrote: > Hello Chun,yi, > > On 5 August 2018 at 05:21, Lee, Chun-Yi wrote: > > When secure boot is enabled, only signed EFI binary can access > > EFI boot service variable before ExitBootService. Which means that > > the EFI boot service va

Re: [PATCH 1/6] x86/KASLR: make getting random long number function public

2018-08-05 Thread joeyli
Hi Ard, On Sun, Aug 05, 2018 at 10:16:03AM +0200, Ard Biesheuvel wrote: > On 5 August 2018 at 05:21, Lee, Chun-Yi wrote: > > Separating the functions for getting random long number from KASLR > > to x86 library, then it can be used to generate random long for > > EFI root key. > > > > Cc: Kees Co

Re: [PATCH] efi: Fix the size not consistent issue when unmapping memory map

2018-05-04 Thread joeyli
Hi Ard, On Thu, May 03, 2018 at 02:05:51PM +0200, Ard Biesheuvel wrote: > On 2 May 2018 at 08:17, Lee, Chun-Yi wrote: > > When using kdump, SOMETIMES the "size not consistent" warning message > > shows up when the crash kernel boots with early_ioremap_debug parameter: > > > > WARNING: CPU: 0 PID:

Re: [PATCH] efi: Fix the size not consistent issue when unmapping memory map

2018-04-16 Thread joeyli
On Mon, Apr 16, 2018 at 06:35:22PM -0600, Randy Wright wrote: > On Mon, Apr 16, 2018 at 02:37:38PM +0800, joeyli wrote: > > Hi Randy, > > ... > > Randy, do you want to try Dave's kexec patch on your environment? Please > > remove > > my patch first. >

Re: [PATCH] efi: Fix the size not consistent issue when unmapping memory map

2018-04-15 Thread joeyli
Hi Randy, On Mon, Apr 16, 2018 at 11:09:04AM +0800, Dave Young wrote: > On 04/16/18 at 10:57am, Dave Young wrote: > > On 04/13/18 at 02:27pm, Lee, Chun-Yi wrote: > > > When using kdump, SOMETIMES the "size not consistent" warning message > > > shows up when the crash kernel boots with early_iorema

Re: [PATCH] efi: Fix the size not consistent issue when unmapping memory map

2018-04-15 Thread joeyli
On Mon, Apr 16, 2018 at 10:57:34AM +0800, Dave Young wrote: > On 04/13/18 at 02:27pm, Lee, Chun-Yi wrote: > > When using kdump, SOMETIMES the "size not consistent" warning message > > shows up when the crash kernel boots with early_ioremap_debug parameter: > > > > WARNING: CPU: 0 PID: 0 at ../mm/e

Re: [GIT PULL] Kernel lockdown for secure boot

2018-04-09 Thread joeyli
On Sun, Apr 08, 2018 at 08:40:10PM -0700, Alexei Starovoitov wrote: > On Sun, Apr 08, 2018 at 04:07:42PM +0800, joeyli wrote: > > > > > If the only thing that folks are paranoid about is reading > > > arbitrary kernel memory with bpf_probe_read() helper > > &

Re: [GIT PULL] Kernel lockdown for secure boot

2018-04-08 Thread joeyli
On Tue, Apr 03, 2018 at 07:34:25PM -0700, Alexei Starovoitov wrote: > On Tue, Apr 3, 2018 at 9:26 AM, Andy Lutomirski wrote: > > On Tue, Apr 3, 2018 at 8:41 AM, Alexei Starovoitov > > wrote: > >> On Tue, Apr 03, 2018 at 08:11:07AM -0700, Andy Lutomirski wrote: > >>> > > >>> >> "bpf: Restrict kern

Re: [GIT PULL] Kernel lockdown for secure boot

2018-04-08 Thread joeyli
s KMK and EVM. There have another idea is using a tree to register all sensitive data then blanking them when reading. Here is a very early developing version: https://github.com/joeyli/linux-sensitive_data/commits/sensitive-data-tree-v0.1-v4.15 But this approach causes runtime overhead and a

Re: An actual suggestion (Re: [GIT PULL] Kernel lockdown for secure boot)

2018-04-04 Thread joeyli
Hi David, On Wed, Apr 04, 2018 at 05:17:24PM +0100, David Howells wrote: > Andy Lutomirski wrote: > > > Since this thread has devolved horribly, I'm going to propose a solution. > > > > 1. Split the "lockdown" state into three levels: (please don't > > bikeshed about the names right now.) > >

Re: An actual suggestion (Re: [GIT PULL] Kernel lockdown for secure boot)

2018-04-04 Thread joeyli
On Wed, Apr 04, 2018 at 11:19:27PM +0100, David Howells wrote: > Jann Horn wrote: > > > > Uh, no. bpf, for example, can be used to modify kernel memory. > > > > I'm pretty sure bpf isn't supposed to be able to modify arbitrary > > kernel memory. AFAIU if you can use BPF to write to arbitrary ke

Re: An actual suggestion (Re: [GIT PULL] Kernel lockdown for secure boot)

2018-04-04 Thread joeyli
Hi Andy, On Wed, Apr 04, 2018 at 07:49:12AM -0700, Andy Lutomirski wrote: > Since this thread has devolved horribly, I'm going to propose a solution. ... > 6. There's a way to *decrease* the lockdown level below the configured > value. (This ability itself may be gated by a config option.) > Choi

Re: [PATCH 0/9] KEYS: Blacklisting & UEFI database load

2018-03-27 Thread joeyli
Hi Mimi, On Mon, Mar 19, 2018 at 10:12:03AM -0400, Mimi Zohar wrote: > On Sun, 2018-03-11 at 11:20 +0800, joeyli wrote: > > On Wed, Mar 07, 2018 at 07:28:37AM -0800, James Bottomley wrote: > > > On Wed, 2018-03-07 at 08:18 -0500, Mimi Zohar wrote: > > > > On Tue, 2

Re: [PATCH 4/5] MODSIGN: checking the blacklisted hash before loading a kernel module

2018-03-16 Thread joeyli
On Thu, Mar 15, 2018 at 07:30:26AM -0700, James Bottomley wrote: > On Thu, 2018-03-15 at 14:16 +0800, joeyli wrote: > > On Wed, Mar 14, 2018 at 07:19:25AM -0700, James Bottomley wrote: > > > > > > On Wed, 2018-03-14 at 14:08 +0800, joeyli wrote: > > > > >

Re: [PATCH 4/5] MODSIGN: checking the blacklisted hash before loading a kernel module

2018-03-14 Thread joeyli
On Wed, Mar 14, 2018 at 07:19:25AM -0700, James Bottomley wrote: > On Wed, 2018-03-14 at 14:08 +0800, joeyli wrote: > > On Tue, Mar 13, 2018 at 10:18:35AM -0700, James Bottomley wrote: > > > > > > On Tue, 2018-03-13 at 18:38 +0800, Lee, Chun-Yi wrote: > > >

Re: [PATCH 1/5] MODSIGN: do not load mok when secure boot disabled

2018-03-14 Thread joeyli
Hi Ard, First! Thanks for your review! On Tue, Mar 13, 2018 at 05:25:30PM +, Ard Biesheuvel wrote: > On 13 March 2018 at 10:37, Lee, Chun-Yi wrote: > > The mok can not be trusted when the secure boot is disabled. Which > > means that the kernel embedded certificate is the only trusted key.

Re: [PATCH 4/5] MODSIGN: checking the blacklisted hash before loading a kernel module

2018-03-13 Thread joeyli
On Tue, Mar 13, 2018 at 10:18:35AM -0700, James Bottomley wrote: > On Tue, 2018-03-13 at 18:38 +0800, Lee, Chun-Yi wrote: > > This patch adds the logic for checking the kernel module's hash > > base on blacklist. The hash must be generated by sha256 and enrolled > > to dbx/mokx. > > > > For exampl

Re: [PATCH 2/5] MODSIGN: print appropriate status message when getting UEFI certificates list

2018-03-13 Thread joeyli
Hi James, Thanks for your review. On Tue, Mar 13, 2018 at 10:17:50AM -0700, James Bottomley wrote: > On Tue, 2018-03-13 at 18:35 +0800, Lee, Chun-Yi wrote: > > When getting certificates list from UEFI variable, the original error > > message shows the state number from UEFI firmware. It's hard to

Re: [PATCH 0/9] KEYS: Blacklisting & UEFI database load

2018-03-10 Thread joeyli
On Wed, Mar 07, 2018 at 07:28:37AM -0800, James Bottomley wrote: > On Wed, 2018-03-07 at 08:18 -0500, Mimi Zohar wrote: > > On Tue, 2018-03-06 at 15:05 +0100, Jiri Slaby wrote: > > > what's the status of this please? Distributors (I checked SUSE, > > > RedHat and Ubuntu) have to carry these patches

Re: [PATCH 1/4] MODSIGN: do not load mok when secure boot disabled

2017-11-30 Thread joeyli
Hi James, First, thank you for reviewing and comment! On Thu, Nov 30, 2017 at 07:51:03AM -0800, James Bottomley wrote: > On Wed, 2017-11-29 at 22:11 +0800, Lee, Chun-Yi wrote: > > The mok can not be trusted when the secure boot is disabled. Which > > means that the kernel embedded certificate is

Re: [PATCH 07/27] kexec_file: Disable at runtime if securelevel has been set

2017-10-28 Thread joeyli
On Fri, Oct 27, 2017 at 03:32:26PM -0400, Mimi Zohar wrote: > On Thu, 2017-10-26 at 10:17 -0400, Mimi Zohar wrote: > > On Thu, 2017-10-26 at 15:42 +0800, joeyli wrote: > > > Hi Mimi, > > > > > > Thank you for reviewing. > > > > > > On M

Re: [PATCH 07/27] kexec_file: Disable at runtime if securelevel has been set

2017-10-26 Thread joeyli
Hi Mimi, Thank you for reviewing. On Mon, Oct 23, 2017 at 11:54:43AM -0400, Mimi Zohar wrote: > On Thu, 2017-10-19 at 15:51 +0100, David Howells wrote: > > From: Chun-Yi Lee > > > > When KEXEC_VERIFY_SIG is not enabled, kernel should not loads image > > through kexec_file systemcall if securele

Re: [PATCH 12/27] x86/msr: Restrict MSR access when the kernel is locked down

2017-10-25 Thread joeyli
Hi David, On Mon, Oct 23, 2017 at 03:49:44PM +0100, David Howells wrote: > Alan Cox wrote: > > > There are a load of standard tools that use this so I think you are going > > to need a whitelist. Can you at least log *which* MSR in the failing case > > so a whitelist can be built over time ? >

Re: [PATCH 18/27] bpf: Restrict kernel image access functions when the kernel is locked down

2017-10-25 Thread joeyli
On Mon, Oct 23, 2017 at 03:53:00PM +0100, David Howells wrote: > j...@suse.com wrote: > > > hm... patch 4 only prevents write_mem() but not read_mem(). > > Or I missed anything? > > Actually, yes, as it happens, patch 11 prevents you from even opening /dev/mem > and /dev/kmem by locking down open

Re: [PATCH 12/27] x86/msr: Restrict MSR access when the kernel is locked down

2017-10-20 Thread joeyli
On Fri, Oct 20, 2017 at 09:48:16PM +0100, David Howells wrote: > Alan Cox wrote: > > > There are a load of standard tools that use this so I think you are going > > to need a whitelist. Can you at least log *which* MSR in the failing case > > so a whitelist can be built over time ? > [...snip] >

Re: [PATCH 17/27] acpi: Disable APEI error injection if the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:52:41PM +0100, David Howells wrote: > From: Linn Crosetto > > ACPI provides an error injection mechanism, EINJ, for debugging and testing > the ACPI Platform Error Interface (APEI) and other RAS features. If > supported by the firmware, ACPI specification 5.0 and later

Re: [PATCH 16/27] acpi: Disable ACPI table override if the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:52:34PM +0100, David Howells wrote: > From: Linn Crosetto > > >From the kernel documentation (initrd_table_override.txt): > > If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible > to override nearly any ACPI table provided by the BIOS with an >

Re: [PATCH 15/27] acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:52:27PM +0100, David Howells wrote: > From: Josh Boyer > > This option allows userspace to pass the RSDP address to the kernel, which > makes it possible for a user to modify the workings of hardware . Reject > the option when the kernel is locked down. > > Signed-off

Re: [PATCH 14/27] ACPI: Limit access to custom_method when the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:52:19PM +0100, David Howells wrote: > From: Matthew Garrett > > custom_method effectively allows arbitrary access to system memory, making > it possible for an attacker to circumvent restrictions on module loading. > Disable it if the kernel is locked down. > > Signed-

Re: [PATCH 13/27] asus-wmi: Restrict debugfs interface when the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:52:11PM +0100, David Howells wrote: > From: Matthew Garrett > > We have no way of validating what all of the Asus WMI methods do on a given > machine - and there's a risk that some will allow hardware state to be > manipulated in such a way that arbitrary code can be ex

Re: [PATCH 12/27] x86/msr: Restrict MSR access when the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:52:04PM +0100, David Howells wrote: > From: Matthew Garrett > > Writing to MSRs should not be allowed if the kernel is locked down, since > it could lead to execution of arbitrary code in kernel mode. Based on a > patch by Kees Cook. > > Signed-off-by: Matthew Garrett

Re: [PATCH 11/27] x86: Lock down IO port access when the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:51:56PM +0100, David Howells wrote: > From: Matthew Garrett > > IO port access would permit users to gain access to PCI configuration > registers, which in turn (on a lot of hardware) give access to MMIO > register space. This would potentially permit root to trigger ar

Re: [PATCH 10/27] PCI: Lock down BAR access when the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:51:49PM +0100, David Howells wrote: > From: Matthew Garrett > > Any hardware that can potentially generate DMA has to be locked down in > order to avoid it being possible for an attacker to modify kernel code, > allowing them to circumvent disabled module loading or mod

Re: [PATCH 09/27] uswsusp: Disable when the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:51:42PM +0100, David Howells wrote: > From: Matthew Garrett > > uswsusp allows a user process to dump and then restore kernel state, which > makes it possible to modify the running kernel. Disable this if the kernel > is locked down. > > Signed-off-by: Matthew Garrett

Re: [PATCH 08/27] hibernate: Disable when the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:51:34PM +0100, David Howells wrote: > From: Josh Boyer > > There is currently no way to verify the resume image when returning > from hibernate. This might compromise the signed modules trust model, > so until we can work with signed hibernate images we disable it when

Re: [PATCH 06/27] Copy secure_boot flag in boot params across kexec reboot

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:51:20PM +0100, David Howells wrote: > From: Dave Young > > Kexec reboot in case secure boot being enabled does not keep the secure > boot mode in new kernel, so later one can load unsigned kernel via legacy > kexec_load. In this state, the system is missing the protect

Re: [PATCH 05/27] kexec: Disable at runtime if the kernel is locked down

2017-10-19 Thread joeyli
On Thu, Oct 19, 2017 at 03:51:09PM +0100, David Howells wrote: > From: Matthew Garrett > > kexec permits the loading and execution of arbitrary code in ring 0, which > is something that lock-down is meant to prevent. It makes sense to disable > kexec in this situation. > > This does not affect k

Re: [PATCH 04/27] Restrict /dev/mem and /dev/kmem when the kernel is locked down

2017-10-19 Thread joeyli
Hi David, Thanks for you send out this series. On Thu, Oct 19, 2017 at 03:51:02PM +0100, David Howells wrote: > From: Matthew Garrett > > Allowing users to write to address space makes it possible for the kernel to > be subverted, avoiding module loading restrictions. Prevent this when the > k

Re: [PATCH 03/27] Enforce module signatures if the kernel is locked down

2017-10-19 Thread joeyli
Hi David, Thanks for you send our this series. On Thu, Oct 19, 2017 at 03:50:55PM +0100, David Howells wrote: > If the kernel is locked down, require that all modules have valid > signatures that we can verify. > > Signed-off-by: David Howells I have reviewed and tested this patch. Please feel

Re: [PATCH 18/27] bpf: Restrict kernel image access functions when the kernel is locked down

2017-10-19 Thread joeyli
Hi Alexei, Thanks for your review! On Thu, Oct 19, 2017 at 03:18:30PM -0700, Alexei Starovoitov wrote: > On Thu, Oct 19, 2017 at 03:52:49PM +0100, David Howells wrote: > > From: Chun-Yi Lee > > > > There are some bpf functions can be used to read kernel memory: > > bpf_probe_read, bpf_probe_wr

Re: Draft manpage explaining kernel lockdown

2017-10-06 Thread joeyli
Hi David, On Thu, Oct 05, 2017 at 12:00:24PM +0100, David Howells wrote: > Hi Ard, Michael, > > Attached is a draft for a manual page (kernel_lockdown.7) that I intend to > point at from messages emitted when the kernel prohibits something because the > kernel is in 'lockdown' mode, typically tri

Re: [PATCH 5/5] Add a sysrq option to exit secure boot mode

2017-05-26 Thread joeyli
Hi, On Wed, May 24, 2017 at 03:46:03PM +0100, David Howells wrote: > From: Kyle McMartin > > Make sysrq+x exit secure boot mode on x86_64, thereby allowing the running > kernel image to be modified. This lifts the lockdown. > > Signed-off-by: Kyle McMartin > Signed-off-by: David Howells > cc

Re: [PATCH 3/5] Add the ability to lock down access to the running kernel image

2017-05-26 Thread joeyli
On Fri, May 26, 2017 at 01:43:12PM +0100, David Howells wrote: > Casey Schaufler wrote: > > > You called out five distinct features in 0/5, so how about > > a bit for each of those? > > Actually, there are more than five in that list - there are three in the first > item - and I'm not sure the r

Re: [PATCH 4/5] efi: Lock down the kernel if booted in secure boot mode

2017-05-26 Thread joeyli
On Wed, May 24, 2017 at 03:45:56PM +0100, David Howells wrote: > UEFI Secure Boot provides a mechanism for ensuring that the firmware will > only load signed bootloaders and kernels. Certain use cases may also > require that all kernel modules also be signed. Add a configuration option > that to

Re: [PATCH 3/5] Add the ability to lock down access to the running kernel image

2017-05-26 Thread joeyli
On Wed, May 24, 2017 at 03:45:45PM +0100, David Howells wrote: > Provide a single call to allow kernel code to determine whether the system > should be locked down, thereby disallowing various accesses that might > allow the running kernel image to be changed including the loading of > modules that

Re: [PATCH 2/5] efi: Add EFI_SECURE_BOOT bit

2017-05-26 Thread joeyli
On Wed, May 24, 2017 at 03:45:32PM +0100, David Howells wrote: > From: Josh Boyer > > UEFI machines can be booted in Secure Boot mode. Add a EFI_SECURE_BOOT bit > that can be passed to efi_enabled() to find out whether secure boot is > enabled. > > This will be used by the SysRq+x handler, regi

Re: [PATCH 1/5] efi: Move the x86 secure boot switch to generic code

2017-05-26 Thread joeyli
Hi David, On Wed, May 24, 2017 at 03:45:25PM +0100, David Howells wrote: > Move the switch-statement in x86's setup_arch() that inteprets the > secure_boot boot parameter to generic code. > > Suggested-by: Ard Biesheuvel > Signed-off-by: David Howells I reviewed the context for this patch. Re

Re: [PATCH v2] x86/efi: Disable runtime services on kexec kernel if booted with efi=old_map

2017-05-17 Thread joeyli
On Tue, May 16, 2017 at 06:14:23PM -0700, Sai Praneeth Prakhya wrote: > From: Sai Praneeth > > Booting kexec kernel with "efi=old_map" in kernel command line hits > kernel panic as shown below. > > [0.001000] BUG: unable to handle kernel paging request at 88007fe78070 > [0.001000] IP: virt_e

Re: [PATCH] x86/efi: Fix kexec kernel panic when efi=old_map is enabled

2017-05-12 Thread joeyli
On Mon, May 08, 2017 at 12:25:23PM -0700, Sai Praneeth Prakhya wrote: > From: Sai Praneeth > > Booting kexec kernel with "efi=old_map" in kernel command line hits > kernel panic as shown below. > > [0.001000] BUG: unable to handle kernel paging request at 88007fe78070 > [0.001000] IP

Re: [PATCH 20/24] bpf: Restrict kernel image access functions when the kernel is locked down

2017-04-12 Thread joeyli
Hi David, First, thanks for your help to send out this series. On Wed, Apr 05, 2017 at 09:17:25PM +0100, David Howells wrote: > From: Chun-Yi Lee > > There are some bpf functions can be used to read kernel memory: > bpf_probe_read, bpf_probe_write_user and bpf_trace_printk. These allow > priva

Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down

2017-04-12 Thread joeyli
ry and I'm not sure how the hibernate > >>> code can verify whether or not it is in use. > >> > >> BTW, SUSE has patches adding secure boot support to the hibernate code > >> and Jiri promised me to post them last year even. :-) > > > > Oh,

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-09-12 Thread joeyli
On Wed, Sep 09, 2015 at 01:24:08PM +0100, Matt Fleming wrote: > On Thu, 27 Aug, at 06:21:44PM, joeyli wrote: > > On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote: > > > On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote: > > > > +static int __i

Re: [PATCH v2 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-09-12 Thread joeyli
On Wed, Sep 09, 2015 at 01:15:45PM +0100, Matt Fleming wrote: > On Thu, 27 Aug, at 05:04:52PM, joeyli wrote: > > > > The purpose of checking attribute of hibernation key variable is > > in case someone created a key variable on runtime environment _before_ > > this

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-09 Thread joeyli
Hi, On Wed, Sep 09, 2015 at 12:21:23PM +0100, Matt Fleming wrote: > On Wed, 09 Sep, at 08:33:07AM, joeyli wrote: > > > > Yes, the machine on my hand has EFI_PROPERTIES_TABLE enabled, and it doesn't > > boot without your patch. > > Awesome. Could you

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-08 Thread joeyli
Hi Matt, On Tue, Sep 08, 2015 at 09:41:47PM +0100, Matt Fleming wrote: > On Mon, 07 Sep, at 12:07:52PM, joeyli wrote: > > > > This patch works to me on Intel S1200V3RPS to fix issue: > > DMI: Intel Corporation (uefidk.com) Intel Server Board S1200V3RPS UEFI > > Devel

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-06 Thread joeyli
Hi, On Fri, Sep 04, 2015 at 02:14:07PM +0100, Matt Fleming wrote: > From: Matt Fleming > > Beginning with UEFI v2.5 EFI_PROPERTIES_TABLE was introduced that > signals that the firmware PE/COFF loader supports splitting code and > data sections of PE/COFF images into separate EFI memory map entr

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-27 Thread joeyli
On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote: > > Add handler to parse the setup data that carrying hibernation key, it > > reserves hibernation key by memblock then copies key to a allocated page > > in later initcall stage. > >

Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data

2015-08-27 Thread joeyli
On Fri, Aug 21, 2015 at 01:40:26PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:28PM, Lee, Chun-Yi wrote: > > For forwarding hibernation key from EFI stub to boot kernel, this patch > > allocates setup data for carrying hibernation key, size and the status > > of efi operating. > > This

Re: [PATCH v2 07/16] efi: Make efi_status_to_err() public

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 04:07:06PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:27PM, Lee, Chun-Yi wrote: > > Moved the function of transferring EFI status to kernel error for > > later used by EFI stub. > > Might I suggest: > > "Move the function for converting EFI status to kernel er

Re: [PATCH v2 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 09:40:44PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:26PM, Lee, Chun-Yi wrote: > > This patch adds codes in EFI stub for generating and storing the > > HMAC key in EFI boot service variable for signing hibernate image. > > > > Per rcf2104, the length of HMAC-SHA

Re: [PATCH v2 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-08-26 Thread joeyli
On Thu, Aug 20, 2015 at 09:26:20PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:25PM, Lee, Chun-Yi wrote: > > + > > +static unsigned long efi_get_rng64(efi_system_table_t *sys_table, > > + void **rng_handle) > > +{ > > + const struct efi_config *efi_early = _

Re: [PATCH v2 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-08-26 Thread joeyli
On Thu, Aug 20, 2015 at 03:47:06PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:25PM, Lee, Chun-Yi wrote: > > To grab random numbers through EFI protocol as one of the entropies > > source of swsusp key, this patch adds the logic for accessing EFI RNG > > (random number generator) protocol

Re: [PATCH v2 04/16] x86/efi: Generating random number in EFI stub

2015-08-26 Thread joeyli
Hi Matt, Thanks for your reviewing and sorry for my delay. On Thu, Aug 20, 2015 at 03:12:21PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:24PM, Lee, Chun-Yi wrote: > > This patch adds the codes for generating random number array as the > > HMAC key that will used by later EFI stub code

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-08-19 Thread joeyli
On Wed, Aug 19, 2015 at 05:31:45PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 10:16:01PM, joeyli wrote: > > > > Thanks for your explanation. > > > > For my issue, I will check if rewriting the VA of runtime services can fix > > issue. > > If not, t

Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data

2015-08-15 Thread joeyli
On Sat, Aug 15, 2015 at 07:07:38PM +0200, Pavel Machek wrote: > On Tue 2015-08-11 14:16:28, Lee, Chun-Yi wrote: > > For forwarding hibernation key from EFI stub to boot kernel, this patch > > allocates setup data for carrying hibernation key, size and the status > > of efi operating. > > > > Revie

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-13 Thread joeyli
On Tue, Aug 11, 2015 at 02:16:29PM +0800, Lee, Chun-Yi wrote: > Add handler to parse the setup data that carrying hibernation key, it > reserves hibernation key by memblock then copies key to a allocated page > in later initcall stage. > [...snip] > diff --git a/arch/x86/power/hibernate_keys.c b/a

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-12 Thread joeyli
Hi Yu, Thanks for your reviewing. On Thu, Aug 13, 2015 at 02:45:32AM +, Chen, Yu C wrote: > Hi Chun-yi, > On Tue, 2015-08-11 at 14:16 +0800, Lee, Chun-Yi wrote: > > > +/* A page used to keep hibernation keys */ > > +static struct hibernation_keys *hibernation_keys; > > + > > +void __init pa

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 01:01:18PM +0100, Matt Fleming wrote: > On Fri, 2015-07-31 at 17:58 +0800, joeyli wrote: > > > > > > Can you do something to avoid each function having two very similar > > > versions of these functions? > > > > > > &

Re: [RFC PATCH 01/16] PM / hibernate: define HMAC algorithm and digest size of swsusp

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 02:49:36PM +0200, Pavel Machek wrote: > On Fri 2015-07-31 18:08:12, joeyli wrote: > > On Tue, Jul 28, 2015 at 02:01:56PM +0200, Pavel Machek wrote: > > > On Thu 2015-07-16 22:25:15, Lee, Chun-Yi wrote: > > > > Using HMAC-SHA1 to be the HMAC

Re: [RFC PATCH 09/16] PM / hibernate: Reserve swsusp key and earse footprints

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:35:23PM +0200, Pavel Machek wrote: > Typo in patch subject. > > > And for earsing footbprints, the codes in this patch remove setup > > And two typos here. > Sorry for subject and above typos, I will fix it. Thanks. > > data that carried swsusp key, and clean the mem

Re: [RFC PATCH 08/16] x86/efi: Carrying swsusp key by setup data

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:30:09PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > For forwarding swsusp key from EFI stub to boot kernel, this patch > > allocates setup data for carrying swsusp key, size and the status > > of efi operating. > > > > Signed-o

Re: [RFC PATCH 07/16] efi: Public the function of transferring EFI status to kernel error

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:23:22PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > Moved the function of transferring EFI status to kernel error for > > later used by EFI stub. > > > > Signed-off-by: Lee, Chun-Yi > > --- > > drivers/firmware/efi/vars.c | 3

Re: [RFC PATCH 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:20:46PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > This patch adds codes in EFI stub for generating and storing the > > HMAC key in EFI boot service variable for signing hibernate image. > > > > Per rcf2104, the length of HMAC

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 10:59:12PM +0800, joeyli wrote: > On Thu, Jul 30, 2015 at 05:11:44PM +0100, Matt Fleming wrote: > > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > > To grab random numbers through EFI protocol as one of the entropies > > > source of

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:11:44PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > To grab random numbers through EFI protocol as one of the entropies > > source of swsusp key, this patch adds the logic for accessing EFI RNG > > (random number generator) prot

Re: [RFC PATCH 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:30:26PM +0200, Pavel Machek wrote: > > > For generating a messy number as a 20 bytes key, the codes in EFI > > stub gets u32 random number five time and every random number is > > rolling that last u32 random number as entropy. > > Parse error here. > Sorry for I didn'

Re: [RFC PATCH 03/16] x86/boot: Public getting random boot function

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:21:33PM +0200, Pavel Machek wrote: > Hi! > > > int cmdline_find_option_bool(const char *option); > > #endif > > > > +#if CONFIG_RANDOMIZE_BASE > > Not ifdef? > > > +extern u16 i8254(void); > > That's rather poor name for global function... This i8254 function onl

Re: [RFC PATCH 02/16] x86/efi: Add get and set variable to EFI services pointer table

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 04:19:58PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > Add get variable and set variable function to EFI services pointer > > table for supporting later functions of hibernate signature > > verification to keep the HMAC key in efi

Re: [RFC PATCH 01/16] PM / hibernate: define HMAC algorithm and digest size of swsusp

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:01:56PM +0200, Pavel Machek wrote: > On Thu 2015-07-16 22:25:15, Lee, Chun-Yi wrote: > > Using HMAC-SHA1 to be the HMAC algorithm of signing hibernate > > snapshot image. The digest size of HMAC-SHA1 is 160 bits (20 bytes), > > this size will be also applied to the length

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:28:53PM +0200, Pavel Machek wrote: > On Thu 2015-07-16 22:25:19, Lee, Chun-Yi wrote: > > To grab random numbers through EFI protocol as one of the entropies > > source of swsusp key, this patch adds the logic for accessing EFI RNG > > (random number generator) protocol th

Re: [RFC PATCH 04/16] x86/efi: Generating random number in EFI stub

2015-07-31 Thread joeyli
Hi Matt, Thanks for your review! On Thu, Jul 30, 2015 at 04:37:42PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > This patch adds the codes for generating random number array as the > > HMAC key that will used by later EFI stub codes. > > > > The origin

Re: [RFC PATCH 04/16] x86/efi: Generating random number in EFI stub

2015-07-31 Thread joeyli
Hi Pavel, Thanks for your review. On Tue, Jul 28, 2015 at 02:01:12PM +0200, Pavel Machek wrote: > Hi! > > > This patch adds the codes for generating random number array as the > > HMAC key that will used by later EFI stub codes. > > > > The original codes in efi_random copied from aslr and add

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 03:05:42PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 09:39:47PM, joeyli wrote: > > > > OK, understood! Thanks for your suggestion! > > > > But, I have a question about mapping Boot Code/Data to -4G area. I > > understand > > w

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 02:17:23PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 08:31:16PM, joeyli wrote: > > > > I think hibernate overwrite it. > > We absolutely must get a more detailed answer before going any further. > > Simply put, if we're remapping

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 01:09:16PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 07:18:19PM, joeyli wrote: > > > > In the above case, just simply accessing EFI variable through efivars to > > reproduce issue: > > > > linux-aiip:~ # hexdump -C > > /sys/f

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 07:09:59PM +0800, joeyli wrote: > On Thu, Jul 30, 2015 at 11:11:31AM +0100, Matt Fleming wrote: > > On Thu, 30 Jul, at 10:03:23AM, Borislav Petkov wrote: > > > On Thu, Jul 30, 2015 at 12:53:42AM -0700, H. Peter Anvin wrote: > > > > This c

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 11:11:31AM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 10:03:23AM, Borislav Petkov wrote: > > On Thu, Jul 30, 2015 at 12:53:42AM -0700, H. Peter Anvin wrote: > > > This changelog is at least partially incomprehensive. It also seems > > > more than a bit aggressive to exp

Re: [RFC PATCH 00/16] Signature verification of hibernate snapshot

2015-07-25 Thread joeyli
Hi Jiri, On Fri, Jul 24, 2015 at 07:08:18PM +0200, Jiri Kosina wrote: > On Thu, 16 Jul 2015, Lee, Chun-Yi wrote: > > > This patchset is the implementation of signature verification of hibernate > > snapshot image. The origin idea is from Jiri Kosina: Let EFI bootloader > > generate key-pair in UE

Re: [PATCH v3 1/8] x86: Kill E820_RESERVED_KERN

2015-03-08 Thread joeyli
On Sat, Mar 07, 2015 at 05:59:14PM -0800, David Rientjes wrote: > On Sat, 7 Mar 2015, Yinghai Lu wrote: > > > Now we are using memblock to do early resource reserver/allocation > > instead of using e820 map directly, and setup_data is reserved in > > memblock early already. > > Also kexec generate

Re: [PATCH v2 04/15] x86, kaslr: get kaslr_enabled back correctly

2015-03-04 Thread joeyli
Hi Yinghai, On Wed, Mar 04, 2015 at 10:12:58AM -0800, Yinghai Lu wrote: > On Wed, Mar 4, 2015 at 7:54 AM, Jiri Kosina wrote: > > > > > Also this 15-patch series needs to be separated into two patchsets. The > > whole series is not appropriate for -rc3, but this particular one at least > > is a r

Re: [PATCH] x86/efi: autoload efivars

2014-07-08 Thread joeyli
On Tue, Jul 08, 2014 at 01:19:42PM +0100, Ben Hutchings wrote: > On Tue, 2014-07-08 at 11:14 +0100, Matt Fleming wrote: > > On Tue, 08 Jul, at 11:00:58AM, Lee, Chun-Yi wrote: > [...] > > > --- a/arch/x86/platform/efi/efi.c > > > +++ b/arch/x86/platform/efi/efi.c > > > @@ -44,6 +44,7 @@ > > > #incl

Re: [RFT][PATCH] ACPI / init: Run acpi_early_init() before efi_enter_virtual_mode()

2014-01-14 Thread joeyli
於 二,2014-01-14 於 13:32 -0700,Toshi Kani 提到: > > > + acpi_early_init(); > > > timekeeping_init(); > > > time_init(); > > > sched_clock_postinit(); > > > @@ -641,7 +642,6 @@ asmlinkage void __init start_kernel(void) > > > > > > check_bugs(); > > > > > > -

  1   2   3   >