Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2882514rwb; Mon, 15 Aug 2022 13:14:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR435fp1xstji9zVv2TKlP3ZfR5l4gG/1aEbYzRo7zIb/95pLCIxrcSF1qwhx+m4LZ5JhkCc X-Received: by 2002:a63:ec15:0:b0:41c:2669:1e54 with SMTP id j21-20020a63ec15000000b0041c26691e54mr15499010pgh.253.1660594475876; Mon, 15 Aug 2022 13:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594475; cv=none; d=google.com; s=arc-20160816; b=FNbu522V1T/+6YMkzt6H+y3S6M+k/6nDTvEPvKqNsPWFBitH6OqpaEGaPZWBEw8avI 1whJEiRDrlyrv2uOllgQH9dSs+E5TKVD4PRlQZSYh+8MNSnciiyRlmdu1xjm61hTMGCQ +q1VARPk5qExqQwsAakC6SaYB6feZoQxrxc1781oprOSOamN/1JmY8vsuLVwR1jKWzsb 8RzkEBb/AXHNKJ8OJ5Acz5RRncWSHuiV1dgfmmDfIClsESZG7EER16XaQq4k2ctWyXhz Hi8JuZkZGkKmBgkU0d9ML8Hw42mr8dcPu0ArwVt+Zq+93dfT64z0f9V4vFXUfg0v9T+q iB0g== 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=VQvrUnB9u+VBTH0elnfREE2972nZVKeHKG5m6QpA3dc=; b=CSyH3BUpq5cj4duPuugKBLBVz5tF9M26EK1gOUwfs4a0d8B6VqJ/LLL5H1WmBfHV0M y4kh36okV+EZWF/ATqmSJwx6WB/eThA39SrhM6bHDkbonmynFPpjPzyiC2AVrGzwhJcz fGQoehauEtMtqYIhdXsFCBfFrHw9bJyPhKkWzQ9thIpKISk5P7qgr7kWGzKnclquI8ON C6DQAaIDafecUziq7avb3kYFA9lDU2mcfzG6FiN3O82exe1Gvgpc7VkljurRg2u+LDmG /mZDhtUkUYkGB0ogwMIMdzlhXAiW0Zc+/ihZ2aC0igK88kDMUvUPSRFHFvako6vrC3G2 foXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=coKxv9tM; 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 a20-20020a17090ad81400b001efa8c6d942si8224285pjv.189.2022.08.15.13.14.25; Mon, 15 Aug 2022 13:14:35 -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=coKxv9tM; 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 S245206AbiHOTiq (ORCPT + 99 others); Mon, 15 Aug 2022 15:38:46 -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-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 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 = count; } - rc = copy_to_user_real(dst, src, count); + rc = copy_to_user_real(dst, src, len); if (rc) return rc; } -- 2.35.1