Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2971879imm; Sun, 1 Jul 2018 09:26:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdcz66nJs1Nro/aX4zacZFBUL5aXuChFqe6EH7Das3BdJYOcRX+vW+nnp4/8/Er2QQN5jLy X-Received: by 2002:a62:6882:: with SMTP id d124-v6mr22121879pfc.122.1530462391414; Sun, 01 Jul 2018 09:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530462391; cv=none; d=google.com; s=arc-20160816; b=xRQ/BCMkd13m2lHE4sg/zxG3nmobVH1KMN8SMrA2fAQBmRc0lGuDnQCHI6mPOnzf/3 0preT5XJ75PYq4BF5aC+HHMU8FRxiHPqfR5qKug0WRk5cjrhRwB+HyqdTdZDQNikp54m bR/VbmY0oyafd0qsjBX2E9vfOBT2Tgh2RWDTRsHLN3BzEtssehp0PaXWzthdsHWXFHEv LMs4eaSlzmV7fP3WuJA42mTkzUQwx9yj4MPnu8fkjnuTrIq4GtJZZhfxwCRumSzBm/Ti HMrtrCFSbaV9P5kPvtACTdMg2bLHV+1tM+LerZ4Z9sH7Uko8mh08AJM9D1wISz2B/xtV Whsg== 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=q2elcr4W6PQFNNTLY6VsNYsft+l3bPWw8igzZFz7eu4=; b=YsXmbdKlcQnfqYV/o1ucyp2/mCLfvqOaK3bS2BxDjZBhJfUpDB10ckXqAjvAL+9Y3/ jB2CDZvHMynQDnc4TyjZZkL1ESvTvoPEtQptbzTSq3OgH0RKHppPMEpQ0paDBS4QMICd /z+/DDAf7uP1KsrwkIMOamlBHc0oLhTtLfCS5lc84R8bfxvrKtoMe9QT0jNFafWdXWVf xPmDZXvDXhcyUIX0OOlL27l91+XCClsR+y1dGnAyvKB/aGYQ0j6E5PddAHix+Vt3ptak CFNG4DCbMu1zfyBiq+9DEbHZUSazaVmH+eRROIiXcMyRqmKm01oQwEgcy4KM3zwoZf0Q mJxQ== 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 e37-v6si14426303plb.400.2018.07.01.09.26.17; Sun, 01 Jul 2018 09:26:31 -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 S965191AbeGAQZ0 (ORCPT + 99 others); Sun, 1 Jul 2018 12:25:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33660 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932790AbeGAQZW (ORCPT ); Sun, 1 Jul 2018 12:25:22 -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 BF859ACD; Sun, 1 Jul 2018 16:25:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mahesh Salgaonkar , Michael Ellerman Subject: [PATCH 4.9 029/101] powerpc/fadump: Unregister fadump on kexec down path. Date: Sun, 1 Jul 2018 18:21:15 +0200 Message-Id: <20180701160758.311820750@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mahesh Salgaonkar commit 722cde76d68e8cc4f3de42e71c82fd40dea4f7b9 upstream. Unregister fadump on kexec down path otherwise the fadump registration in new kexec-ed kernel complains that fadump is already registered. This makes new kernel to continue using fadump registered by previous kernel which may lead to invalid vmcore generation. Hence this patch fixes this issue by un-registering fadump in fadump_cleanup() which is called during kexec path so that new kernel can register fadump with new valid values. Fixes: b500afff11f6 ("fadump: Invalidate registration and release reserved memory for general use.") Cc: stable@vger.kernel.org # v3.4+ Signed-off-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/fadump.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -1033,6 +1033,9 @@ void fadump_cleanup(void) init_fadump_mem_struct(&fdm, be64_to_cpu(fdm_active->cpu_state_data.destination_address)); fadump_invalidate_dump(&fdm); + } else if (fw_dump.dump_registered) { + /* Un-register Firmware-assisted dump if it was registered. */ + fadump_unregister_dump(&fdm); } }