From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f198.google.com (mail-wj0-f198.google.com [209.85.210.198]) by kanga.kvack.org (Postfix) with ESMTP id 425706B0253 for ; Thu, 8 Dec 2016 22:52:51 -0500 (EST) Received: by mail-wj0-f198.google.com with SMTP id xy5so2288236wjc.0 for ; Thu, 08 Dec 2016 19:52:51 -0800 (PST) Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com. [2a00:1450:400c:c01::244]) by mx.google.com with ESMTPS id xw2si32198769wjc.22.2016.12.08.19.52.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 19:52:49 -0800 (PST) Received: by mail-wj0-x244.google.com with SMTP id j10so613800wjb.3 for ; Thu, 08 Dec 2016 19:52:49 -0800 (PST) Date: Fri, 9 Dec 2016 04:52:46 +0100 From: Ingo Molnar Subject: Re: [PATCH] x86/coredump: always use user_regs_struct for compat_elf_gregset_t Message-ID: <20161209035246.GB30637@gmail.com> References: <20161123181330.10705-1-dsafonov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Dmitry Safonov , Thomas Gleixner , Dmitry Safonov <0x7f454c46@gmail.com>, Ingo Molnar , "linux-kernel@vger.kernel.org" , Oleg Nesterov , "linux-mm@kvack.org" , X86 ML , "H. Peter Anvin" * Andy Lutomirski wrote: > On Nov 23, 2016 10:16 AM, "Dmitry Safonov" 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 AuthorDate: Wed, 23 Nov 2016 21:13:30 +0300 Committer: Ingo Molnar 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: email@kvack.org