Re: [PATCH v2 01/15] x86, kaslr: Use init_size instead of run_size

2015-03-06 Thread Yinghai Lu
On Fri, Mar 6, 2015 at 11:56 AM, Kees Cook keesc...@chromium.org wrote: On Fri, Mar 6, 2015 at 11:28 AM, Yinghai Lu ying...@kernel.org wrote: Okay, I've proven this to myself now. :) I think it would be valuable to call out that brk and bss are included in the _end calculation. For others: ...

[PATCH v2] efi/arm64: use UEFI for system reset and poweroff

2015-03-06 Thread Ard Biesheuvel
If UEFI Runtime Services are available, they are preferred over direct PSCI calls or other methods to reset the system. For the reset case, we need to hook into machine_restart(), as the arm_pm_restart function pointer may be overwritten by modules. Tested-by: Mark Rutland mark.rutl...@arm.com

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Borislav Petkov
On Fri, Mar 06, 2015 at 11:41:57AM +, Kweh, Hock Leong wrote: # cat /any/path/capsule.bin /sys/devices/platform/efi_capsule/capsule_load This is straight-forward and clean. or doing: # echo /any/path/capsule.bin /sys/devices/platform/efi_capsule/capsule_load This is strange and

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

2015-03-06 Thread Borislav Petkov
On Wed, Mar 04, 2015 at 01:32:53PM -0800, Yinghai Lu wrote: On Wed, Mar 4, 2015 at 12:00 PM, Ingo Molnar mi...@kernel.org wrote: It is totally unacceptable that you don't do proper analysis of the patches you submit, and that you don't bother writing proper, readable changelogs. Sorry,

Re: [PATCH] arm64/efi: use UEFI ResetSystem() Runtime Service for system reset

2015-03-06 Thread Ard Biesheuvel
On 5 March 2015 at 15:22, Mark Rutland mark.rutl...@arm.com wrote: Hi Ard, On Thu, Mar 05, 2015 at 12:51:11PM +, Ard Biesheuvel wrote: If UEFI Runtime Services are available, the ResetSystem() service should be preferred over direct PSCI calls or other methods to reset the system. The

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Kweh, Hock Leong
-Original Message- From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Friday, March 06, 2015 7:09 AM On Mar 5, 2015 1:19 AM, Kweh, Hock Leong hock.leong.k...@intel.com wrote: This really is not a big deal. User should cope with it. No, it's a big deal, and the user

Re: [PATCH v2 01/15] x86, kaslr: Use init_size instead of run_size

2015-03-06 Thread Borislav Petkov
On Wed, Mar 04, 2015 at 12:00:34AM -0800, Yinghai Lu wrote: commit e6023367d779 (x86, kaslr: Prevent .bss from overlaping initrd) introduced one run_size for kaslr. We do not need to have home grown run_size. We should use real runtime size (include copy/decompress) aka init_size Why?

Re: [PATCH v2 02/15] x86, boot: move ZO to end of buffer

2015-03-06 Thread Borislav Petkov
On Wed, Mar 04, 2015 at 12:00:35AM -0800, Yinghai Lu wrote: bp found data from boot stage can not be used kernel stage. Actually those data area is overlapped with VO kernel bss stage, and clear_bss() VO kernel bss stage? I'm sure you can think of a better explanation. Right now I'm

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Kweh, Hock Leong
-Original Message- From: Borislav Petkov [mailto:b...@alien8.de] Sent: Friday, March 06, 2015 4:14 PM On Thu, Mar 05, 2015 at 03:08:42PM -0800, Andy Lutomirski wrote: No. Only root should be able to load capsules, but even root may not be able to write to /lib. So basically

Re: [PATCH v2 01/15] x86, kaslr: Use init_size instead of run_size

2015-03-06 Thread Yinghai Lu
On Fri, Mar 6, 2015 at 5:55 AM, Borislav Petkov b...@alien8.de wrote: On Wed, Mar 04, 2015 at 12:00:34AM -0800, Yinghai Lu wrote: commit e6023367d779 (x86, kaslr: Prevent .bss from overlaping initrd) introduced one run_size for kaslr. We do not need to have home grown run_size. We should

Re: [PATCH v2 01/15] x86, kaslr: Use init_size instead of run_size

2015-03-06 Thread Kees Cook
On Fri, Mar 6, 2015 at 10:44 AM, Yinghai Lu ying...@kernel.org wrote: On Fri, Mar 6, 2015 at 5:55 AM, Borislav Petkov b...@alien8.de wrote: On Wed, Mar 04, 2015 at 12:00:34AM -0800, Yinghai Lu wrote: commit e6023367d779 (x86, kaslr: Prevent .bss from overlaping initrd) introduced one run_size

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

2015-03-06 Thread Yinghai Lu
On Fri, Mar 6, 2015 at 5:33 AM, Borislav Petkov b...@suse.de wrote: Please use checkpatch before submitting patches: WARNING: please, no spaces at the start of a line #71: FILE: arch/x86/kernel/setup.c:433: +unsigned char *data;$ WARNING: please, no spaces at the start of a line #72:

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Andy Lutomirski
On Mar 6, 2015 4:20 AM, Kweh, Hock Leong hock.leong.k...@intel.com wrote: -Original Message- From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Friday, March 06, 2015 7:09 AM On Mar 5, 2015 1:19 AM, Kweh, Hock Leong hock.leong.k...@intel.com wrote: This really is

Re: [PATCH v2 01/15] x86, kaslr: Use init_size instead of run_size

2015-03-06 Thread Yinghai Lu
On Fri, Mar 6, 2015 at 10:55 AM, Kees Cook keesc...@chromium.org wrote: On Fri, Mar 6, 2015 at 10:44 AM, Yinghai Lu ying...@kernel.org wrote: I don't see how bss and brk are related to these sizes. Can you explain how bss, brk, and initrd factor into these sizes? Those were what run_size was

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

2015-03-06 Thread Yinghai Lu
On Fri, Mar 6, 2015 at 11:50 AM, Yinghai Lu ying...@kernel.org wrote: On Fri, Mar 6, 2015 at 5:33 AM, Borislav Petkov b...@suse.de wrote: However, the setup_data linked list and thus the element which contains kaslr_enabled is chained together using physical addresses. At the time when we

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

2015-03-06 Thread Yinghai Lu
On Fri, Mar 6, 2015 at 5:33 AM, Borislav Petkov b...@suse.de wrote: However, the setup_data linked list and thus the element which contains kaslr_enabled is chained together using physical addresses. At the time when we access it in the kernel proper, we're already running with paging

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Peter Jones
On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: Hi All, After some internal discussion and re-design prototyping testing on this efi capsule interface kernel module, I would like to start a discussion here on the new idea and wish to get input for the implementation and

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Roy Franz
On Fri, Mar 6, 2015 at 1:39 PM, Peter Jones pjo...@redhat.com wrote: On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: Hi All, After some internal discussion and re-design prototyping testing on this efi capsule interface kernel module, I would like to start a discussion

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Peter Jones
On Fri, Mar 06, 2015 at 01:49:20PM -0800, Roy Franz wrote: On Fri, Mar 6, 2015 at 1:39 PM, Peter Jones pjo...@redhat.com wrote: On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: Hi All, After some internal discussion and re-design prototyping testing on this efi capsule

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Borislav Petkov
On Thu, Mar 05, 2015 at 03:08:42PM -0800, Andy Lutomirski wrote: No. Only root should be able to load capsules, but even root may not be able to write to /lib. So basically what we want to do is: # cat /any/path/to/efi/capsule/accessible/to/root/efi_capsule.img /sys/firmware/efi/update Now