diff options
| author | Shigeru Yoshida <syoshida@redhat.com> | 2026-03-21 22:29:11 +0900 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-04-05 13:53:34 -0700 |
| commit | 4fb61d95ad21c3b6f1c09f357ff49d70abb0535e (patch) | |
| tree | d23fb5c7457797d3b0524555c65449d52bf8b9ee /include/linux/stringify.h | |
| parent | 1871d548fc4feb007644efb6d669c93a4e191254 (diff) | |
mm/zsmalloc: copy KMSAN metadata in zs_page_migrate()
zs_page_migrate() uses copy_page() to copy the contents of a zspage page
during migration. However, copy_page() is not instrumented by KMSAN, so
the shadow and origin metadata of the destination page are not updated.
As a result, subsequent accesses to the migrated page are reported as
use-after-free by KMSAN, despite the data being correctly copied.
Add a kmsan_copy_page_meta() call after copy_page() to propagate the KMSAN
metadata to the new page, matching what copy_highpage() does internally.
Link: https://lkml.kernel.org/r/20260321132912.93434-1-syoshida@redhat.com
Fixes: afb2d666d025 ("zsmalloc: use copy_page for full page copy")
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/stringify.h')
0 files changed, 0 insertions, 0 deletions
