linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	X86 ML <x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86/coredump: always use user_regs_struct for compat_elf_gregset_t
Date: Fri, 9 Dec 2016 04:52:46 +0100	[thread overview]
Message-ID: <20161209035246.GB30637@gmail.com> (raw)
In-Reply-To: <CALCETrUQDBX_QqHGeozQ3Q+9pF3SeyE9XyPqX4M6k3XOV8Zd=Q@mail.gmail.com>


* 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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-12-09  3:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 18:13 [PATCH] x86/coredump: always use user_regs_struct for compat_elf_gregset_t Dmitry Safonov
2016-12-08 23:14 ` Andy Lutomirski
2016-12-09  3:52   ` Ingo Molnar [this message]
2016-12-09 11:29   ` Dmitry Safonov

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=20161209035246.GB30637@gmail.com \
    --to=mingo@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=dsafonov@virtuozzo.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).