From: Wei Yang <richard.weiyang@gmail.com>
To: Zi Yan <ziy@nvidia.com>
Cc: wang lian <lianux.mm@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
David Hildenbrand <david@redhat.com>,
Wei Yang <richard.weiyang@gmail.com>,
Christian Brauner <brauner@kernel.org>,
Jann Horn <jannh@google.com>, Kairui Song <ryncsn@gmail.com>,
Liam Howlett <liam.howlett@oracle.com>,
Mark Brown <broonie@kernel.org>, SeongJae Park <sj@kernel.org>,
Shuah Khan <shuah@kernel.org>, Vlastimil Babka <vbabka@suse.cz>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] selftests/mm: fix FORCE_READ to read input value correctly.
Date: Wed, 6 Aug 2025 02:07:44 +0000 [thread overview]
Message-ID: <20250806020744.yj2f7z6ntdqnv2ff@master> (raw)
In-Reply-To: <20250805175140.241656-1-ziy@nvidia.com>
On Tue, Aug 05, 2025 at 01:51:40PM -0400, Zi Yan wrote:
>FORCE_READ() converts input value x to its pointer type then reads from
>address x. This is wrong. If x is a non-pointer, it would be caught it
>easily. But all FORCE_READ() callers are trying to read from a pointer and
>FORCE_READ() basically reads a pointer to a pointer instead of the original
>typed pointer. Almost no access violation was found, except the one from
>split_huge_page_test.
>
>Fix it by implementing a simplified READ_ONCE() instead.
>
>Fixes: 3f6bfd4789a0 ("selftests/mm: reuse FORCE_READ to replace "asm volatile("" : "+r" (XXX));"")
>Signed-off-by: Zi Yan <ziy@nvidia.com>
>---
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
--
Wei Yang
Help you, Help me
prev parent reply other threads:[~2025-08-06 2:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 17:51 Zi Yan
2025-08-05 18:38 ` Jann Horn
2025-08-05 18:48 ` Zi Yan
2025-08-05 18:56 ` Lorenzo Stoakes
2025-08-05 19:00 ` Lorenzo Stoakes
2025-08-05 19:09 ` Zi Yan
2025-08-05 19:21 ` Lorenzo Stoakes
2025-08-06 10:34 ` Pedro Falcato
2025-08-06 10:37 ` Lorenzo Stoakes
2025-08-06 1:44 ` wang lian
2025-08-05 21:05 ` David Hildenbrand
2025-08-06 2:07 ` Wei Yang [this message]
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=20250806020744.yj2f7z6ntdqnv2ff@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=broonie@kernel.org \
--cc=david@redhat.com \
--cc=jannh@google.com \
--cc=liam.howlett@oracle.com \
--cc=lianux.mm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=ryncsn@gmail.com \
--cc=shuah@kernel.org \
--cc=sj@kernel.org \
--cc=vbabka@suse.cz \
--cc=ziy@nvidia.com \
/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