Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1539056

Re: [PATCH] x86/coredump: always use user_regs_struct for compat_elf_gregset_t

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/coredump: always use user_regs_struct for compat_elf_gregset_t
Date 2016-12-09 05:00 +0100
Message-ID <sMkvQ-6CI-5@gated-at.bofh.it> (permalink)
References <sMg8N-3WO-3@gated-at.bofh.it> <sMg8N-3WO-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Nov 23, 2016 10:16 AM, "Dmitry Safonov" <dsafonov@virtuozzo.com> wrote:
> >
> > From commit 90954e7b9407 ("x86/coredump: Use pr_reg size, rather that
> > TIF_IA32 flag") elf coredump file is constructed according to register
> > set size - and that's good: if binary crashes with 32-bit code selector,
> > generate 32-bit ELF core, otherwise - 64-bit core.
> > That was made for restoring 32-bit applications on x86_64: we want
> > 32-bit application after restore to generate 32-bit ELF dump on crash.
> > All was quite good and recently I started reworking 32-bit applications
> > dumping part of CRIU: now it has two parasites (32 and 64) for seizing
> > compat/native tasks, after rework it'll have one parasite, working in
> > 64-bit mode, to which 32-bit prologue long-jumps during infection.
> >
> > And while it has worked for my work machine, in VM with
> > !CONFIG_X86_X32_ABI during reworking I faced that segfault in 32-bit
> > binary, that has long-jumped to 64-bit mode results in dereference
> > of garbage:
> 
> Can you point to the actual line that's crashing?  I'm wondering if we
> have code that should be made more robust.

Agreed. Note that because it fixes a crash this fix is now upstream:

 Commit-ID:  7b2dd3682896bcf1abbbbe870885728db2832a3c
 Gitweb:     http://git.kernel.org/tip/7b2dd3682896bcf1abbbbe870885728db2832a3c
 Author:     Dmitry Safonov <dsafonov@virtuozzo.com>
 AuthorDate: Wed, 23 Nov 2016 21:13:30 +0300
 Committer:  Ingo Molnar <mingo@kernel.org>
 CommitDate: Thu, 24 Nov 2016 06:01:05 +0100

 x86/coredump: Always use user_regs_struct for compat_elf_gregset_t

Thanks,

	Ingo

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] x86/coredump: always use user_regs_struct for compat_elf_gregset_t Andy Lutomirski <luto@amacapital.net> - 2016-12-09 00:20 +0100
  Re: [PATCH] x86/coredump: always use user_regs_struct for  compat_elf_gregset_t Ingo Molnar <mingo@kernel.org> - 2016-12-09 05:00 +0100

csiph-web