From nobody Sun Dec 14 08:03:51 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 954A3C25B0E for ; Mon, 15 Aug 2022 19:38:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245326AbiHOTir (ORCPT ); Mon, 15 Aug 2022 15:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245755AbiHOTfM (ORCPT ); Mon, 15 Aug 2022 15:35:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E2F13E23; Mon, 15 Aug 2022 11:45:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DE279611C1; Mon, 15 Aug 2022 18:45:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3837C433D7; Mon, 15 Aug 2022 18:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589126; bh=ezq9bND8emS5xMQV7ZmKm2wM1mVM8Yl7j5xThVo+uFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=coKxv9tMgHJnYTEqTre5wosSKgvRBq3iwNXpOPeqhojCT2bZ+usUvDCTVAwyJhT31 MW3DxMT/ObjKuUWV1wdbfaqRXdFReJvBzpKSj9pdaT01xMiteBJzyIQzZdOn4CDZvx RcOp7rycApHcz5BLEsFFdqAHmMvOWyIOwpCUyMeM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Wilcox , Alexander Gordeev , Sasha Levin Subject: [PATCH 5.15 621/779] s390/crash: fix incorrect number of bytes to copy to user space Date: Mon, 15 Aug 2022 20:04:25 +0200 Message-Id: <20220815180403.929995313@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Alexander Gordeev [ Upstream commit f6749da17a34eb08c9665f072ce7c812ff68aad2 ] The number of bytes in a chunk is correctly calculated, but instead the total number of bytes is passed to copy_to_user_real() function. Reported-by: Matthew Wilcox Fixes: df9694c7975f ("s390/dump: streamline oldmem copy functions") Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin --- arch/s390/kernel/crash_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c index 199f136d1644..f17ad2daab07 100644 --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c @@ -198,7 +198,7 @@ static int copy_oldmem_user(void __user *dst, unsigned = long src, size_t count) } else { len =3D count; } - rc =3D copy_to_user_real(dst, src, count); + rc =3D copy_to_user_real(dst, src, len); if (rc) return rc; } --=20 2.35.1