From: David Hildenbrand <david@redhat.com>
To: Zi Yan <ziy@nvidia.com>, wang lian <lianux.mm@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.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: Tue, 5 Aug 2025 23:05:49 +0200 [thread overview]
Message-ID: <9cfb5b1b-f565-4129-a3e3-fd16a38997da@redhat.com> (raw)
In-Reply-To: <20250805175140.241656-1-ziy@nvidia.com>
On 05.08.25 19:51, 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>
> ---
Ouch, thank!
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-08-05 21:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 17:51 [PATCH] selftests/mm: fix FORCE_READ to read input value correctly 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 [this message]
2025-08-06 2:07 ` Wei Yang
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=9cfb5b1b-f565-4129-a3e3-fd16a38997da@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=broonie@kernel.org \
--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=richard.weiyang@gmail.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;
as well as URLs for NNTP newsgroup(s).