From: David Hildenbrand <david@redhat.com>
To: Christoph Berg <myon@debian.org>, Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Matthew Brost <matthew.brost@intel.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Rakie Kim <rakie.kim@sk.com>, Byungchul Park <byungchul@sk.com>,
Gregory Price <gourry@gourry.net>,
Ying Huang <ying.huang@linux.alibaba.com>,
Alistair Popple <apopple@nvidia.com>,
"open list:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION"
<linux-mm@kvack.org>, open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] mm/migrate: Fix do_pages_stat in 32-bit mode
Date: Tue, 1 Jul 2025 20:17:12 +0200 [thread overview]
Message-ID: <069a44c4-754e-41b7-9a42-7c2b77afdd37@redhat.com> (raw)
In-Reply-To: <aGQhBRM9DtTZ22Z_@msg.df7cb.de>
On 01.07.25 19:55, Christoph Berg wrote:
> Re: Zi Yan
>> Fixes should be:
>>
>> Fixes: 5b1b561ba73c ("mm: simplify compat_sys_move_pages")
>>
>> Closes could be a link to the bug report.
>
> Updated, thanks.
>
>>> This seems to work, but honestly I am wondering, if copy_from_user
>>> needs a special 32-bit case, doesn't copy_to_user need special casing
>>> as well?
>
> Scratch that, it works because an int[] is copied back, and that's
> always the same size.
>
> So I think the patch is good to go.
>
> Christoph
>
>
If you have to resend, next time resend the full patch separately, not
as reply to the previous version.
> From 426c93d558572248273cf386ca784626ae431413 Mon Sep 17 00:00:00 2001
> From: Christoph Berg <myon@debian.org>
> Date: Tue, 24 Jun 2025 16:44:27 +0200
> Subject: [PATCH v3] mm/migrate: Fix do_pages_stat in 32-bit mode
s/32-bit mode/compat mode/ ?
Because on native 32bit it should be working fine.
>
> For arrays with more than 16 entries, the old code would incorrectly
> advance the pages pointer by 16 words instead of 16 compat_uptr_t.
> Fix by doing the pointer arithmetic inside get_compat_pages_array where
> pages32 is already a correctly-typed pointer.
>
> Discovered while working on PostgreSQL 18's new NUMA introspection code.
>
> Signed-off-by: Christoph Berg <myon@debian.org>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Fixes: 5b1b561ba73c ("mm: simplify compat_sys_move_pages")
Hmm, still not sure if 5b1b561ba73c really introduced the issue. I think
it only messed with the "pages" pointer, not with the "status" pointer?
Hmmmm
I assume we want to Cc stable. @Andrew can do that.
> Reported-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
> Reported-by: Tomas Vondra <tomas@vondra.me>
> Closes: https://www.postgresql.org/message-id/flat/6342f601-77de-4ee0-8c2a-3deb50ceac5b%40vondra.me#86402e3d80c031788f5f55b42c459471
> ---
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-07-01 18:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 15:17 [PATCH] Fix do_pages_stat to use compat_uptr_t Christoph Berg
2025-06-25 12:58 ` Dev Jain
2025-06-25 15:24 ` Christoph Berg
2025-06-25 15:42 ` David Hildenbrand
2025-07-01 16:58 ` [PATCH v2] mm/migrate: Fix do_pages_stat in 32-bit mode Christoph Berg
2025-07-01 17:09 ` Zi Yan
2025-07-01 17:55 ` [PATCH v3] " Christoph Berg
2025-07-01 18:17 ` David Hildenbrand [this message]
2025-07-03 17:39 ` Christoph Berg
2025-06-25 20:39 ` [PATCH] Fix do_pages_stat to use compat_uptr_t Andrew Morton
2025-06-25 21:10 ` Christoph Berg
2025-06-25 21:15 ` Andrew Morton
2025-06-26 8:16 ` David Hildenbrand
2025-06-26 19:21 ` Christoph Berg
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=069a44c4-754e-41b7-9a42-7c2b77afdd37@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=gourry@gourry.net \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=myon@debian.org \
--cc=rakie.kim@sk.com \
--cc=ying.huang@linux.alibaba.com \
--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