Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1721688pxf; Fri, 19 Mar 2021 14:08:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeb/ppOehe1ta6C4g5rXMP9B15Z4zC9d8qjELHIFkZI5IA3OXcEqQ/ssDRhcDxWt/vhWE8 X-Received: by 2002:a17:907:3da3:: with SMTP id he35mr6535784ejc.148.1616188134134; Fri, 19 Mar 2021 14:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616188134; cv=none; d=google.com; s=arc-20160816; b=CZUNz9SasfnIwUQXWDfyHMoxaKxBcyCN8SmCZTWAWtTyeO18rxU6LDwPTqtUMbXE48 cF1lsAWasrz2JU9VP+7gjyixlca0SEfkX86Yd3wxVmY3Gyg/NXqqJITxNuBBdC5B0IZA znIgAVfWHoZoItguX/IzTmFmY8Yc95+nydA1eR5IE4S4xanuwdR9cDGtmCsoNIpFuuWi fWxoq0tMm5KI+GhqswxZZv4baoFuf9z3UWticwOlsSjQtfeuW1Zzp94OPGrCCz69s37E 2CGdOcP6CDMZ0XETfiCyjI1ccOwWQUumZblPk/ePK3bQOj5KJpsn8DIY7XoJvijZPo4w iB8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=q5AB1O3+WOrgB/Ote4fLERcdEW6A2Y4zo1h8LlTbdIQ=; b=TUh/9zJLvOE7f79t3OLy/B/LCEwtE2YzB2mW8D8vTSx5zhNhHKFa/BbBul5NiJHs0J VUNKnrW3ZTw8w6Qqc2CE60Io4YMAWgtPdcBtyndCLOFQp33fpDhErHhx259PPmoclZBo bfSUgxKVTrua33RNgrUxtaMTnGCw38i6xznfLk2a5EO8r40ePs8usUGoFNKwXQA+kAci GiAvR7y0IZ246Gvff2b5uBIH6vcS4L1kyQkjoqEaxpdOMzGcnDPfL13j3GCmAyGCld1S 4yVDsMTnwxp2ealqFinehVLzdLzB9lXVNEr+IeVgqZFOb7Uh5ypEXhW1ol+n2FHLHzJG fTQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="qMh/7BHa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si4794704edr.602.2021.03.19.14.08.30; Fri, 19 Mar 2021 14:08:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="qMh/7BHa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230177AbhCSVHb (ORCPT + 99 others); Fri, 19 Mar 2021 17:07:31 -0400 Received: from linux.microsoft.com ([13.77.154.182]:36532 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230145AbhCSVHD (ORCPT ); Fri, 19 Mar 2021 17:07:03 -0400 Received: from sequoia (162-237-133-238.lightspeed.rcsntx.sbcglobal.net [162.237.133.238]) by linux.microsoft.com (Postfix) with ESMTPSA id 41F66209C3A4; Fri, 19 Mar 2021 14:07:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 41F66209C3A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1616188022; bh=q5AB1O3+WOrgB/Ote4fLERcdEW6A2Y4zo1h8LlTbdIQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qMh/7BHalJkXnaAsdeMCU8Vy5ERJDCDm2TQMq0oGUBUz6mRC4gICXKxMfrzu3oZON rcDw9M+rb19SoEcBC2Vfp3M8vXaCnh0DxydKf/3MY0Q0FjPDLRV+g8z1kmB+EhipKq zzzs5tl950MfN/HrJEuLOZ9wE/NdTjpyQukAfqBs= Date: Fri, 19 Mar 2021 16:07:00 -0500 From: Tyler Hicks To: Pavel Tatashin Cc: jmorris@namei.org, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: kdump: update ppos when reading elfcorehdr Message-ID: <20210319210700.GB235401@sequoia> References: <20210319205054.743368-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319205054.743368-1-pasha.tatashin@soleen.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-03-19 16:50:54, Pavel Tatashin wrote: > The ppos points to a position in the old kernel memory (and in case of > arm64 in the crash kernel since elfcorehdr is passed as a segment). The > function should update the ppos by the amount that was read. This bug is > not exposed by accident, but other platforms update this value properly. > So, fix it in ARM64 version of elfcorehdr_read() as well. > Fixes: e62aaeac426a ("arm64: kdump: provide /proc/vmcore file") Reviewed-by: Tyler Hicks Tyler > Signed-off-by: Pavel Tatashin > --- > arch/arm64/kernel/crash_dump.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/kernel/crash_dump.c b/arch/arm64/kernel/crash_dump.c > index e6e284265f19..58303a9ec32c 100644 > --- a/arch/arm64/kernel/crash_dump.c > +++ b/arch/arm64/kernel/crash_dump.c > @@ -64,5 +64,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, > ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) > { > memcpy(buf, phys_to_virt((phys_addr_t)*ppos), count); > + *ppos += count; > + > return count; > } > -- > 2.25.1 >