Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2104694iof; Tue, 7 Jun 2022 19:54:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzevqc49pejBMayWbmoJlyURN8ZFdYsMuhYvHjHVtX8mtZsv6aEajD5wrhX1b4Q6Iew1awx X-Received: by 2002:a17:902:9f8e:b0:163:bda9:ccb1 with SMTP id g14-20020a1709029f8e00b00163bda9ccb1mr32409808plq.124.1654656875528; Tue, 07 Jun 2022 19:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654656875; cv=none; d=google.com; s=arc-20160816; b=tEIh/+XjrAmTccUqV4BjJEikWSf5XxPK5Y2JO92X877Jn/xyVm2yVCSvelj+CLB6rk F6SqIlTr4i05SlvZ1kIVsUIEeLrV3uiSYiQkgSLsaAJWt7YlHpcd6vc5uuxe+erklKlE 9hGCxLFRmrpo94e0EFQrb/bpsgH6ZhJr7rNhGwtlmE/xGsW3jvcSuKaSV7+4V5CpddXX toUa7cdfOc3A+jACPvHa+rs45tlhFVVnDO0YpAkOMpSC6d6vtBMakgtPWx3fHkygxq8E qfP6pOVFxpJrF6S6x2ZCK9ybX4TMiF3nkEXpM9wGHLY6jIMxceB3X7LKPOujkDJlYRgr exNg== 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=GvzzEYtOd3vt4b7CQffhP2NHafMexWTRhlk6isAp81c=; b=kUBzpvzi+keyXPc7iAEd8bITG9DbJJa4bQl51w8CI9I4+ZPUAWbMkd4ocFS6qGxVvr A6LuTuGKh61T+4OS8/a4ldF5cEyugLvxoTnZ68Kd3lZr0n+PrqEFMbVq5bCzS9jNELPP z4LILkKVwd84lhBpKHfJlhbIc8q63UBu7xjXDGNrYvXr1YPqutUUSYATY3gyZK7Km1Gn /Dku9B+vI8c7LLub/ycmMUKSuRRZ4aYzUnBkFaQl3URc3OfEb1rbLPTTmKZsMMr9n6YF Ai9s6GPWei/Cd+O/RhihA2W4+Z7I5b7UssClmz1SndQweOWZXI9gLoIYw7oMHiBuBMLf rfpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zl2x56pA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s8-20020a17090302c800b00161e9f72b11si24524682plk.540.2022.06.07.19.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 19:54:35 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zl2x56pA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B5B9985ED0; Tue, 7 Jun 2022 18:31:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383812AbiFGWoq (ORCPT + 99 others); Tue, 7 Jun 2022 18:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380806AbiFGVbT (ORCPT ); Tue, 7 Jun 2022 17:31:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4A4A22AE6D; Tue, 7 Jun 2022 12:03:30 -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 7E199617CC; Tue, 7 Jun 2022 19:03:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F5F5C385A2; Tue, 7 Jun 2022 19:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628608; bh=n7mdJGl0agHnUCSyXIFfvAF7u5JxOgJlNavYdXtgUdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zl2x56pAyqpcOi5S9SW+s87jA5mMl0Jmpk1VPUKriPHxrCctVnXDV/NUPh6i+5LfO LJCqGk8Gx4pDMzOVG8/W6y8BUTMbIZOf0QTEdiY9zAxa1H9I0/HaCfS1NCA8b449RU 0m/MDRGyFdBed4uNT4WyWCgSdVmQFrqqIFFDix/4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tong Tiangen , Mark Rutland , Kefeng Wang , Catalin Marinas , Sasha Levin Subject: [PATCH 5.18 391/879] arm64: fix types in copy_highpage() Date: Tue, 7 Jun 2022 18:58:29 +0200 Message-Id: <20220607165014.214376232@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Tong Tiangen [ Upstream commit 921d161f15d6b090599f6a8c23f131969edbd1fa ] In copy_highpage() the `kto` and `kfrom` local variables are pointers to struct page, but these are used to hold arbitrary pointers to kernel memory . Each call to page_address() returns a void pointer to memory associated with the relevant page, and copy_page() expects void pointers to this memory. This inconsistency was introduced in commit 2563776b41c3 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") and while this doesn't appear to be harmful in practice it is clearly wrong. Correct this by making `kto` and `kfrom` void pointers. Fixes: 2563776b41c3 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") Signed-off-by: Tong Tiangen Acked-by: Mark Rutland Reviewed-by: Kefeng Wang Link: https://lore.kernel.org/r/20220420030418.3189040-3-tongtiangen@huawei.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/mm/copypage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/copypage.c b/arch/arm64/mm/copypage.c index b5447e53cd73..0dea80bf6de4 100644 --- a/arch/arm64/mm/copypage.c +++ b/arch/arm64/mm/copypage.c @@ -16,8 +16,8 @@ void copy_highpage(struct page *to, struct page *from) { - struct page *kto = page_address(to); - struct page *kfrom = page_address(from); + void *kto = page_address(to); + void *kfrom = page_address(from); copy_page(kto, kfrom); -- 2.35.1