mm/secretmem: one fix and one refactoring
Status from this message: [merged mm-stable] mm-merge-folio_is_secretmem-and-folio_fast_pin_allowed-into-gup_fast_folio_allowed.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesApplied 3/3
- v13 patches 7 repliesSuperseded 1 of 3 applied
Changes in v2 from the cover letter
* "mm/secretmem: fix GUP-fast succeeding on secretmem folios" -> Drop the LRU check completely
-> Rephrase patch description
-> (Dropped RB from Mike)
* "selftests/memfd_secret: add vmsplice() test"
-> Add test with fresh+existing page
-> Change pass/fail message
-> Rephrase patch description
-> (Dropped RB from Mike)
* "mm: merge folio_is_secretmem() and folio_fast_pin_allowed() into gup_fast_folio_allowed()"
-> Adjust to dropped LRU check
-> Rename folio_fast_pin_allowed() to gup_fast_folio_allowed() -> Rephrase patch description
-> Add RB from Mike
Patches in v2 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | mm/secretmem: fix GUP-fast succeeding on secretmem foliosinclude/ | +2 | 1 reply | Applied |
| 2/3 | selftests/memfd_secret: add vmsplice() testtools/ | +49 | 3 replies | Applied |
| 3/3 | mm: merge folio_is_secretmem() and folio_fast_pin_allowed() into gup_fast_folio_allowed()include/ mm/ | +30 | 0 replies | Applied |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Miklos Szeredi | Mike Rapoport (IBM) |
|---|---|---|
| 1/3 | Debugged-by T-b | R-b |
| 2/3 | R-b | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/3] mm/secretmem: one fix and one refactoring
Patch #1 fixes a GUP-fast issue, whereby we might succeed in pinning secretmem folios. Patch #2 extends the memfd_secret selftest to cover that case. Patch #3 removes folio_is_secretmem() and instead lets folio_fast_pin_allowed() cover that case as well.
With this series, the reproducer (+selftests) works as expected. To test patch #3, the gup_longterm test does exactly what we need, and keeps on working as expected.
Without the fix:
TAP version 13
1..6
ok 1 mlock limit is respected
ok 2 file IO is blocked as expected
not ok 3 vmsplice: unexpected memory access with fresh page ok 4 vmsplice is blocked as expected with existing page ok 5 process_vm_read is blocked as expected
ok 6 ptrace is blocked as expected
# Totals: pass:5 fail:1 xfail:0 xpass:0 skip:0 error:0
With the fix:
TAP version 13
1..6
ok 1 mlock limit is respected
ok 2 file IO is blocked as expected
ok 3 vmsplice is blocked as expected with fresh page ok 4 vmsplice is blocked as expected with existing page ok 5 process_vm_read is blocked as expected ok 6 ptrace is blocked as expected
# Totals: pass:6 fail:0 xfail:0 xpass:0 skip:0 error:0
v1 -> v2:
* "mm/secretmem: fix GUP-fast succeeding on secretmem folios" -> Drop the LRU check completely
-> Rephrase patch description
-> (Dropped RB from Mike)
* "selftests/memfd_secret: add vmsplice() test"
-> Add test with fresh+existing page
-> Change pass/fail message
-> Rephrase patch description
-> (Dropped RB from Mike)
* "mm: merge folio_is_secretmem() and folio_fast_pin_allowed() into gup_fast_folio_allowed()"
-> Adjust to dropped LRU check
-> Rename folio_fast_pin_allowed() to gup_fast_folio_allowed() -> Rephrase patch description
-> Add RB from Mike
David Hildenbrand (3):
mm/secretmem: fix GUP-fast succeeding on secretmem folios selftests/memfd_secret: add vmsplice() test
mm: merge folio_is_secretmem() and folio_fast_pin_allowed() into
gup_fast_folio_allowed()
include/linux/secretmem.h | 21 +--------- mm/gup.c | 48 ++++++++++++--------- tools/testing/selftests/mm/memfd_secret.c | 51 ++++++++++++++++++++++- 3 files changed, 79 insertions(+), 41 deletions(-)
Signature · 1 line
2.43.2