From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Kees Cook <keescook@chromium.org>
Cc: Logan Gunthorpe <logang@deltatee.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Stephen Smalley <sds@tycho.nsa.gov>,
Ingo Molnar <mingo@kernel.org>, Ingo Molnar <mingo@redhat.com>,
the arch/x86 maintainers <x86@kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
Denys Vlasenko <dvlasenk@redhat.com>,
Brian Gerst <brgerst@gmail.com>
Subject: Re: PROBLEM: Resume form hibernate broken by setting NX on gap
Date: Sat, 11 Jun 2016 00:29:59 +0200 [thread overview]
Message-ID: <6452365.7hjtWaBW7Y@vostro.rjw.lan> (raw)
In-Reply-To: <34107887.ATgOLutrT1@vostro.rjw.lan>
On Friday, June 10, 2016 11:27:29 PM Rafael J. Wysocki wrote:
> On Friday, June 10, 2016 11:09:22 AM Kees Cook wrote:
> > On Thu, Jun 9, 2016 at 9:14 PM, Logan Gunthorpe <logang@deltatee.com> wrote:
> > > Hey,
> > >
> > > I've still be trying to figure this out as I have time.
> > >
> > > I tried printing a couple restore addresses and nothing I can find seems
> > > anywhere near the rodata/ex_table boundary.
> > >
> > > I tried with the (badly formatted) below and got the following. Nothing too
> > > surprising. I've attached a kallsyms that matches the kernel for reference.
> > >
> > > restore_code: ffff880157c3b000
> > > jump_addr: ffffffff81446be0
> > >
> > >
> > > diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
> > > index 009947d..6efedb7 100644
> > > --- a/arch/x86/power/hibernate_64.c
> > > +++ b/arch/x86/power/hibernate_64.c
> > > @@ -92,6 +92,9 @@ int swsusp_arch_resume(void)
> > > memcpy(relocated_restore_code, &core_restore_code,
> > > &restore_registers - &core_restore_code);
> > >
> > > + pr_info("restore_code: %p\n", relocated_restore_code);
> > > + pr_info("jump_addr: %lx\n", restore_jump_address);
> > > +
> >
> > Also interesting would be the "relocated_restore_code" address, as
> > well as a dump of /sys/kernel/debug/kernel_page_tables (from
> > CONFIG_X86_PTDUMP).
> >
> > I'm baffled by the problem, but the best I can understand is the the
> > relocated_restore_code range isn't executable (which should be visible
> > from finding it in /sys/kernel/debug/kernel_page_tables), but I don't
> > see how to solve that since my original patch didn't work.
> >
> > Rafael, is this something you have time to look at quickly?
>
> Well, not really, but I'll do my best to look at it in the next few days.
OK, I have a theory, but I need a bit of help.
This may be a dumb question, but I don't quite remember the answer readily.
Given a physical address, how do I get the corresponding virtual one under
the kernel identity mapping?
Thanks,
Rafael
next prev parent reply other threads:[~2016-06-10 22:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <573DF82D.50006@deltatee.com>
2016-05-20 7:15 ` Ingo Molnar
2016-05-20 11:34 ` Rafael J. Wysocki
2016-05-20 13:56 ` Stephen Smalley
2016-05-20 21:46 ` Rafael J. Wysocki
2016-05-20 21:59 ` Kees Cook
2016-05-20 22:16 ` Kees Cook
[not found] ` <573FC081.20006@deltatee.com>
2016-05-21 16:39 ` Kees Cook
[not found] ` <575A3E95.5090100@deltatee.com>
2016-06-10 18:09 ` Kees Cook
2016-06-10 18:16 ` Logan Gunthorpe
2016-06-10 18:18 ` Kees Cook
2016-06-10 21:27 ` Rafael J. Wysocki
2016-06-10 22:29 ` Rafael J. Wysocki [this message]
2016-06-10 22:28 ` Logan Gunthorpe
2016-06-10 22:33 ` Rafael J. Wysocki
2016-06-11 0:13 ` Rafael J. Wysocki
2016-06-11 1:47 ` Rafael J. Wysocki
2016-06-11 11:48 ` Rafael J. Wysocki
2016-06-11 16:35 ` Logan Gunthorpe
2016-06-11 17:39 ` Logan Gunthorpe
2016-06-12 1:05 ` Rafael J. Wysocki
2016-06-12 4:48 ` Logan Gunthorpe
2016-06-12 14:31 ` Rafael J. Wysocki
2016-06-12 16:11 ` Logan Gunthorpe
2016-06-13 13:43 ` Rafael J. Wysocki
2016-06-10 22:11 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6452365.7hjtWaBW7Y@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=rafael@kernel.org \
--cc=sds@tycho.nsa.gov \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®