Fixes for vma_merge() error path
Status from this message: [merged mm-stable] mmap-add-clarifying-comment-to-vma_merge-code.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 14 repliesApplied 3/3
- v23 patches 3 repliesSuperseded
- v13 patches 9 repliesSuperseded
Changes in v3 from the cover letter
- Updated dup_anon_vma() comment to include new argument.
- Change vma iterator undo to a reset and rewalk to ensure vma_iter_config() changes are dropped. - Thanks Vlastimil Babka
- Update user visible changes in patch 1 again. - Thanks Vlastimil Babka
- Only set the anon_dup vma when the duplication is successful. - Thanks Vlastimil Babka
Patches in v3 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | mmap: Fix vma_iterator in error path of vma_merge()mm/ | +8 | 2 replies | Applied |
| 2/3 | mmap: Fix error paths with dup_anon_vma()mm/ | +22 | 10 replies | Applied |
| 3/3 | mmap: Add clarifying comment to vma_merge() codemm/ | +5 | 2 replies | Applied |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Lorenzo Stoakes | Vlastimil Babka |
|---|---|---|
| 1/3 | R-b | A-b |
| 2/3 | R-b | A-b |
| 3/3 | R-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/3] Fixes for vma_merge() error path
Jann Horn reported a potential vma iterator issue in the failure path of the vma_merge() code. After examining the interface, it seemed the best course of action is to simply add an undo path in the unlikely case of an error.
On examining the vma iterator issue, another issue was discovered that would increase the memory usage during failure scenarios, so this is addressed in patch 2.
Since it is unclear in the code, another patch adds comments to the vma_merge() function on why dup_anon_vma() is safe in 'case 6'.
Changes since v2:
- Updated dup_anon_vma() comment to include new argument.
- Change vma iterator undo to a reset and rewalk to ensure vma_iter_config() changes are dropped. - Thanks Vlastimil Babka
- Update user visible changes in patch 1 again. - Thanks Vlastimil Babka
- Only set the anon_dup vma when the duplication is successful. - Thanks Vlastimil Babka
v2: https://lore.kernel.org/linux-mm/[email protected]/
v1: https://lore.kernel.org/linux-mm/[email protected]/
Liam R. Howlett (3):
mmap: Fix vma_iterator in error path of vma_merge()
mmap: Fix error paths with dup_anon_vma()
mmap: Add clarifying comment to vma_merge() code
mm/mmap.c | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-)
Signature · 1 line
2.40.1