Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2160311iof; Tue, 7 Jun 2022 21:46:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw31leFsoI6vynAvHC/7UUeYJtyQY+vG1t6o8A8bYpKExPF1PAWwWsy+EW3BtzcaGTrvUX3 X-Received: by 2002:a62:8e11:0:b0:51c:445b:5ae6 with SMTP id k17-20020a628e11000000b0051c445b5ae6mr5325414pfe.48.1654663563447; Tue, 07 Jun 2022 21:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663563; cv=none; d=google.com; s=arc-20160816; b=KtkTDRoKlHIXpuLtOITd9MQm4eVQIPjJ/sFSNTP+c0jJ8IP86ZPkJdNY3b317xdjKc 7KI7Vk9nO3EM0hbUwaud2MkLSPNGL/FU0/QgwFp6W+6Nn5fOIbAiMfVQ9LY3IDQonOX6 yBo4RN1sn5d7UbQh7Wv28SyEwAns4fCLU/HUXIKLkjpxiovp9U5auhLMVmkb73cCa5Hw qVW0X2UwMQrk+oe2hopTO19VFIWzFMRRvkEP/boTWzNtP43O3L38HGPm4rxrVsh1p9ZQ 1oTZGsYHm7o1AFGeCGyT6AQkN0/wYgiM5JPbe8xfc3KkOzKXND6sBFGBxzUshnSJ8dXI YlXA== 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=Kme0a8W3Nkwfl/Y2sjCy7/7F2im4KG+cgIKoF0v+hLA=; b=c8THtlIeBSPwa1p/dl9Hj5+hwfgRZos7t2tRj3EZwxNHvyRQ0uf+jRRIS/l8R7D2Za o8k8aykJTfjnze0QNvvD1dGe2emfJobyTaf4GwLZ1pkF7UeZm4eqOWz3is9IajAWDSw1 lC1i3AGFsUTdw8oKi21Cv26Romiy1A7g2QnNF2iOH2cupwLwI0j53YtLJfzDPq82pspt hZ2K5EjOHmnCGb8kxjzhIZ6mMXlE+nHN3tfcrK0PI0rprvOCdxDIM/ZL5uo5pUN5FFWH rlR26b4Q0xMCOkLue7e8kyZF3xWUTJRi3TSwhfAIxbizuRe13J2fa+vNfDiM9qBkQVnN P9Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=itx+gUYb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n7-20020a17090ac68700b001df53d6dbc7si29197279pjt.117.2022.06.07.21.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=itx+gUYb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 6A3F52DD2C1; Tue, 7 Jun 2022 21:17:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347747AbiFGRkI (ORCPT + 99 others); Tue, 7 Jun 2022 13:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347438AbiFGRao (ORCPT ); Tue, 7 Jun 2022 13:30:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6A66110AFD; Tue, 7 Jun 2022 10:26:48 -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 527676127C; Tue, 7 Jun 2022 17:26:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 617D8C385A5; Tue, 7 Jun 2022 17:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622807; bh=EYs9ncx94BaVVOEcgi9lPfmZq5mNYDCe5PE0656+Wsc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=itx+gUYbQhEnQ4JOmyoqimqcEVjaGBuRx2sIp3JI8rrYaeO2qrJIThaaolsikl+td kCaAuyu00rbcMKCuVUqwORCu5sSvYgLWdwMxjsTqsLQ1GtTw65v2KnxLtPPq3vO5dY HMnvsz/71gVeCQCJgRvO6jX7OjFgfP1rUqGCTmvA= 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.10 189/452] arm64: fix types in copy_highpage() Date: Tue, 7 Jun 2022 19:00:46 +0200 Message-Id: <20220607164914.193828624@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 70a71f38b6a9..24913271e898 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