Received: by 10.223.164.202 with SMTP id h10csp381168wrb; Thu, 9 Nov 2017 07:47:41 -0800 (PST) X-Google-Smtp-Source: ABhQp+SFizUnrnd9b4WUQ4dZPeqXDW8CevMTnuyhq1Ywfr4MutTH0j/1BDxheg1HJOowd+SavOGV X-Received: by 10.99.106.67 with SMTP id f64mr869476pgc.162.1510242461105; Thu, 09 Nov 2017 07:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510242461; cv=none; d=google.com; s=arc-20160816; b=UEV0ZV0/PX3IiSTuTiX8So7EC3P5fX7MoOsm6bjDF4Dipf6bzIUECoQEkFGyFKOjeO kRMjs9RrXd3xsVPI56mJiiPAQ0kQca1U3AYv2Vylm1LruTOmwbL+RcvrjClo0lIHkYpr ODRh9we0DYlsjMMWoWGy8mnEMDdtND7mA28zQAVprPyBLU99zeBn6SQ3j7N0U212jIKP km0ekgLYSLyiC5GZ2jvHvGhBtM9ey2+7n42X0OFAChBdkENBRtQOlnr73C6u5viL+YPp TN3V1X/pmG9J9llFp/ZVye1ETNLIm6d4Bi9szI3M661J0XWwrJFelcSIV1joDwwgfzDU wOTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=4/yaOwDKatBf9CbL+mrINjlce8eMjJCiFc7jJeKcbUE=; b=YARLB8Su5nVJGQKu8cVz++bTXOkA/Q/yeLYsk82iDC/Eb+vSEJyHd8ZSgOv2cdDqxT zou/uFIUcKI663Cdo/ugjqlBfIG5VtPiySHOK0AzoZCRQPlxJaAoB45V0jMa/UUJfyFc 00CXR/me1PSQbQkNne15F5tg7aiNwh5v6y68yIZpsD8+t0v4d7a9Rd9HCWGBcwrimkt2 4psQKMrZB1pSZlxT+CQX5VHEzRiwD8wamd8AJe7IHsOcRq7maF829zzWuB/1/e+IPasj oULujQYZSzdfVmZ0Tfl/2f4vvKjVGfJu1YIb8lEjMEHiopgdMpT2PV4H+72voSE2Jg8d m9BA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d128si6424249pgc.624.2017.11.09.07.47.30; Thu, 09 Nov 2017 07:47:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753090AbdKIPqY (ORCPT + 80 others); Thu, 9 Nov 2017 10:46:24 -0500 Received: from 19pmail.ess.barracuda.com ([64.235.150.245]:60029 "EHLO 19pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752547AbdKIPqW (ORCPT ); Thu, 9 Nov 2017 10:46:22 -0500 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx3.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Thu, 09 Nov 2017 15:45:27 +0000 Received: from localhost (192.168.154.110) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 9 Nov 2017 07:45:19 -0800 Date: Thu, 9 Nov 2017 15:45:17 +0000 From: James Hogan To: "Maciej W. Rozycki" CC: Ralf Baechle , Djordje Todorovic , , , Subject: Re: [PATCH] MIPS: Fix an n32 core file generation regset support regression Message-ID: <20171109154517.GY15260@jhogan-linux> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kUoBhQsr7LsiFken" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [192.168.154.110] X-BESS-ID: 1510242326-298554-12052-53724-4 X-BESS-VER: 2017.12-r1710252241 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.01 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.186757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound 0.01 BSF_SC0_SA_TO_FROM_DOMAIN_MATCH META: Sender Domain Matches Recipient Domain X-BESS-Outbound-Spam-Status: SCORE=0.01 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND, BSF_SC0_SA_TO_FROM_DOMAIN_MATCH X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --kUoBhQsr7LsiFken Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 07, 2017 at 07:09:20PM +0000, Maciej W. Rozycki wrote: > Fix a commit 7aeb753b5353 ("MIPS: Implement task_user_regset_view.")=20 > regression, then activated by commit 6a9c001b7ec3 ("MIPS: Switch ELF=20 > core dumper to use regsets.)", that caused n32 processes to dump o32=20 > core files by failing to set the EF_MIPS_ABI2 flag in the ELF core file= =20 > header's `e_flags' member: >=20 > $ file tls-core > tls-core: ELF 32-bit MSB executable, MIPS, N32 MIPS64 rel2 version 1 (SYS= V), [...] > $ ./tls-core > Aborted (core dumped) > $ file core > core: ELF 32-bit MSB core file MIPS, MIPS-I version 1 (SYSV), SVR4-style > $=20 >=20 > Previously the flag was set as the result of a: >=20 > #define ELF_CORE_EFLAGS EF_MIPS_ABI2 >=20 > statement placed in arch/mips/kernel/binfmt_elfn32.c, however in the=20 > regset case, i.e. when CORE_DUMP_USE_REGSET is set, ELF_CORE_EFLAGS is=20 > no longer used by `fill_note_info' in fs/binfmt_elf.c, and instead the=20 > `->e_flags' member of the regset view chosen is. We have the views=20 > defined in arch/mips/kernel/ptrace.c, however only an o32 and an n64=20 > one, and the latter is used for n32 as well. Consequently an o32 core=20 > file is incorrectly dumped from n32 processes (the ELF32 vs ELF64 class= =20 > is chosen elsewhere, and the 32-bit one is correctly selected for n32). >=20 > Correct the issue then by defining an n32 regset view and using it as=20 > appropriate. Issue discovered in GDB testing. >=20 > Cc: stable@vger.kernel.org # 3.13+ > Fixes: 7aeb753b5353 ("MIPS: Implement task_user_regset_view.") > Signed-off-by: Maciej W. Rozycki Thanks, queued for 4.15. Cheers James > --- > arch/mips/kernel/ptrace.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) >=20 > linux-mips-regset-view-n32-e-flags-abi2-init.diff > Index: linux-sfr/arch/mips/kernel/ptrace.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- linux-sfr.orig/arch/mips/kernel/ptrace.c 2017-10-27 04:55:34.00000000= 0 +0100 > +++ linux-sfr/arch/mips/kernel/ptrace.c 2017-10-27 20:07:14.933716000 +01= 00 > @@ -618,6 +618,19 @@ static const struct user_regset_view use > .n =3D ARRAY_SIZE(mips64_regsets), > }; > =20 > +#ifdef CONFIG_MIPS32_N32 > + > +static const struct user_regset_view user_mipsn32_view =3D { > + .name =3D "mipsn32", > + .e_flags =3D EF_MIPS_ABI2, > + .e_machine =3D ELF_ARCH, > + .ei_osabi =3D ELF_OSABI, > + .regsets =3D mips64_regsets, > + .n =3D ARRAY_SIZE(mips64_regsets), > +}; > + > +#endif /* CONFIG_MIPS32_N32 */ > + > #endif /* CONFIG_64BIT */ > =20 > const struct user_regset_view *task_user_regset_view(struct task_struct = *task) > @@ -629,6 +642,10 @@ const struct user_regset_view *task_user > if (test_tsk_thread_flag(task, TIF_32BIT_REGS)) > return &user_mips_view; > #endif > +#ifdef CONFIG_MIPS32_N32 > + if (test_tsk_thread_flag(task, TIF_32BIT_ADDR)) > + return &user_mipsn32_view; > +#endif > return &user_mips64_view; > #endif > } --kUoBhQsr7LsiFken Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd80NauSabkiESfLYbAtpk944dnoFAloEeA0ACgkQbAtpk944 dnppcBAArJdLPfDyMAjul83SIqnSmdyw+m5aspJQF9tkVRxYsTCBkoNtdqflIu0L pDdkd7bkanGjXnyMJ74d+t9NnOX6wCu7UlH9X59teXnVKkpqeTCdYiUzUX8Bh1/Z dU4GwL/iaH7+/8NegkjRFuyCVjKnnas1WaZkFI4KLpjfKfQ2wu/Ifz6uvCe8YExQ qe7Cou7F/M8xedAAon8IJkJq2y5fIPhH8MaMOmozq0vunCvcNHTG02p5VWpvYcoF UR6m9cJafwTvqd5XP0oz7TPhChA6c0ZjdvIRahnKM3IPHJuK1+9j7D9/FvpjPPIW 6JYEg/LQiNxpPGWMgEdnLEjpDsNiCOIUuAjt6kCzENnAu7leuVbrZW+MM09zCAGj 12KHPnhM+IT2AVAQbS1n9HdrN2hvWitnu+XIf6Nmi5kliHtvNOZvzY54FNEezE2K xjGuHXssLYRed1HkceKqUv2FH2GFPZgaXG224bakq+72/njzksywbE9+z8dZhLfB zw9zSiqg50w4d0qlH4rNrUixKJjQRhmhMylVotcqtkmSvUE063/aiNSUmg4gE4BI PJFwW2+WfcsBZVX4BvWhreYdY592VUpSJtHzaaTEuGleFdMdLxsJpgBRdJKzQoZC hTyOXKrQS1HgSEzGRwU+YJ4s9hRiiJD/LeYs1/9QvDb14GQXJao= =xOU6 -----END PGP SIGNATURE----- --kUoBhQsr7LsiFken-- From 1583463214981461955@xxx Wed Nov 08 02:29:59 +0000 2017 X-GM-THRID: 1583463214981461955 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread