From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Kees Cook <keescook@chromium.org>
Cc: Pavel Machek <pavel@ucw.cz>, "H. Peter Anvin" <hpa@zytor.com>,
LKML <linux-kernel@vger.kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "x86@kernel.org" <x86@kernel.org>,
Len Brown <len.brown@intel.com>,
Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 0/2] make kASLR vs hibernation boot-time selectable
Date: Sat, 14 Jun 2014 02:39:18 +0200 [thread overview]
Message-ID: <13135927.OjVm86GPrt@vostro.rjw.lan> (raw)
In-Reply-To: <CAGXu5jJSqV2MeuofJP4OEiDytQBqKMgC3cj+tguiwTmpRX1wSQ@mail.gmail.com>
On Friday, June 13, 2014 05:08:21 PM Kees Cook wrote:
> On Fri, Jun 13, 2014 at 5:14 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Friday, June 13, 2014 03:59:57 PM Kees Cook wrote:
> >> On Fri, Jun 13, 2014 at 3:54 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> >> > On Friday, June 13, 2014 03:07:19 PM Kees Cook wrote:
> >
> > [cut]
> >
> >> > I'll have a closer look at that shortly (it's been quite some time since
> >> > I wrote that code).
> >>
> >> Thanks; I'm trying to get a test environment instrumented too so I can
> >> look at this. (At the very least, it sounds like we'll still need my
> >> patch series for other architectures.)
> >
> > How can I obtain a kernel address of the beginning of a given page
> > (as represented by struct page) on x86_64 today?
>
> I don't know off the top of my head. I've used virt_to_phys, but
> things like PFN_PHYS(page_to_pfn(page)) maybe? I'm not entirely clear
> which you need, but mm.h seems to have the bulk of what I've seen.
OK, I'm not sure how much sense this makes, but at least it should
illustrate the direction. :-)
---
arch/x86/power/hibernate_64.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: linux-pm/arch/x86/power/hibernate_64.c
===================================================================
--- linux-pm.orig/arch/x86/power/hibernate_64.c
+++ linux-pm/arch/x86/power/hibernate_64.c
@@ -115,7 +115,7 @@ struct restore_data_record {
unsigned long magic;
};
-#define RESTORE_MAGIC 0x0123456789ABCDEFUL
+#define RESTORE_MAGIC 0x0123456789ABCDF0UL
/**
* arch_hibernation_header_save - populate the architecture specific part
@@ -128,7 +128,8 @@ int arch_hibernation_header_save(void *a
if (max_size < sizeof(struct restore_data_record))
return -EOVERFLOW;
- rdr->jump_address = restore_jump_address;
+
+ rdr->jump_address = virt_to_phys((void *)restore_jump_address);
rdr->cr3 = restore_cr3;
rdr->magic = RESTORE_MAGIC;
return 0;
@@ -143,7 +144,7 @@ int arch_hibernation_header_restore(void
{
struct restore_data_record *rdr = addr;
- restore_jump_address = rdr->jump_address;
+ restore_jump_address = (unsigned long)phys_to_virt(rdr->jump_address);
restore_cr3 = rdr->cr3;
return (rdr->magic == RESTORE_MAGIC) ? 0 : -EINVAL;
}
next prev parent reply other threads:[~2014-06-14 0:21 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 19:46 Kees Cook
2014-06-12 19:46 ` [PATCH 1/2] hibernate: create one-way disable mode Kees Cook
2014-06-12 20:12 ` Rafael J. Wysocki
2014-06-12 19:46 ` [PATCH 2/2] x86, kaslr: boot-time selectable with hibernation Kees Cook
2014-06-12 19:48 ` [PATCH 0/2] make kASLR vs hibernation boot-time selectable H. Peter Anvin
2014-06-12 20:13 ` Rafael J. Wysocki
2014-06-12 20:27 ` Kees Cook
2014-06-12 20:29 ` H. Peter Anvin
2014-06-12 20:58 ` Kees Cook
2014-06-13 10:51 ` Pavel Machek
2014-06-13 17:32 ` Kees Cook
2014-06-13 17:36 ` H. Peter Anvin
2014-06-13 20:26 ` Pavel Machek
2014-06-13 22:14 ` Rafael J. Wysocki
2014-06-13 22:07 ` Kees Cook
2014-06-13 22:54 ` Rafael J. Wysocki
2014-06-13 22:59 ` Kees Cook
2014-06-14 0:14 ` Rafael J. Wysocki
2014-06-14 0:08 ` Kees Cook
2014-06-14 0:39 ` Rafael J. Wysocki [this message]
2014-06-14 7:37 ` Kees Cook
2014-06-15 23:16 ` Rafael J. Wysocki
2014-06-14 16:41 ` H. Peter Anvin
2014-06-15 23:04 ` Rafael J. Wysocki
2014-06-14 2:31 ` H. Peter Anvin
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=13135927.OjVm86GPrt@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=len.brown@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pavel@ucw.cz \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yongjun_wei@trendmicro.com.cn \
/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®