From: Tong Tiangen <tongtiangen@huawei.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>, <x86@kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
<james.morse@arm.com>
Subject: Re: [RFC PATCH -next V2 2/7] arm64: fix page_address return value in copy_highpage
Date: Wed, 6 Apr 2022 20:47:12 +0800 [thread overview]
Message-ID: <e269a621-ed0e-c74c-9cf6-f81c44c1fbcd@huawei.com> (raw)
In-Reply-To: <Yk1pz7IYwEyGDVNV@FVFF77S0Q05N>
在 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 <tongtiangen@huawei.com>
>
> 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 <mark.rutland@arm.com>
>
> 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
> .
next prev parent reply other threads:[~2022-04-06 15:46 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 9:13 [RFC PATCH -next V2 0/7]arm64: add machine check safe support Tong Tiangen
2022-04-06 9:13 ` [RFC PATCH -next V2 1/7] x86: fix copy_mc_to_user compile error Tong Tiangen
2022-04-06 9:22 ` Borislav Petkov
2022-04-06 10:02 ` Tong Tiangen
2022-04-06 9:13 ` [RFC PATCH -next V2 2/7] arm64: fix page_address return value in copy_highpage Tong Tiangen
2022-04-06 10:22 ` Mark Rutland
2022-04-06 12:47 ` Tong Tiangen [this message]
2022-04-06 9:13 ` [RFC PATCH -next V2 3/7] arm64: add support for machine check error safe Tong Tiangen
2022-04-06 10:58 ` Mark Rutland
2022-04-07 14:26 ` Tong Tiangen
2022-04-06 9:13 ` [RFC PATCH -next V2 4/7] arm64: add copy_from_user to machine check safe Tong Tiangen
2022-04-06 11:19 ` Mark Rutland
2022-04-07 14:28 ` Tong Tiangen
2022-04-06 9:13 ` [RFC PATCH -next V2 5/7] arm64: add get_user " Tong Tiangen
2022-04-06 11:22 ` Mark Rutland
2022-04-07 14:38 ` Tong Tiangen
2022-04-08 15:22 ` Mark Rutland
2022-04-09 9:17 ` Tong Tiangen
2022-04-06 9:13 ` [RFC PATCH -next V2 6/7] arm64: add cow " Tong Tiangen
2022-04-06 9:13 ` [RFC PATCH -next V2 7/7] arm64: add pagecache reading " Tong Tiangen
2022-04-06 11:27 ` Mark Rutland
2022-04-07 14:56 ` Tong Tiangen
2022-04-07 15:53 ` Robin Murphy
2022-04-08 2:43 ` Tong Tiangen
2022-04-08 11:11 ` Robin Murphy
2022-04-09 9:24 ` Tong Tiangen
2022-04-06 10:04 ` [RFC PATCH -next V2 0/7]arm64: add machine check safe support Mark Rutland
2022-04-07 4:21 ` Tong Tiangen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e269a621-ed0e-c74c-9cf6-f81c44c1fbcd@huawei.com \
--to=tongtiangen@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).