Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-25 Thread Jiri Kosina
On Sat, 25 Apr 2015, Minfei Huang wrote: > > diff --git a/arch/x86/include/asm/livepatch.h > > b/arch/x86/include/asm/livepatch.h > > index 2d29197..84a3247 100644 > > --- a/arch/x86/include/asm/livepatch.h > > +++ b/arch/x86/include/asm/livepatch.h > > @@ -23,8 +23,12 @@ > > > > #include > >

Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-25 Thread Jiri Kosina
On Fri, 24 Apr 2015, Josh Poimboeuf wrote: > > #if defined(CONFIG_RANDOMIZE_BASE) > > - /* KASLR is enabled, disregard old_addr from user */ > > - func->old_addr = 0; > > + /* If KASLR has been enabled, adjust old_addr accordingly */ > > + if (kaslr_enabled()) > > + func->old_ad

Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-25 Thread Jiri Kosina
On Fri, 24 Apr 2015, Josh Poimboeuf wrote: > > #if defined(CONFIG_RANDOMIZE_BASE) > > - /* KASLR is enabled, disregard old_addr from user */ > > - func->old_addr = 0; > > + /* If KASLR has been enabled, adjust old_addr accordingly */ > > + if (kaslr_enabled()) > > + func->old_ad

Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-24 Thread Minfei Huang
On 04/24/15 at 09:59P, Jiri Kosina wrote: > We give up old_addr hint from the coming patch module in cases when kernel > load > base has been randomized (as in such case, the coming module has no idea about > the exact randomization offset). > > We are currently too pessimistic, and give up immed

Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-24 Thread Josh Poimboeuf
On Fri, Apr 24, 2015 at 09:59:03PM +0200, Jiri Kosina wrote: > We give up old_addr hint from the coming patch module in cases when kernel > load > base has been randomized (as in such case, the coming module has no idea about > the exact randomization offset). > > We are currently too pessimistic

Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-24 Thread Josh Poimboeuf
On Fri, Apr 24, 2015 at 09:59:03PM +0200, Jiri Kosina wrote: > We give up old_addr hint from the coming patch module in cases when kernel > load > base has been randomized (as in such case, the coming module has no idea about > the exact randomization offset). > > We are currently too pessimistic

[PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-24 Thread Jiri Kosina
We give up old_addr hint from the coming patch module in cases when kernel load base has been randomized (as in such case, the coming module has no idea about the exact randomization offset). We are currently too pessimistic, and give up immediately as soon as CONFIG_RANDOMIZE_BASE is set; this d