From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F12E4C433EF for ; Wed, 6 Apr 2022 12:47:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 851EF8D0001; Wed, 6 Apr 2022 08:47:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8019F6B0074; Wed, 6 Apr 2022 08:47:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C9B58D0001; Wed, 6 Apr 2022 08:47:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 5D3496B0073 for ; Wed, 6 Apr 2022 08:47:30 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2C29120AD for ; Wed, 6 Apr 2022 12:47:20 +0000 (UTC) X-FDA: 79326429840.18.AA12C08 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf27.hostedemail.com (Postfix) with ESMTP id 11EA94000D for ; Wed, 6 Apr 2022 12:47:18 +0000 (UTC) Received: from kwepemi500009.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KYPLc10vxzBs3R; Wed, 6 Apr 2022 20:43:04 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi500009.china.huawei.com (7.221.188.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 6 Apr 2022 20:47:14 +0800 Received: from [10.174.179.234] (10.174.179.234) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 6 Apr 2022 20:47:13 +0800 Message-ID: Date: Wed, 6 Apr 2022 20:47:12 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [RFC PATCH -next V2 2/7] arm64: fix page_address return value in copy_highpage To: Mark Rutland CC: Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Catalin Marinas , Will Deacon , Alexander Viro , , "H. Peter Anvin" , , , , Vincenzo Frascino , References: <20220406091311.3354723-1-tongtiangen@huawei.com> <20220406091311.3354723-3-tongtiangen@huawei.com> From: Tong Tiangen In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.234] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Stat-Signature: d4yhcjikdpairw6kez73rbnygfoien1m Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of tongtiangen@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=tongtiangen@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 11EA94000D X-HE-Tag: 1649249238-303944 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 在 2022/4/6 18:22, Mark Rutland 写道: > On Wed, Apr 06, 2022 at 09:13:06AM +0000, Tong Tiangen wrote: >> Function page_address return void, fix it. >> >> Signed-off-by: Tong Tiangen > > This looks like a sensible cleanup, but the commit title and message aren't > that clear. > > Can you please make this: > > | arm64: fix types in copy_highpage() > | > | 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: > | > | 2563776b41c31908 ("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: 2563776b41c31908 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") > > With that: > > Acked-by: Mark Rutland > > Thanks, > Mark. > OK, sure , will do in next version. Thanks. Tong. >> --- >> 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.18.0.huawei.25 >> >> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > .