From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753583AbcFFWVv (ORCPT ); Mon, 6 Jun 2016 18:21:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46107 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751969AbcFFWVt (ORCPT ); Mon, 6 Jun 2016 18:21:49 -0400 Date: Mon, 6 Jun 2016 23:19:18 +0200 From: Oleg Nesterov To: Dmitry Safonov Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, luto@amacapital.net, tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, 0x7f454c46@gmail.com, gorcunov@openvz.org, xemul@virtuozzo.com, khorenko@virtuozzo.com, Andy Lutomirski Subject: Re: [PATCH 5/6] x86/ptrace: down with test_thread_flag(TIF_IA32) Message-ID: <20160606211918.GB23681@redhat.com> References: <1464786697-20639-1-git-send-email-dsafonov@virtuozzo.com> <1464786697-20639-6-git-send-email-dsafonov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464786697-20639-6-git-send-email-dsafonov@virtuozzo.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 06 Jun 2016 22:21:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/01, Dmitry Safonov wrote: > > Note, that this will work only if application has changed it's CS. So, suppose it changes it's CS and crashes, > If the application does 32-bit syscall with __USER_CS, ptrace > @@ -1355,7 +1355,7 @@ void update_regset_xstate_info(unsigned int size, u64 xstate_mask) > const struct user_regset_view *task_user_regset_view(struct task_struct *task) > { > #ifdef CONFIG_IA32_EMULATION > - if (test_tsk_thread_flag(task, TIF_IA32)) > + if (!user_64bit_mode(task_pt_regs(task))) > #endif then coredump will do fill_elf_header(view->e_machine) and use EM_X86_64 instead of EM_386, or vice versa... I simply can't understand is this better or worse, I guess gdb or any other tool which looks at this coredump will be confused anyway. Oleg.