Commit 10d04c2
mm/migrate: fix do_pages_stat in compat mode
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.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 5b1b561 ("mm: simplify compat_sys_move_pages")
Signed-off-by: Christoph Berg <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Suggested-by: David Hildenbrand <[email protected]>
Reported-by: Bertrand Drouvot <[email protected]>
Reported-by: Tomas Vondra <[email protected]>
Closes: https://www.postgresql.org/message-id/flat/6342f601-77de-4ee0-8c2a-3deb50ceac5b%40vondra.me#86402e3d80c031788f5f55b42c459471
Cc: Alistair Popple <[email protected]>
Cc: Byungchul Park <[email protected]>
Cc: Gregory Price <[email protected]>
Cc: "Huang, Ying" <[email protected]>
Cc: Joshua Hahn <[email protected]>
Cc: Mathew Brost <[email protected]>
Cc: Rakie Kim <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent bb1b592 commit 10d04c2
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2399 | 2399 | | |
2400 | 2400 | | |
2401 | 2401 | | |
| 2402 | + | |
2402 | 2403 | | |
2403 | 2404 | | |
2404 | 2405 | | |
2405 | 2406 | | |
2406 | 2407 | | |
2407 | 2408 | | |
2408 | 2409 | | |
2409 | | - | |
| 2410 | + | |
2410 | 2411 | | |
2411 | 2412 | | |
2412 | 2413 | | |
| |||
2425 | 2426 | | |
2426 | 2427 | | |
2427 | 2428 | | |
| 2429 | + | |
2428 | 2430 | | |
2429 | 2431 | | |
2430 | 2432 | | |
2431 | 2433 | | |
2432 | 2434 | | |
2433 | 2435 | | |
2434 | | - | |
| 2436 | + | |
2435 | 2437 | | |
2436 | 2438 | | |
2437 | | - | |
| 2439 | + | |
2438 | 2440 | | |
2439 | 2441 | | |
2440 | 2442 | | |
2441 | 2443 | | |
2442 | 2444 | | |
2443 | 2445 | | |
2444 | | - | |
| 2446 | + | |
| 2447 | + | |
2445 | 2448 | | |
2446 | 2449 | | |
2447 | | - | |
2448 | | - | |
| 2450 | + | |
2449 | 2451 | | |
2450 | 2452 | | |
2451 | 2453 | | |
| |||
0 commit comments