Re: [PATCH v3] x86/power/64: Fix kernel text mapping corruption during image restoration (was: Re: ktime_get_ts64() splat during resume)

2016-06-27 Thread Borislav Petkov
On Mon, Jun 27, 2016 at 04:24:22PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > Subject: [PATCH v2] x86/power/64: Fix kernel text mapping corruption during > image restoration > > Logan Gunthorpe reports that hibernation stopped working reliably for >

Re: [PATCH v3] x86/power/64: Fix kernel text mapping corruption during image restoration (was: Re: ktime_get_ts64() splat during resume)

2016-06-27 Thread Borislav Petkov
On Mon, Jun 27, 2016 at 04:24:22PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > Subject: [PATCH v2] x86/power/64: Fix kernel text mapping corruption during > image restoration > > Logan Gunthorpe reports that hibernation stopped working reliably for > him after commit

[PATCH v3] x86/power/64: Fix kernel text mapping corruption during image restoration (was: Re: ktime_get_ts64() splat during resume)

2016-06-27 Thread Rafael J. Wysocki
On Tuesday, June 21, 2016 11:04:41 AM Kees Cook wrote: > On Mon, Jun 20, 2016 at 9:35 PM, Logan Gunthorpe wrote: > > Hey Rafael, > > > > This patch appears to be working on my laptop. Thanks. > > Same for me: resume still works with KASLR in my tests too. Unfortunately,

[PATCH v3] x86/power/64: Fix kernel text mapping corruption during image restoration (was: Re: ktime_get_ts64() splat during resume)

2016-06-27 Thread Rafael J. Wysocki
On Tuesday, June 21, 2016 11:04:41 AM Kees Cook wrote: > On Mon, Jun 20, 2016 at 9:35 PM, Logan Gunthorpe wrote: > > Hey Rafael, > > > > This patch appears to be working on my laptop. Thanks. > > Same for me: resume still works with KASLR in my tests too. Unfortunately, Boris still sees

Re: ktime_get_ts64() splat during resume

2016-06-21 Thread Rafael J. Wysocki
On Tuesday, June 21, 2016 11:04:41 AM Kees Cook wrote: > On Mon, Jun 20, 2016 at 9:35 PM, Logan Gunthorpe wrote: > > Hey Rafael, > > > > This patch appears to be working on my laptop. Thanks. > > Same for me: resume still works with KASLR in my tests too. Thanks for the

Re: ktime_get_ts64() splat during resume

2016-06-21 Thread Rafael J. Wysocki
On Tuesday, June 21, 2016 11:04:41 AM Kees Cook wrote: > On Mon, Jun 20, 2016 at 9:35 PM, Logan Gunthorpe wrote: > > Hey Rafael, > > > > This patch appears to be working on my laptop. Thanks. > > Same for me: resume still works with KASLR in my tests too. Thanks for the confirmation! Rafael

Re: ktime_get_ts64() splat during resume

2016-06-21 Thread Kees Cook
On Mon, Jun 20, 2016 at 9:35 PM, Logan Gunthorpe wrote: > Hey Rafael, > > This patch appears to be working on my laptop. Thanks. Same for me: resume still works with KASLR in my tests too. -Kees -- Kees Cook Chrome OS & Brillo Security

Re: ktime_get_ts64() splat during resume

2016-06-21 Thread Kees Cook
On Mon, Jun 20, 2016 at 9:35 PM, Logan Gunthorpe wrote: > Hey Rafael, > > This patch appears to be working on my laptop. Thanks. Same for me: resume still works with KASLR in my tests too. -Kees -- Kees Cook Chrome OS & Brillo Security

Re: ktime_get_ts64() splat during resume

2016-06-21 Thread Rafael J. Wysocki
On Monday, June 20, 2016 10:35:16 PM Logan Gunthorpe wrote: > Hey Rafael, Hi, > This patch appears to be working on my laptop. Thanks. Thanks for the confirmation! Rafael

Re: ktime_get_ts64() splat during resume

2016-06-21 Thread Rafael J. Wysocki
On Monday, June 20, 2016 10:35:16 PM Logan Gunthorpe wrote: > Hey Rafael, Hi, > This patch appears to be working on my laptop. Thanks. Thanks for the confirmation! Rafael

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Logan Gunthorpe
Hey Rafael, This patch appears to be working on my laptop. Thanks. Logan On 20/06/16 07:22 PM, Rafael J. Wysocki wrote: On Tuesday, June 21, 2016 02:05:59 AM Rafael J. Wysocki wrote: On Monday, June 20, 2016 11:15:18 PM Rafael J. Wysocki wrote: On Mon, Jun 20, 2016 at 8:29 PM, Linus

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Logan Gunthorpe
Hey Rafael, This patch appears to be working on my laptop. Thanks. Logan On 20/06/16 07:22 PM, Rafael J. Wysocki wrote: On Tuesday, June 21, 2016 02:05:59 AM Rafael J. Wysocki wrote: On Monday, June 20, 2016 11:15:18 PM Rafael J. Wysocki wrote: On Mon, Jun 20, 2016 at 8:29 PM, Linus

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Tuesday, June 21, 2016 02:05:59 AM Rafael J. Wysocki wrote: > On Monday, June 20, 2016 11:15:18 PM Rafael J. Wysocki wrote: > > On Mon, Jun 20, 2016 at 8:29 PM, Linus Torvalds > > wrote: > > > On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Tuesday, June 21, 2016 02:05:59 AM Rafael J. Wysocki wrote: > On Monday, June 20, 2016 11:15:18 PM Rafael J. Wysocki wrote: > > On Mon, Jun 20, 2016 at 8:29 PM, Linus Torvalds > > wrote: > > > On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki > > > wrote: > > >> > > >> Overall, we seem to

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Monday, June 20, 2016 11:15:18 PM Rafael J. Wysocki wrote: > On Mon, Jun 20, 2016 at 8:29 PM, Linus Torvalds > wrote: > > On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki > > wrote: > >> > >> Overall, we seem to be heading towards the

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Monday, June 20, 2016 11:15:18 PM Rafael J. Wysocki wrote: > On Mon, Jun 20, 2016 at 8:29 PM, Linus Torvalds > wrote: > > On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki > > wrote: > >> > >> Overall, we seem to be heading towards the "really weird" territory here. > > > > So the whole

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Mon, Jun 20, 2016 at 8:29 PM, Linus Torvalds wrote: > On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki wrote: >> >> Overall, we seem to be heading towards the "really weird" territory here. > > So the whole commit that Boris bisected down

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Mon, Jun 20, 2016 at 8:29 PM, Linus Torvalds wrote: > On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki wrote: >> >> Overall, we seem to be heading towards the "really weird" territory here. > > So the whole commit that Boris bisected down to is weird to me. > > Why isn't the temporary text

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Linus Torvalds
On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki wrote: > > Overall, we seem to be heading towards the "really weird" territory here. So the whole commit that Boris bisected down to is weird to me. Why isn't the temporary text mapping just set up unconditionally in the

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Linus Torvalds
On Mon, Jun 20, 2016 at 7:38 AM, Rafael J. Wysocki wrote: > > Overall, we seem to be heading towards the "really weird" territory here. So the whole commit that Boris bisected down to is weird to me. Why isn't the temporary text mapping just set up unconditionally in the temp_level4_pgt? Why

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Friday, June 17, 2016 11:03:46 PM Rafael J. Wysocki wrote: > On Fri, Jun 17, 2016 at 6:12 PM, Borislav Petkov wrote: > > On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: > >> A couple of questions: > >> - I guess this is reproducible 100% of the time? > > > >

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Friday, June 17, 2016 11:03:46 PM Rafael J. Wysocki wrote: > On Fri, Jun 17, 2016 at 6:12 PM, Borislav Petkov wrote: > > On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: > >> A couple of questions: > >> - I guess this is reproducible 100% of the time? > > > > Yap. > > > > I

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Monday, June 20, 2016 04:17:13 PM chenyu wrote: > On Fri, Jun 17, 2016 at 11:28 PM, Rafael J. Wysocki wrote: > > On Fri, Jun 17, 2016 at 4:33 PM, Borislav Petkov wrote: > >> Ok, > >> > >> bisect is done, full log below. > >> > >> Rafael, that fix > >> > >>

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread Rafael J. Wysocki
On Monday, June 20, 2016 04:17:13 PM chenyu wrote: > On Fri, Jun 17, 2016 at 11:28 PM, Rafael J. Wysocki wrote: > > On Fri, Jun 17, 2016 at 4:33 PM, Borislav Petkov wrote: > >> Ok, > >> > >> bisect is done, full log below. > >> > >> Rafael, that fix > >> > >> 70595b479ce1 ("x86/power/64: Fix

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread chenyu
On Fri, Jun 17, 2016 at 11:28 PM, Rafael J. Wysocki wrote: > On Fri, Jun 17, 2016 at 4:33 PM, Borislav Petkov wrote: >> Ok, >> >> bisect is done, full log below. >> >> Rafael, that fix >> >> 70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code

Re: ktime_get_ts64() splat during resume

2016-06-20 Thread chenyu
On Fri, Jun 17, 2016 at 11:28 PM, Rafael J. Wysocki wrote: > On Fri, Jun 17, 2016 at 4:33 PM, Borislav Petkov wrote: >> Ok, >> >> bisect is done, full log below. >> >> Rafael, that fix >> >> 70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code passes >> control to the image

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Rafael J. Wysocki
On Fri, Jun 17, 2016 at 11:03 PM, Rafael J. Wysocki wrote: > On Fri, Jun 17, 2016 at 6:12 PM, Borislav Petkov wrote: >> On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: >>> A couple of questions: >>> - I guess this is reproducible 100% of the

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Rafael J. Wysocki
On Fri, Jun 17, 2016 at 11:03 PM, Rafael J. Wysocki wrote: > On Fri, Jun 17, 2016 at 6:12 PM, Borislav Petkov wrote: >> On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: >>> A couple of questions: >>> - I guess this is reproducible 100% of the time? >> >> Yap. >> >> I took

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Rafael J. Wysocki
On Fri, Jun 17, 2016 at 6:12 PM, Borislav Petkov wrote: > On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: >> A couple of questions: >> - I guess this is reproducible 100% of the time? > > Yap. > > I took latest Linus + tip/master which has your commit. > >> - If

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Rafael J. Wysocki
On Fri, Jun 17, 2016 at 6:12 PM, Borislav Petkov wrote: > On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: >> A couple of questions: >> - I guess this is reproducible 100% of the time? > > Yap. > > I took latest Linus + tip/master which has your commit. > >> - If you do "echo

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: > A couple of questions: > - I guess this is reproducible 100% of the time? Yap. I took latest Linus + tip/master which has your commit. > - If you do "echo disk > /sys/power/state" instead of using s2disk, > does it still crash

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
On Fri, Jun 17, 2016 at 05:28:10PM +0200, Rafael J. Wysocki wrote: > A couple of questions: > - I guess this is reproducible 100% of the time? Yap. I took latest Linus + tip/master which has your commit. > - If you do "echo disk > /sys/power/state" instead of using s2disk, > does it still crash

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Rafael J. Wysocki
On Fri, Jun 17, 2016 at 4:33 PM, Borislav Petkov wrote: > Ok, > > bisect is done, full log below. > > Rafael, that fix > > 70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code passes > control to the image kernel") > > breaks s2disk here. It explodes during resume

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Rafael J. Wysocki
On Fri, Jun 17, 2016 at 4:33 PM, Borislav Petkov wrote: > Ok, > > bisect is done, full log below. > > Rafael, that fix > > 70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code passes > control to the image kernel") > > breaks s2disk here. It explodes during resume and a statically

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
Ok, bisect is done, full log below. Rafael, that fix 70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code passes control to the image kernel") breaks s2disk here. It explodes during resume and a statically allocated struct's member is NULL. See

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
Ok, bisect is done, full log below. Rafael, that fix 70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code passes control to the image kernel") breaks s2disk here. It explodes during resume and a statically allocated struct's member is NULL. See

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
On Fri, Jun 17, 2016 at 01:53:53PM +0200, Thomas Gleixner wrote: > It must be initialized otherwise you won't reach suspend. I have no idea how > that can happen. Btw, there's one other thing I'm seeing in the boot kernel, while it suspends. It hardly is related though: [ 42.046585] kvm:

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
On Fri, Jun 17, 2016 at 01:53:53PM +0200, Thomas Gleixner wrote: > It must be initialized otherwise you won't reach suspend. I have no idea how > that can happen. Btw, there's one other thing I'm seeing in the boot kernel, while it suspends. It hardly is related though: [ 42.046585] kvm:

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Thomas Gleixner
On Fri, 17 Jun 2016, Borislav Petkov wrote: > look what I've found this morning during resume: > > [ 45.746236] BUG: unable to handle kernel done. > [ 45.752542] NULL pointer dereference at 0001 > [ 45.752544] IP: [<0001>] 0x1 > static inline cycle_t

Re: ktime_get_ts64() splat during resume

2016-06-17 Thread Thomas Gleixner
On Fri, 17 Jun 2016, Borislav Petkov wrote: > look what I've found this morning during resume: > > [ 45.746236] BUG: unable to handle kernel done. > [ 45.752542] NULL pointer dereference at 0001 > [ 45.752544] IP: [<0001>] 0x1 > static inline cycle_t

ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
Hi guys, look what I've found this morning during resume: [ 45.732934] PM: Image restored successfully. [ 45.738064] PM: Basic memory bitmaps freed [ 45.742914] Restarting tasks ... [ 45.746236] BUG: unable to handle kernel done. [ 45.752542] NULL pointer dereference at

ktime_get_ts64() splat during resume

2016-06-17 Thread Borislav Petkov
Hi guys, look what I've found this morning during resume: [ 45.732934] PM: Image restored successfully. [ 45.738064] PM: Basic memory bitmaps freed [ 45.742914] Restarting tasks ... [ 45.746236] BUG: unable to handle kernel done. [ 45.752542] NULL pointer dereference at