From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933277AbcLIDww (ORCPT ); Thu, 8 Dec 2016 22:52:52 -0500 Received: from mail-wj0-f194.google.com ([209.85.210.194]:36764 "EHLO mail-wj0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932192AbcLIDwu (ORCPT ); Thu, 8 Dec 2016 22:52:50 -0500 Date: Fri, 9 Dec 2016 04:52:46 +0100 From: Ingo Molnar 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" 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: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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