Received: by 10.192.165.156 with SMTP id m28csp1165961imm; Wed, 11 Apr 2018 13:43:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx48W6GreS8DJ0HEsXKrZOjokGFiIlYvL4c5uLfSNvPevYNE3cmFCg60SrPVkW5ulbPSSQv9k X-Received: by 10.99.113.26 with SMTP id m26mr2839685pgc.364.1523479397250; Wed, 11 Apr 2018 13:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523479397; cv=none; d=google.com; s=arc-20160816; b=PiVQbp/Jg26NndIwaiXaajFpxiAlgAl6Y/wClOqYCSd59nE40Noe6JM0w6yXiDeklY IuGjq1+njOLbeYnnstmtSI5yJNcnBbZ/iq8desJyQEVaC1/4HCn8KB7MphwKbUqhvavt BKeedS2DSRH9ShJnOVvpuwwerC9gUxDUIsEfYxh3rlJ/uQLyLsv7nc0FD63qSmF2rB9T cVr8A2IGrKhTMFW/8uv4ByB7vpKowGZw5cnPYJa90sfFN675/AT12p2MC5DZAVKPnW2T 5BvPvXjNQxVgpfbIjSorfufC44JldocFLA2N7ZkGPBnErJ322YY24UxkIIR5Miha1Ior 7nsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jM9GmGUHa3PVGJL64E/FUi48G4WXyqeU3vYzckC+TEs=; b=X0B4dkjNZWPp7zDKPraHuvdYHVPUjfmQBcMiWLTG21Mkz23ABx2fz1zUJ7QmlrjI1a 2KHLFVCjGB0McLhcuQiaEsBdeTOktDlTDhHOPUowdIHFEe2YQ2Fd+KD3G3Vkznk9wqek JcMHVuaRRLIBUxq0oE3jBeQ3vRpmzZHwzrBbXYax5mv8PvKCI6L2CFnuP9lhAR0QCEdB NPSi4rRxh9bXIHhebtqorv+Kd5oIh8vjMtqsOpX3sYYsOPMIkd5JsbPlTrq5Wc9LTlX2 +XBsFlzehbXvejMN+bxABqFLjyc9axjnczaLwQXEX9yx2kRAnzr9bb6mvAgKGD9pV7Tl 99Qg== 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 m11-v6si1740091pls.337.2018.04.11.13.42.40; Wed, 11 Apr 2018 13:43:17 -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; 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 S932410AbeDKSsS (ORCPT + 99 others); Wed, 11 Apr 2018 14:48:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59608 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932379AbeDKSsP (ORCPT ); Wed, 11 Apr 2018 14:48:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 89A3CE27; Wed, 11 Apr 2018 18:48:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Jeremy Kerr , Sasha Levin Subject: [PATCH 4.4 109/190] powerpc/spufs: Fix coredump of SPU contexts Date: Wed, 11 Apr 2018 20:35:55 +0200 Message-Id: <20180411183557.042470380@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Ellerman [ Upstream commit 99acc9bede06bbb2662aafff51f5b9e529fa845e ] If a process dumps core while it has SPU contexts active then we have code to also dump information about the SPU contexts. Unfortunately it's been broken for 3 1/2 years, and we didn't notice. In commit 7b1f4020d0d1 ("spufs: get rid of dump_emit() wrappers") the nread variable was removed and rc used instead. That means when the loop exits successfully, rc has the number of bytes read, but it's then used as the return value for the function, which should return 0 on success. So fix it by setting rc = 0 before returning in the success case. Fixes: 7b1f4020d0d1 ("spufs: get rid of dump_emit() wrappers") Signed-off-by: Michael Ellerman Acked-by: Jeremy Kerr Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/cell/spufs/coredump.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c @@ -174,6 +174,8 @@ static int spufs_arch_write_note(struct if (!dump_skip(cprm, roundup(cprm->written - total + sz, 4) - cprm->written)) goto Eio; + + rc = 0; out: free_page((unsigned long)buf); return rc;