Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1139938pxb; Wed, 6 Apr 2022 09:37:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziJ154qhbVLSl+F7K0G8H5p8jPkAwJ3+nbzk87dMABXhlLPdHyUaouz496eLyP8vg4AXCM X-Received: by 2002:a65:4989:0:b0:398:da12:70dd with SMTP id r9-20020a654989000000b00398da1270ddmr7650862pgs.295.1649263079229; Wed, 06 Apr 2022 09:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649263079; cv=none; d=google.com; s=arc-20160816; b=yswjHBHcoRLov20BCzy1V8K9da1e/m1ddWcwrsXiTYS9+g1XZUZroIZBc6X1UDy/fd trKKyl9qYouTd9L6jMkiTB2oAHp7zy5rLcPYlxRxSkFvdWnqQGDfXz+PRJ52i9yKP6u4 hZaSG+//NNgC9FsiMh4Q8Gtk7mUzjnARQHbjoAaI8pJwvReRszLhHcOPH6vO9ZWqm9YP 7JYWAxYcGx7HxC3uwaaC6n9r67lJfmnt6g9c9d9beQDETKxAGqqS/fIM5lcQ++LcLzUL GJi1in4CiNIr8zu1nOBBSTzjigpNQSdULKGxFYvnFgJkF6UND3OmmUjI1MYeXDPstiNa gcbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=4ZUweel0/oViX5G1lEB9KlonXUoLTCxRE0sQQD3YjI8=; b=gBYFbJZ+FXquv4JvExjYKxYbFhf4qJLF2Uo8y3nymH1a0KwrO/wajeJknNmtlNaHX4 fjcSBh4eKwPO5wGjx2/4U88D1Z4MnEQVMc//nq1RmpGmo+FpW3smRpoW8tOUkGXkyex6 TfrHGKHslPMPNNMIQ0BcEf7sfo4BYX4z5niIaAuOZZHQxrFckZdwFjoslc/p12Ecjw6c cFRe9vEhf9UBJfwl2uDuShKfGJZz0jes/R9cUSaSIeYGTtYGOxYNHFqnInZAqwYk6ajt Iomhw/EgzP/S8oL+2R4LT0ReJDpupcEPobS/YaOffcfawlyHbaQQvW4vRIOaCw2Cuq9z Z5pQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y21-20020a631815000000b003816043f110si19270518pgl.773.2022.04.06.09.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:37:59 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 632FF36223C; Wed, 6 Apr 2022 08:47:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236394AbiDFPso (ORCPT + 99 others); Wed, 6 Apr 2022 11:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237047AbiDFPr6 (ORCPT ); Wed, 6 Apr 2022 11:47:58 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB9E3CF4B6 for ; Wed, 6 Apr 2022 06:06:13 -0700 (PDT) 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-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 在 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 > .