Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp912214rdb; Tue, 30 Jan 2024 02:19:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSkZC8uO7UmXABu65GnXp6QJ9DLgRZqCOnWNhjjPsVj0OrPC8IVvwzJuIyWfS9EvwEH699 X-Received: by 2002:a05:6a20:4281:b0:19c:a3f0:c19 with SMTP id o1-20020a056a20428100b0019ca3f00c19mr1426455pzj.1.1706609956982; Tue, 30 Jan 2024 02:19:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706609956; cv=pass; d=google.com; s=arc-20160816; b=D0hT4IZVFKF35Lw9197jQuXYnagSLQ8RlRY+y9ovBHnMYfSMCUU75LYPaB8C/qYyY0 6pxLl6X6aXR+D78yrRTW/2xoLwVYCrWF3+inYyj9NkHIVI1opuTPxAyjQHGq7ITxBjtk cWN+Sp1zw5MdYc8/T9UT672DcdN9sP7sIsE/S0unHwQyBgahBfD1RtHJw3gGIhAdzUf9 AhRo/cfXwBvugbn6eaJDVXexQj3Saki54qhUkbtFjWt4NOQ3Fatb7RbKKSz30WK/05+J E1uDwkv7W9SCRYRtXHy/sWIcYgEf1z4hn0+qZuu7GMg51ZH5OT1OB95H6Vyxjt63TG7B 4RBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=e2FiQhU+RTDN+Ko8jTvok8WomqOu6UE1H2nRRf9t1x4=; fh=H4GV156ul+gyesFiEJsZZADNB2SjqVyKQdIjeeSPgtY=; b=tIpZtmmBPMa/HC6SRCDRnYrirQhWgBSXFw5tBjgjNPfA+MeFxOjp+E5ubydNjKrUkT A3FanRmZIOZhO7BhySCWiJrJotyczsC1cMqhZEfi3tt74Hsgju/YVjEvBlI8GCo6P9p4 9qNjlk7stysujDCj9xnnizlR6TUCO1SXHZhCldNx81tsoY98teK/jETmjqWx270GwV2e Ykkg0B/yFQ3IYuILDi8avT8lpJJhh8ggUVcag9qpnXecEkqQCddiO9dp+Ocan0hwrjhc UbTbQPV2KVcIKvgTk2gFCeKEzP4s3Mg2RhfhbYSID7eM7Ed9CMJNypU+R9XTFT6jpCWg 63Ng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=KeMGWHIh; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-44368-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44368-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k66-20020a633d45000000b005cf8b79f90csi7222017pga.501.2024.01.30.02.19.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:19:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44368-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=KeMGWHIh; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-44368-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44368-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8B6D628A367 for ; Tue, 30 Jan 2024 10:18:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6076560DC8; Tue, 30 Jan 2024 10:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="KeMGWHIh" Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.4]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C73A60869 for ; Tue, 30 Jan 2024 10:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706609926; cv=none; b=gGbXfnliLKSyqcjq4lPwYpko/Z2tMaNIj/hdn1MFz/kmzgzfym7aXuVapl2fUJBsWmOIuoUOnETo1JVWBoe7Z0gAKXijsmozMrmc9SwPno9/0YSY3kZwinWRcnsbKBSRcrlyj9kDHX2WYZZVsi/VGmtYkgIHw1LJDiD45CgwfW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706609926; c=relaxed/simple; bh=A2NG9B9N8tLHm4kxPliIEqFmb2Hcb8wx1Xa+E1oBSdo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=c+1SSvYpzdzLub78b4ujW+J5zOXF1sWVoM8VfEiGIRTkkM9rFwMjeMU2eXo74cUUstHC1+GLzJAv+QN6Tag0i215BDjDxrnSvdgbC56falTVe8zYXc/aIxmneLVbXEqCwZuZAjULAmfXLxOzoqrSPxZJi5ssyqBNp8z7n2wFgwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=KeMGWHIh; arc=none smtp.client-ip=220.197.31.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=e2FiQ hU+RTDN+Ko8jTvok8WomqOu6UE1H2nRRf9t1x4=; b=KeMGWHIh8XxfVLcfvhOtc dOT6iWXTPXY23QTiiYUHoMVuxl9IslvBFGHrG1y92xB1WbzkThSRe4CBI0BzWo0a yip+SLLv21ScuCn5WfpmqNg1zAwYzmxK1TDaf7s/rpMVIfy9EspYkkrvpaD1ejxh 3BniyVxneyJVa+VNXHErlk= Received: from yangzhang2020.localdomain (unknown [60.24.209.222]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wDXL2jmzLhlyCwHBg--.29538S2; Tue, 30 Jan 2024 18:18:20 +0800 (CST) From: "yang.zhang" To: ebiederm@xmission.com Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, "yang.zhang" Subject: [PATCH] kexec: should use uchunk for user buffer increasing Date: Tue, 30 Jan 2024 18:18:02 +0800 Message-Id: <20240130101802.23850-1-gaoshanliukou@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wDXL2jmzLhlyCwHBg--.29538S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrKw18ZFWrWr1DGr4xGFy3urg_yoWDtFb_Jw 1Iyw4DWr4UZw43Jw4DZrWIgry2yw4Uur4S9r1I9FW7Ar9Yyrs0grZ3trnagr4fGrZ3W3yx tF97J3WSvr1jqjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnVbyJUUUUU== X-CM-SenderInfo: pjdr2x5dqox3xnrxqiywtou0bp/1tbiRAF18mVOBPed+QABs- From: "yang.zhang" Because of alignment requirement in kexec-tools, there is no problem for user buffer increasing when loading segments. But when coping, the step is uchunk, so we should use uchunk not mchunk. Signed-off-by: yang.zhang --- kernel/kexec_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index d08fc7b5db97..2b8354313c85 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -813,9 +813,9 @@ static int kimage_load_normal_segment(struct kimage *image, ubytes -= uchunk; maddr += mchunk; if (image->file_mode) - kbuf += mchunk; + kbuf += uchunk; else - buf += mchunk; + buf += uchunk; mbytes -= mchunk; cond_resched(); @@ -881,9 +881,9 @@ static int kimage_load_crash_segment(struct kimage *image, ubytes -= uchunk; maddr += mchunk; if (image->file_mode) - kbuf += mchunk; + kbuf += uchunk; else - buf += mchunk; + buf += uchunk; mbytes -= mchunk; cond_resched(); -- 2.34.1