Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3018640rwb; Mon, 15 Aug 2022 16:15:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HWjxJBwItve+NfCzXBushIQTFd+i+Srd5CKV7PTJq+KKrULKy7tUBwAo6/WnEVOq/2Jrg X-Received: by 2002:a17:906:cc50:b0:730:b5fd:89cf with SMTP id mm16-20020a170906cc5000b00730b5fd89cfmr12032904ejb.221.1660605328291; Mon, 15 Aug 2022 16:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605328; cv=none; d=google.com; s=arc-20160816; b=zF6rvWYqpQXCS7AqNxzgwsNQMLmQyGjmrH68Qwhe2bvdt+Dz8W10nU6SSeuvS/N6qH U6ak3KbPmBcaIzsEysa2wpOYDBK3LAwSXijsH4a2Fc9VPfsOn5N+HiBLFzaLiV4D3WQL BtfRe9vyFvYta2HCMdctNNiy305XxGk7yeGAeFQljfyTQeA9bvRjM56unTVC26DB9OlZ m8FiqdyS88robN94fHgmZTghraM2O3PxymVmnpuIE//otg3IEIOFYzHr8UraIn0hc2v/ K3EpI04M2EfDHMLhcMHs1100Tov/wt8+jMYkuP/euC8EYd6tA/1q3C/H1KXN0mybHoT4 4+ow== 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=u+uPQGWAzBA3AJFd1QFzfO07B81u/bp7B7MfSTaMyiA0eV5pVyC6Ggdxxgzsjw8P4f 7Hcc2UarcOxm/sj0BmEZgZDWMWxZhhZrCGnvS9P4bEGBYvZ1KoKVg7PAyy8FiKe7VjUC 6siOTuXZUNmg3CTeAcNrviGlnYB9IFGK6Uw3ylG4fwJH9NSEVkc8mBGdaug6ZiFCJKf/ L8K2AGYjUvIqQkm6wlHiImnfxV/Jn2OG3YmFUS9R6ncGT5cj56zyS5eClE5iOP2nMCvu MRurvy6Gk/Cg4EJaGiZ0sIbODfwm5JhBDzj9HEmgJuTLDwsxLyVfM0hWZrRY10IHlH2L nl9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f3wVAvQf; 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 s5-20020a056402520500b0043cea582924si10067615edd.54.2022.08.15.16.14.49; Mon, 15 Aug 2022 16:15:28 -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=f3wVAvQf; 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 S1351560AbiHOWpX (ORCPT + 99 others); Mon, 15 Aug 2022 18:45:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348549AbiHOWkN (ORCPT ); Mon, 15 Aug 2022 18:40:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49166B7EC; Mon, 15 Aug 2022 12:51:59 -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 ams.source.kernel.org (Postfix) with ESMTPS id F0BA7B80EAB; Mon, 15 Aug 2022 19:51:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C385C433C1; Mon, 15 Aug 2022 19:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593116; bh=I97Qp1dWAVy3IsQkQEdYvQBwCJj951psvxNp2YnwJ5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f3wVAvQfAZ+8D1hwGlb6myJtiPKeCxvOIP60aULSQv+eybB8MLKwCS2eGVJRLDaFg onC3DUMIiq3RfbcjI/GriHsfqD8slngI2HXTOKEYIbFs6Zi1Ly/gd4XoWGrHUqwTup TmCovyWMoeZw+wYJArBUC0MJ8oMrDnQLot5k3V+8= 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.18 0898/1095] s390/crash: fix incorrect number of bytes to copy to user space Date: Mon, 15 Aug 2022 20:04:57 +0200 Message-Id: <20220815180506.451392972@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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