2013-10-27 10:50:17

by Borislav Petkov

[permalink] [raw]
Subject: Re: [patch 2/6] x86 efi: reserve boot service fix

On Sun, Oct 27, 2013 at 11:47:15AM +0800, [email protected] wrote:
> Current code check boot service region with kernel text region by:
> start+size >= __pa_symbol(_text)
> The end of the above region should be start + size - 1 instead.
>
> I see this problem in ovmf + Fedora 19 grub boot:
> text start: 1000000 md start: 800000 md size: 800000
>
> Signed-off-by: Dave Young <[email protected]>

Acked-by: Borislav Petkov <[email protected]>

Btw, Matt, this being a bugfix and all, shouldn't it be tagged for
stable?

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--


2013-10-27 20:31:08

by Matt Fleming

[permalink] [raw]
Subject: Re: [patch 2/6] x86 efi: reserve boot service fix

On Sun, 27 Oct, at 11:50:09AM, Borislav Petkov wrote:
> On Sun, Oct 27, 2013 at 11:47:15AM +0800, [email protected] wrote:
> > Current code check boot service region with kernel text region by:
> > start+size >= __pa_symbol(_text)
> > The end of the above region should be start + size - 1 instead.
> >
> > I see this problem in ovmf + Fedora 19 grub boot:
> > text start: 1000000 md start: 800000 md size: 800000
> >
> > Signed-off-by: Dave Young <[email protected]>
>
> Acked-by: Borislav Petkov <[email protected]>
>
> Btw, Matt, this being a bugfix and all, shouldn't it be tagged for
> stable?

Well that depends. Dave, am I correct in thinking that you only noticed
this bug when writing kexec support? I'm inclined not to bother with a
stable tag if no one has ever noticed any fallout from this bug until
now.

--
Matt Fleming, Intel Open Source Technology Center

2013-10-28 01:19:15

by Dave Young

[permalink] [raw]
Subject: Re: [patch 2/6] x86 efi: reserve boot service fix

On 10/27/13 at 08:30pm, Matt Fleming wrote:
> On Sun, 27 Oct, at 11:50:09AM, Borislav Petkov wrote:
> > On Sun, Oct 27, 2013 at 11:47:15AM +0800, [email protected] wrote:
> > > Current code check boot service region with kernel text region by:
> > > start+size >= __pa_symbol(_text)
> > > The end of the above region should be start + size - 1 instead.
> > >
> > > I see this problem in ovmf + Fedora 19 grub boot:
> > > text start: 1000000 md start: 800000 md size: 800000
> > >
> > > Signed-off-by: Dave Young <[email protected]>
> >
> > Acked-by: Borislav Petkov <[email protected]>
> >
> > Btw, Matt, this being a bugfix and all, shouldn't it be tagged for
> > stable?
>
> Well that depends. Dave, am I correct in thinking that you only noticed
> this bug when writing kexec support? I'm inclined not to bother with a
> stable tag if no one has ever noticed any fallout from this bug until
> now.

There should be some people see below message with non-kexec kernel:
"Could not reserve boot range ..."
But it's hard for them to notice the bad functionality because it's only
one mem range which might be not the boot range what SetVirtualAddressMap need

2013-10-28 08:44:47

by Borislav Petkov

[permalink] [raw]
Subject: Re: [patch 2/6] x86 efi: reserve boot service fix

On Mon, Oct 28, 2013 at 09:18:24AM +0800, Dave Young wrote:
> There should be some people see below message with non-kexec kernel:
> "Could not reserve boot range ..."

I can find one other report like that: https://lkml.org/lkml/2013/7/16/309

[ 0.000000] efi: Could not reserve boot range [0x0000000000-0x0000000fff]

for

efi: mem00: type=3, attr=0xf, range=[0x0000000000000000-0x0000000000001000) (0MB)

which is EFI_BOOT_SERVICES_CODE and

efi: Could not reserve boot range [0x000005f000-0x000009ffff]

for

efi: mem06: type=3, attr=0xf, range=[0x000000000005f000-0x00000000000a0000) (0MB)

which is of the same type.

> But it's hard for them to notice the bad functionality because
> it's only one mem range which might be not the boot range what
> SetVirtualAddressMap need

Right.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

2013-10-28 10:27:14

by Matt Fleming

[permalink] [raw]
Subject: Re: [patch 2/6] x86 efi: reserve boot service fix

On Mon, 28 Oct, at 09:44:41AM, Borislav Petkov wrote:
> On Mon, Oct 28, 2013 at 09:18:24AM +0800, Dave Young wrote:
> > There should be some people see below message with non-kexec kernel:
> > "Could not reserve boot range ..."
>
> I can find one other report like that: https://lkml.org/lkml/2013/7/16/309
>
> [ 0.000000] efi: Could not reserve boot range [0x0000000000-0x0000000fff]
>
> for
>
> efi: mem00: type=3, attr=0xf, range=[0x0000000000000000-0x0000000000001000) (0MB)
>
> which is EFI_BOOT_SERVICES_CODE and
>
> efi: Could not reserve boot range [0x000005f000-0x000009ffff]
>
> for
>
> efi: mem06: type=3, attr=0xf, range=[0x000000000005f000-0x00000000000a0000) (0MB)
>
> which is of the same type.

But that doesn't look like the issue that the user was complaining
about. Rather, it's that the higher EFI regions are unable to be mapped
because of the user's mem= kernel parameter setting.

However, even though this bug isn't the main focus of the above report,
since people are hitting it (and since the fix is trivial), I agree it's
worth tagging for stable.

--
Matt Fleming, Intel Open Source Technology Center