Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3234300rwb; Mon, 15 Aug 2022 21:53:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4H//lJf/joEn1vhIb/On64ZvKjlcWiH2M6RnovnFLsNRV9sv4ghLo7MIEirAkxqlk4k6Ha X-Received: by 2002:a05:6402:20b:b0:440:cb9f:c469 with SMTP id t11-20020a056402020b00b00440cb9fc469mr17685467edv.420.1660625614306; Mon, 15 Aug 2022 21:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660625614; cv=none; d=google.com; s=arc-20160816; b=wi/mHEjkh1SaS9yCln0/fzmd8ti9pSGd4jIXv06vHw6SVyCiYqQzcOOrIuz5ewYY4R nF+zR0dh530ybs7w3bGUOuyRw3ckDPCgdqSqH1DZxXYG78oxJN6vcWQl31fxDD8CA5C+ Ifg/VoIBpINTc/hVz7kEfo2yrM8HYoDuA4NC5tT74L+6EZvOBzkf/tAaDoN+PiaVSTxe rT0keAd4HD0fvg9F1nFXwFZkaSTPa8ifECsBYlEvJ7vZhZn1NuVPcLSdY6tGP965JIEv +etOUwoQrZIhgwh4aCxnSJkdebQmWBMm89hXHVmmdZfF/kB0MZl2t2yxlJJUz0z9FM89 rjrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HapDflpaJvKN2PafJvxmriYqDiHsXXT4Vk1/msqgTGY=; b=x95ZRy1j3aj093JHY9oFfKArikXnjeUveI20ug9jbt1d9AM0nkgS5DCjXhpXxbshjO 2X4vo85D0xuFL8YBHMc8M1XZ5gLLIrsQfDKmpOpLJJ6ovyQOTo8A9TnwlSJIGVbWTabP Ba7NMVOlcbWGw6gHkNnS31IbzV1i6m5LuFSxq6E7UafUC53ZHTUj1JoLG6micP/AZkLp RSlVFtRD6+F26nDhOMaHFhPxQSbxUM69QwmxSchjrZVtRu9Ml2KRMtZH0swFfCT47nAv RXAzvNAlbpIt5R7k6kYK4m+FaMBeLS3vCXSaVeNMOb6w67K5xrOimPvi4aYJlGIfzomO 7brA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="tUx/nUGp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id au13-20020a170907092d00b007318652a31bsi7566315ejc.577.2022.08.15.21.53.07; Mon, 15 Aug 2022 21:53:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="tUx/nUGp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231667AbiHPEuP (ORCPT + 99 others); Tue, 16 Aug 2022 00:50:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbiHPEqZ (ORCPT ); Tue, 16 Aug 2022 00:46:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D4B5B2D9E; Mon, 15 Aug 2022 13:43:35 -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 84BA76123C; Mon, 15 Aug 2022 20:43:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AB13C433D6; Mon, 15 Aug 2022 20:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596213; bh=I97Qp1dWAVy3IsQkQEdYvQBwCJj951psvxNp2YnwJ5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tUx/nUGppp/Yc8+bwObEFjec06RBCnCIIU8cuUwY9QXK7DdFEJDqASVn8eMj2guUd VIgDsBRsu4Rw3u3FTvhy/Aw0nUmaTRjlC/VgbuMH03z+n31bQ6KSsjbjPvvqEBS/Kn yfLiYCV1z3gE+ipryfqXc4qr5vssT7J9P4/NQi+o= 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.19 0975/1157] s390/crash: fix incorrect number of bytes to copy to user space Date: Mon, 15 Aug 2022 20:05:31 +0200 Message-Id: <20220815180518.726494498@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 28124d0fa1d5..f8ebdd70dd31 100644 --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c @@ -199,7 +199,7 @@ static int copy_oldmem_user(void __user *dst, unsigned long src, size_t count) } else { len = count; } - rc = copy_to_user_real(dst, src, count); + rc = copy_to_user_real(dst, src, len); if (rc) return rc; } -- 2.35.1