All of lore.kernel.org
 help / color / mirror / Atom feed
* [kexec-tools PATCH] x86: extend kernel text size up to 1GB
@ 2014-03-12  3:13 WANG Chao
  2014-03-14  6:12 ` Dave Young
  0 siblings, 1 reply; 9+ messages in thread
From: WANG Chao @ 2014-03-12  3:13 UTC (permalink / raw)
  To: kexec

Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
address from /proc/kcore when the offset is >512M.

Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.

Signed-off-by: WANG Chao <chaowang@redhat.com>
---
 kexec/arch/i386/crashdump-x86.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
index e68b626..a5b2dfd 100644
--- a/kexec/arch/i386/crashdump-x86.h
+++ b/kexec/arch/i386/crashdump-x86.h
@@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
 #define X86_64_MAXMEM        		0x3fffffffffffUL
 
 /* Kernel text size */
-#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
+#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
 
 #define CRASH_MAX_MEMMAP_NR	CRASH_MAX_MEMORY_RANGES
 #define CRASH_MAX_MEMORY_RANGES	(MAX_MEMORY_RANGES + 2)
-- 
1.8.5.3


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-12  3:13 [kexec-tools PATCH] x86: extend kernel text size up to 1GB WANG Chao
@ 2014-03-14  6:12 ` Dave Young
  2014-03-14  6:47   ` Dave Young
  0 siblings, 1 reply; 9+ messages in thread
From: Dave Young @ 2014-03-14  6:12 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec, ebiederm, vgoyal

On 03/12/14 at 11:13am, WANG Chao wrote:
> Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> address from /proc/kcore when the offset is >512M.
> 
> Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> 
> Signed-off-by: WANG Chao <chaowang@redhat.com>
> ---
>  kexec/arch/i386/crashdump-x86.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> index e68b626..a5b2dfd 100644
> --- a/kexec/arch/i386/crashdump-x86.h
> +++ b/kexec/arch/i386/crashdump-x86.h
> @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
>  #define X86_64_MAXMEM        		0x3fffffffffffUL
>  
>  /* Kernel text size */
> -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)

Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE

Previously I did not find this problem probably because kernel text happen to randomized
to a address < 512M..

BTW since we can get physical start and size from /proc/iomem, why not just get
vaddr by phys_start + PAGE_OFFSET.

>  
>  #define CRASH_MAX_MEMMAP_NR	CRASH_MAX_MEMORY_RANGES
>  #define CRASH_MAX_MEMORY_RANGES	(MAX_MEMORY_RANGES + 2)
> -- 
> 1.8.5.3
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-14  6:12 ` Dave Young
@ 2014-03-14  6:47   ` Dave Young
  2014-03-14  7:03     ` WANG Chao
  0 siblings, 1 reply; 9+ messages in thread
From: Dave Young @ 2014-03-14  6:47 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec, ebiederm, vgoyal

On 03/14/14 at 02:12pm, Dave Young wrote:
> On 03/12/14 at 11:13am, WANG Chao wrote:
> > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > address from /proc/kcore when the offset is >512M.
> > 
> > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > 
> > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > ---
> >  kexec/arch/i386/crashdump-x86.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > index e68b626..a5b2dfd 100644
> > --- a/kexec/arch/i386/crashdump-x86.h
> > +++ b/kexec/arch/i386/crashdump-x86.h
> > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> >  
> >  /* Kernel text size */
> > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> 
> Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE

I means check ktext with range <1G - 1.5G>

> 
> Previously I did not find this problem probably because kernel text happen to randomized
> to a address < 512M..
> 
> BTW since we can get physical start and size from /proc/iomem, why not just get
> vaddr by phys_start + PAGE_OFFSET.

Ignore above question, /proc/iomem can not get right end addr which includes not only code
and data.

Current kaslr has a limit up value 0x40000000 in Kconfig so the biggest value is 1G, but
it could be change to other value in the future. It will be ideal that we can export the
end addr somewhere for example /proc/iomem. 

> 
> >  
> >  #define CRASH_MAX_MEMMAP_NR	CRASH_MAX_MEMORY_RANGES
> >  #define CRASH_MAX_MEMORY_RANGES	(MAX_MEMORY_RANGES + 2)
> > -- 
> > 1.8.5.3
> > 
> > 
> > _______________________________________________
> > kexec mailing list
> > kexec@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-14  6:47   ` Dave Young
@ 2014-03-14  7:03     ` WANG Chao
  2014-03-14  7:08       ` Dave Young
  0 siblings, 1 reply; 9+ messages in thread
From: WANG Chao @ 2014-03-14  7:03 UTC (permalink / raw)
  To: Dave Young; +Cc: kexec, ebiederm, vgoyal

On 03/14/14 at 02:47pm, Dave Young wrote:
> On 03/14/14 at 02:12pm, Dave Young wrote:
> > On 03/12/14 at 11:13am, WANG Chao wrote:
> > > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > > address from /proc/kcore when the offset is >512M.
> > > 
> > > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > > 
> > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > ---
> > >  kexec/arch/i386/crashdump-x86.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > > index e68b626..a5b2dfd 100644
> > > --- a/kexec/arch/i386/crashdump-x86.h
> > > +++ b/kexec/arch/i386/crashdump-x86.h
> > > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> > >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> > >  
> > >  /* Kernel text size */
> > > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> > 
> > Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> > and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE
> 
> I means check ktext with range <1G - 1.5G>

You're right.

I think it's fine adding new macro X86_64_RANDOMIZE_BASE_MAX_OFFSET
as 0x40000000 (1G) and doing the following check:

(start >= X86_64__START_KERNEL_map) &&
 (start <= X86_64__START_KERNEL_map + X86_64_RANDOMIZE_MAX_BASE_OFFSET) &&
 (end - start <= X86_64_KERNEL_TEXT_SIZE)

What do you think?

> 
> > 
> > Previously I did not find this problem probably because kernel text happen to randomized
> > to a address < 512M..
> > 
> > BTW since we can get physical start and size from /proc/iomem, why not just get
> > vaddr by phys_start + PAGE_OFFSET.
> 
> Ignore above question, /proc/iomem can not get right end addr which includes not only code
> and data.
> 
> Current kaslr has a limit up value 0x40000000 in Kconfig so the biggest value is 1G, but
> it could be change to other value in the future. It will be ideal that we can export the
> end addr somewhere for example /proc/iomem. 

We have to use kcore to determine start/end until something happens in
/proc/iomem or elsewhere.

Thanks
WANG Chao

> 
> > 
> > >  
> > >  #define CRASH_MAX_MEMMAP_NR	CRASH_MAX_MEMORY_RANGES
> > >  #define CRASH_MAX_MEMORY_RANGES	(MAX_MEMORY_RANGES + 2)
> > > -- 
> > > 1.8.5.3
> > > 
> > > 
> > > _______________________________________________
> > > kexec mailing list
> > > kexec@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-14  7:03     ` WANG Chao
@ 2014-03-14  7:08       ` Dave Young
  2014-03-14  7:29         ` WANG Chao
  0 siblings, 1 reply; 9+ messages in thread
From: Dave Young @ 2014-03-14  7:08 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec, ebiederm, vgoyal

On 03/14/14 at 03:03pm, WANG Chao wrote:
> On 03/14/14 at 02:47pm, Dave Young wrote:
> > On 03/14/14 at 02:12pm, Dave Young wrote:
> > > On 03/12/14 at 11:13am, WANG Chao wrote:
> > > > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > > > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > > > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > > > address from /proc/kcore when the offset is >512M.
> > > > 
> > > > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > > > 
> > > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > > ---
> > > >  kexec/arch/i386/crashdump-x86.h | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > > > index e68b626..a5b2dfd 100644
> > > > --- a/kexec/arch/i386/crashdump-x86.h
> > > > +++ b/kexec/arch/i386/crashdump-x86.h
> > > > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> > > >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> > > >  
> > > >  /* Kernel text size */
> > > > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > > > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> > > 
> > > Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> > > and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE
> > 
> > I means check ktext with range <1G - 1.5G>
> 
> You're right.
> 
> I think it's fine adding new macro X86_64_RANDOMIZE_BASE_MAX_OFFSET
> as 0x40000000 (1G) and doing the following check:
> 
> (start >= X86_64__START_KERNEL_map) &&
>  (start <= X86_64__START_KERNEL_map + X86_64_RANDOMIZE_MAX_BASE_OFFSET) &&
>  (end - start <= X86_64_KERNEL_TEXT_SIZE)

end - start < X86_64_KERNEL_TEXT_SIZE should be right, other wise I'm fine.

Thanks
Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-14  7:08       ` Dave Young
@ 2014-03-14  7:29         ` WANG Chao
  2014-03-20  3:44           ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: WANG Chao @ 2014-03-14  7:29 UTC (permalink / raw)
  To: Dave Young; +Cc: kexec, ebiederm, vgoyal

On 03/14/14 at 03:08pm, Dave Young wrote:
> On 03/14/14 at 03:03pm, WANG Chao wrote:
> > On 03/14/14 at 02:47pm, Dave Young wrote:
> > > On 03/14/14 at 02:12pm, Dave Young wrote:
> > > > On 03/12/14 at 11:13am, WANG Chao wrote:
> > > > > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > > > > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > > > > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > > > > address from /proc/kcore when the offset is >512M.
> > > > > 
> > > > > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > > > > 
> > > > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > > > ---
> > > > >  kexec/arch/i386/crashdump-x86.h | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > > > > index e68b626..a5b2dfd 100644
> > > > > --- a/kexec/arch/i386/crashdump-x86.h
> > > > > +++ b/kexec/arch/i386/crashdump-x86.h
> > > > > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> > > > >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> > > > >  
> > > > >  /* Kernel text size */
> > > > > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > > > > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> > > > 
> > > > Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> > > > and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE
> > > 
> > > I means check ktext with range <1G - 1.5G>
> > 
> > You're right.
> > 
> > I think it's fine adding new macro X86_64_RANDOMIZE_BASE_MAX_OFFSET
> > as 0x40000000 (1G) and doing the following check:
> > 
> > (start >= X86_64__START_KERNEL_map) &&
> >  (start <= X86_64__START_KERNEL_map + X86_64_RANDOMIZE_MAX_BASE_OFFSET) &&
> >  (end - start <= X86_64_KERNEL_TEXT_SIZE)
> 
> end - start < X86_64_KERNEL_TEXT_SIZE should be right, other wise I'm fine.

Right. size = end - start + 1.

I'll post v2.

Thanks
WANG Chao

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-14  7:29         ` WANG Chao
@ 2014-03-20  3:44           ` Simon Horman
  2014-03-20  4:53             ` WANG Chao
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2014-03-20  3:44 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec, Dave Young, ebiederm, vgoyal

On Fri, Mar 14, 2014 at 03:29:29PM +0800, WANG Chao wrote:
> On 03/14/14 at 03:08pm, Dave Young wrote:
> > On 03/14/14 at 03:03pm, WANG Chao wrote:
> > > On 03/14/14 at 02:47pm, Dave Young wrote:
> > > > On 03/14/14 at 02:12pm, Dave Young wrote:
> > > > > On 03/12/14 at 11:13am, WANG Chao wrote:
> > > > > > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > > > > > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > > > > > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > > > > > address from /proc/kcore when the offset is >512M.
> > > > > > 
> > > > > > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > > > > > 
> > > > > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > > > > ---
> > > > > >  kexec/arch/i386/crashdump-x86.h | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > > > > > index e68b626..a5b2dfd 100644
> > > > > > --- a/kexec/arch/i386/crashdump-x86.h
> > > > > > +++ b/kexec/arch/i386/crashdump-x86.h
> > > > > > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> > > > > >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> > > > > >  
> > > > > >  /* Kernel text size */
> > > > > > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > > > > > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> > > > > 
> > > > > Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> > > > > and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE
> > > > 
> > > > I means check ktext with range <1G - 1.5G>
> > > 
> > > You're right.
> > > 
> > > I think it's fine adding new macro X86_64_RANDOMIZE_BASE_MAX_OFFSET
> > > as 0x40000000 (1G) and doing the following check:
> > > 
> > > (start >= X86_64__START_KERNEL_map) &&
> > >  (start <= X86_64__START_KERNEL_map + X86_64_RANDOMIZE_MAX_BASE_OFFSET) &&
> > >  (end - start <= X86_64_KERNEL_TEXT_SIZE)
> > 
> > end - start < X86_64_KERNEL_TEXT_SIZE should be right, other wise I'm fine.
> 
> Right. size = end - start + 1.
> 
> I'll post v2.

Hi,

I'd like to enquire about the status of this as I don't see v2 in my inbox.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-20  3:44           ` Simon Horman
@ 2014-03-20  4:53             ` WANG Chao
  2014-03-20  5:49               ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: WANG Chao @ 2014-03-20  4:53 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec, Dave Young, ebiederm, vgoyal

On 03/20/14 at 12:44pm, Simon Horman wrote:
> On Fri, Mar 14, 2014 at 03:29:29PM +0800, WANG Chao wrote:
> > On 03/14/14 at 03:08pm, Dave Young wrote:
> > > On 03/14/14 at 03:03pm, WANG Chao wrote:
> > > > On 03/14/14 at 02:47pm, Dave Young wrote:
> > > > > On 03/14/14 at 02:12pm, Dave Young wrote:
> > > > > > On 03/12/14 at 11:13am, WANG Chao wrote:
> > > > > > > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > > > > > > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > > > > > > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > > > > > > address from /proc/kcore when the offset is >512M.
> > > > > > > 
> > > > > > > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > > > > > > 
> > > > > > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > > > > > ---
> > > > > > >  kexec/arch/i386/crashdump-x86.h | 2 +-
> > > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > > 
> > > > > > > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > > > > > > index e68b626..a5b2dfd 100644
> > > > > > > --- a/kexec/arch/i386/crashdump-x86.h
> > > > > > > +++ b/kexec/arch/i386/crashdump-x86.h
> > > > > > > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> > > > > > >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> > > > > > >  
> > > > > > >  /* Kernel text size */
> > > > > > > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > > > > > > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> > > > > > 
> > > > > > Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> > > > > > and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE
> > > > > 
> > > > > I means check ktext with range <1G - 1.5G>
> > > > 
> > > > You're right.
> > > > 
> > > > I think it's fine adding new macro X86_64_RANDOMIZE_BASE_MAX_OFFSET
> > > > as 0x40000000 (1G) and doing the following check:
> > > > 
> > > > (start >= X86_64__START_KERNEL_map) &&
> > > >  (start <= X86_64__START_KERNEL_map + X86_64_RANDOMIZE_MAX_BASE_OFFSET) &&
> > > >  (end - start <= X86_64_KERNEL_TEXT_SIZE)
> > > 
> > > end - start < X86_64_KERNEL_TEXT_SIZE should be right, other wise I'm fine.
> > 
> > Right. size = end - start + 1.
> > 
> > I'll post v2.
> 
> Hi,
> 
> I'd like to enquire about the status of this as I don't see v2 in my inbox.

Hi, Simon

I'd like to hold off for such fix. Fixing kaslr issue is not trivial
as I thought.

You can find the discussion on kexec mail list or here:
http://thread.gmane.org/gmane.linux.kernel.kexec/11103

Sorry. I'll CC you next time.

Thanks
WANG Chao

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
  2014-03-20  4:53             ` WANG Chao
@ 2014-03-20  5:49               ` Simon Horman
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2014-03-20  5:49 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec, Dave Young, ebiederm, vgoyal

On Thu, Mar 20, 2014 at 12:53:35PM +0800, WANG Chao wrote:
> On 03/20/14 at 12:44pm, Simon Horman wrote:
> > On Fri, Mar 14, 2014 at 03:29:29PM +0800, WANG Chao wrote:
> > > On 03/14/14 at 03:08pm, Dave Young wrote:
> > > > On 03/14/14 at 03:03pm, WANG Chao wrote:
> > > > > On 03/14/14 at 02:47pm, Dave Young wrote:
> > > > > > On 03/14/14 at 02:12pm, Dave Young wrote:
> > > > > > > On 03/12/14 at 11:13am, WANG Chao wrote:
> > > > > > > > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > > > > > > > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > > > > > > > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > > > > > > > address from /proc/kcore when the offset is >512M.
> > > > > > > > 
> > > > > > > > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > > > > > > > 
> > > > > > > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > > > > > > ---
> > > > > > > >  kexec/arch/i386/crashdump-x86.h | 2 +-
> > > > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > > > 
> > > > > > > > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > > > > > > > index e68b626..a5b2dfd 100644
> > > > > > > > --- a/kexec/arch/i386/crashdump-x86.h
> > > > > > > > +++ b/kexec/arch/i386/crashdump-x86.h
> > > > > > > > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> > > > > > > >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> > > > > > > >  
> > > > > > > >  /* Kernel text size */
> > > > > > > > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > > > > > > > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> > > > > > > 
> > > > > > > Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> > > > > > > and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE
> > > > > > 
> > > > > > I means check ktext with range <1G - 1.5G>
> > > > > 
> > > > > You're right.
> > > > > 
> > > > > I think it's fine adding new macro X86_64_RANDOMIZE_BASE_MAX_OFFSET
> > > > > as 0x40000000 (1G) and doing the following check:
> > > > > 
> > > > > (start >= X86_64__START_KERNEL_map) &&
> > > > >  (start <= X86_64__START_KERNEL_map + X86_64_RANDOMIZE_MAX_BASE_OFFSET) &&
> > > > >  (end - start <= X86_64_KERNEL_TEXT_SIZE)
> > > > 
> > > > end - start < X86_64_KERNEL_TEXT_SIZE should be right, other wise I'm fine.
> > > 
> > > Right. size = end - start + 1.
> > > 
> > > I'll post v2.
> > 
> > Hi,
> > 
> > I'd like to enquire about the status of this as I don't see v2 in my inbox.
> 
> Hi, Simon
> 
> I'd like to hold off for such fix. Fixing kaslr issue is not trivial
> as I thought.
> 
> You can find the discussion on kexec mail list or here:
> http://thread.gmane.org/gmane.linux.kernel.kexec/11103
> 
> Sorry. I'll CC you next time.

No problem.

Please repost this patch once a fix is ready.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-20  5:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12  3:13 [kexec-tools PATCH] x86: extend kernel text size up to 1GB WANG Chao
2014-03-14  6:12 ` Dave Young
2014-03-14  6:47   ` Dave Young
2014-03-14  7:03     ` WANG Chao
2014-03-14  7:08       ` Dave Young
2014-03-14  7:29         ` WANG Chao
2014-03-20  3:44           ` Simon Horman
2014-03-20  4:53             ` WANG Chao
2014-03-20  5:49               ` Simon Horman

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.