Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1059590imm; Fri, 29 Jun 2018 10:39:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL4eofDgdFk13eRjrGYT9Z886hMZjpwGz8oedRcg+mJndJLlDYhnryJoAzTD6xts0V66QOc X-Received: by 2002:a17:902:2006:: with SMTP id n6-v6mr15727970pla.125.1530293987263; Fri, 29 Jun 2018 10:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530293987; cv=none; d=google.com; s=arc-20160816; b=1JN0V1xbtLtxHUyZBzs70stMC42LJzRGxoNn7tZwNJWCgVjCPgMkKw5l/pddkDCtmO qB3nvH8rPwj9VF6WvDpE+UlxcTbnuKreSutR0SEa8a+yHDL3HZUX7PlB93lADjRHqwOn J2mZNYEOoQYlWggx6ttQBm6PgG7uPpPNr862GxAn/SZDUuH2qJaXDtiA60wFBEtQF6u4 56Y+w4LFUYAEF3Hr4GsdYpp+ucWTDl5ax/+UjTu24ucOfI+dgvXLKVI9i7X4WYD7u2Hs ssf3K9qnLei39NsEXOl929TWVQ37PyfK8A8FO+QabvajrL2gjyNrqrdbxP76E2vp8oem IoxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=LyhsDRXUH2sPPEwT4gG52+CxwHBA4171ewTZ7JiLFXY=; b=iYWVdQZyFXcwbR4gdvAxeYafT7HXvuwY2/KkkgWX6iK52xBobyUN5+oO9LTFqTjfZJ En71oOpaH7pV/DgxoUvjlTGqrZZPjQnMjx4q0SD9TKEMgAF6FDcaOE+LwH6Qmg4b6v7K 1zjpjs6r49mwn71urosTOwVd5Yx4DGFYmGn8/cZY4jk7m+ZQXFYNExbKkLPwlWIycPhh OHNY0Y03fj3ZHlCb0IEX5UxeEUVug3mlOiVWXHR5p8eNZ/jwIbC7wkmMdKqOmiwaL0pG JJTgYYbmr4NJdoXFejdp/PLF637Akywkimo/GxrVYq6URhdjG8V2IAe+5O8j5GIIxRPC OXfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=nWwsyxsC; 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 k134-v6si9003171pga.149.2018.06.29.10.39.32; Fri, 29 Jun 2018 10:39:47 -0700 (PDT) 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; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=nWwsyxsC; 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 S937173AbeF2RNm (ORCPT + 99 others); Fri, 29 Jun 2018 13:13:42 -0400 Received: from mail-dm3nam03on0118.outbound.protection.outlook.com ([104.47.41.118]:43271 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932446AbeF2RNg (ORCPT ); Fri, 29 Jun 2018 13:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavecomp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LyhsDRXUH2sPPEwT4gG52+CxwHBA4171ewTZ7JiLFXY=; b=nWwsyxsCQ47lndbMetFi2NjrgraRYGhoOKLbQFjWuJmvlY2h8pFi6Z35WelWZQnX7Mb/0Q2Y2m6BfFW7jsvHxfNf5WBu9kF45HIRjFaV3Af0667L/aShxsN/w4XFdTd94r52a4H1ZeswhX+Qgot18PEGRvSYZ4GKUs5+iVkQbdg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; Received: from localhost (4.16.204.77) by BN7PR08MB4932.namprd08.prod.outlook.com (2603:10b6:408:28::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.23; Fri, 29 Jun 2018 17:13:33 +0000 Date: Fri, 29 Jun 2018 10:13:30 -0700 From: Paul Burton To: Alexander Viro Cc: "Maciej W. Rozycki" , James Hogan , Ralf Baechle , linux-fsdevel@vger.kernel.org, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/3] binfmt_elf: Respect error return from `regset->active' Message-ID: <20180629171330.4giikc5x2cbxxuyc@pburton-laptop> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 X-Originating-IP: [4.16.204.77] X-ClientProxiedBy: MWHPR2001CA0011.namprd20.prod.outlook.com (2603:10b6:301:15::21) To BN7PR08MB4932.namprd08.prod.outlook.com (2603:10b6:408:28::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 891f9003-da92-43f3-bcc8-08d5dde3a514 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(7021125)(8989117)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:BN7PR08MB4932; X-Microsoft-Exchange-Diagnostics: 1;BN7PR08MB4932;3:6bPEvMwc5FPhUHuUbD1rMMiXjvtEbbIAOI+Lecj2CFgTptGtrozKQmPsm66n5erh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knaqy378KXJvrCDq4v1SUIUR8b0mmBptjGIgy+tHFVHMRT05DazyDirj82FQq7ZEFvkxNXpueuZwBCxTwl;4:bfKtTxPY1Hvl/9ZWxjzxXQv0knkr9Wij46LqnGtVbQNhiu5CKuUQARt2jprHz/mmT7WnWJJ7xn2mKGZ8xfrf/4D/T5u5yiPJAIUr4hTIp8neIzU5Zc5ZtBP0SWlij7jjtO4sotVtcPqhTxJwzYdInVKS9YD+ia06AdMzi/5Kk7aZRd5AHUyMQ+X6yh/v2Qkr2FQAF+ayvqiBpN6J0RIGBTfq8sWX6xBLkN1twDX2wirEjgtfd7HWRH4o/LJSYOduW7c/SuQUr2KEfqp9uNJo/xZRi2YzWoolbK3tZlxI8FEO6D48nZdFyf0PuurnT70u X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(2016111802025)(20161123562045)(6072148)(6043046)(201708071742011)(7699016);SRVR:BN7PR08MB4932;BCL:0;PCL:0;RULEID:;SRVR:BN7PR08MB4932; X-Forefront-PRVS: 0718908305 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(7916004)(396003)(346002)(376002)(39840400004)(136003)(366004)(189003)(199004)(68736007)(4326008)(956004)(9686003)(25786009)(44832011)(476003)(76506005)(66066001)(47776003)(316002)(81156014)(7736002)(81166006)(3846002)(6116002)(305945005)(5660300001)(11346002)(23726003)(1076002)(8676002)(53936002)(486006)(8936002)(6246003)(229853002)(446003)(105586002)(76176011)(6496006)(50466002)(52116002)(97736004)(58126008)(16586007)(33716001)(478600001)(33896004)(186003)(6916009)(2906002)(16526019)(386003)(42882007)(54906003)(6486002)(26005)(106356001)(81973001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN7PR08MB4932;H:localhost;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN7PR08MB4932;23:dvr0HUp1QzwMxxLKdgwXw9L8GF5youyKN9loojLTp?= =?us-ascii?Q?QD8vyyWD8lnE7fOqD+suMbhrEKieuVBM9SlV8HOpkzEro2UjwypfJ5kMC/Vf?= =?us-ascii?Q?eblftdZxhUvDcnftQJWW8sBCghiMPyj0/zoHOCjaepXkYD0j07VN4FNP2naG?= =?us-ascii?Q?nJC/Pb0of+424mbK8iiGmzGfhqle330tAWcB8KCK+J8gwqIJRMs4pzE5KVSC?= =?us-ascii?Q?eWag5JRbuUFBOFrk56vIkLRxobbAyZemlQw0yIQ/LUKS/pzMQG0nBvfPImQW?= =?us-ascii?Q?4IWNCT3m0ZHdw+0jzT5pFkRmBRg/RZXa0dY1/zWUSD+jxC12ijiWXh8nOSPw?= =?us-ascii?Q?RGjZiBsecdiMZuPPomg0ZuGD9sTz/n4gsGTcvEs43MrYarKmkPbQ9+TQ06XS?= =?us-ascii?Q?2nJO/zXlMAC3JF/0JeFtCeNlcTXzMyQT1fuvTkooR8MJeqHrWp5Vwu8SMfJ6?= =?us-ascii?Q?JVNL5UlHtduQHjnfhZdt+4eqftxRnkjolQeUFxUKpRPVtwlz6Ix+oRo43VD9?= =?us-ascii?Q?VpPW4A7cErpXh94NHAcQvlGSVSo41MdoUsKMRlNGb5bNgAfLLik9J4ZjagcH?= =?us-ascii?Q?SZzt9aYLpRGKLUlcfnequpq0zG5A9mv8RynrszysxWu1ppHcyKa1MqPJSB7r?= =?us-ascii?Q?reYCgxlMWXTyNh0+6pT38mQANE0yaXr0BwvIKKS1eYj4n++lJ+AZJwUkMGE8?= =?us-ascii?Q?5YQqwFMgAC4UnORNLDj7eHlVIkh/0sXakyBz8SX45v1HXsO/mc1sNOdAqp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7KM6N305FGBVwBYd3o7YzXMW+o7b6sfF9sjdGSr0ilj32KEdiH3l413wvD9vIl X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2018 17:13:33.7315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 891f9003-da92-43f3-bcc8-08d5dde3a514 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR08MB4932 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexander, On Tue, May 15, 2018 at 11:32:45PM +0100, Maciej W. Rozycki wrote: > The regset API documented in defines -ENODEV as the > result of the `->active' handler to be used where the feature requested > is not available on the hardware found. However code handling core file > note generation in `fill_thread_core_info' interpretes any non-zero > result from the `->active' handler as the regset requested being active. > Consequently processing continues (and hopefully gracefully fails later > on) rather than being abandoned right away for the regset requested. > > Fix the problem then by making the code proceed only if a positive > result is returned from the `->active' handler. > > Cc: stable@vger.kernel.org # 2.6.25+ > Fixes: 4206d3aa1978 ("elf core dump: notes user_regset") > Signed-off-by: Maciej W. Rozycki > --- linux-jhogan-test.orig/fs/binfmt_elf.c 2018-03-21 17:14:55.000000000 +0000 > +++ linux-jhogan-test/fs/binfmt_elf.c 2018-05-09 23:25:50.742255000 +0100 > @@ -1739,7 +1739,7 @@ static int fill_thread_core_info(struct > const struct user_regset *regset = &view->regsets[i]; > do_thread_regset_writeback(t->task, regset); > if (regset->core_note_type && regset->get && > - (!regset->active || regset->active(t->task, regset))) { > + (!regset->active || regset->active(t->task, regset) > 0)) { > int ret; > size_t size = regset_size(t->task, regset); > void *data = kmalloc(size, GFP_KERNEL); > This looks obviously right to me, although I don't think it affects anything until commit 25847fb195ae ("powerpc/ptrace: Enable support for NT_PPC_CGPR") in v4.8-rc1 & even then not in a harmful way so I'd drop the stable tag. You show up as maintainer for fs/binfmt_elf.c though, so before I go applying this to mips-next does it look good to you? Thanks, Paul