Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1632561
| From | Baoquan He <bhe@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] x86/KASLR: Use old ident map page table if physical randomization failed |
| Date | 2017-04-28 09:00 +0200 |
| Message-ID | <tB82K-3Nr-3@gated-at.bofh.it> (permalink) |
| References | <tAMlA-5Ov-11@gated-at.bofh.it> <tB7zH-3BN-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 04/28/17 at 08:25am, Ingo Molnar wrote: > > * Baoquan He <bhe@redhat.com> wrote: > > > Dave found kdump kernel with kaslr enabled will reset to bios immediately > > if physical randomization failed to find a new position for kernel. But > > kernel with 'nokaslr' option works in this case. > > > > The reason is kaslr will install a new page table for ident mapping, > > while it missed to consider building ident mapping for original area > > of kernel if kaslr failed on physical randomization. > > > > This only happens in kexec/kdump kernel. Since ident mapping has been > > built for kexec/kdump in 1st kernel for the whole memory by calling > > init_pgtable(). Here if physical randomizaiton failed, it won't build > > ident mapping for the original area of kernel but change to new page > > table '_pgtable'. Then kernel will reset to bios immediately caused by > > no ident mapping. > > > > While normal kernel won't be impacted because it comes here via > > startup_32() and cr3 will be _pgtable already. In startup_32() ident > > mapping is built for 0~4G area. In kaslr We just append to the existing > > area instead of entirely overwriting it for on-demand ident mapping > > building. So ident mapping for the original area of kernel is still > > there. > > > > So for fixing it, We just switch to the new ident mapping page table > > when physical kaslr succeeds. Otherwise we keep the old page table > > unchanged just like nokaslr does. > > > > Signed-off-by: Baoquan He <bhe@redhat.com> > > Signed-off-by: Dave Young <dyoung@redhat.com> > > Acked-by: Kees Cook <keescook@chromium.org> > > That's not a valid signoff chain. I made it: > > Reported-by: Dave Young <dyoung@redhat.com> > Signed-off-by: Baoquan He <bhe@redhat.com> > Acked-by: Dave Young <dyoung@redhat.com> > Acked-by: Kees Cook <keescook@chromium.org> > > (Let me know if that's not the proper authorship chain.) Yeah, this is fine, thanks. Next time I will notice this.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] x86/KASLR: Use old ident map page table if physical randomization failed Baoquan He <bhe@redhat.com> - 2017-04-27 09:50 +0200
Re: [PATCH v2] x86/KASLR: Use old ident map page table if physical randomization failed Ingo Molnar <mingo@kernel.org> - 2017-04-28 08:30 +0200
Re: [PATCH v2] x86/KASLR: Use old ident map page table if physical randomization failed Baoquan He <bhe@redhat.com> - 2017-04-28 09:00 +0200
[tip:x86/boot] x86/KASLR: Fix kexec kernel boot crash when KASLR randomization fails tip-bot for Baoquan He <tipbot@zytor.com> - 2017-04-28 10:50 +0200
csiph-web