Commit e712060
committed
vfs: check umounted in CloneTreeToAnonNS
CloneTreeToAnonNS validated namespace membership but did not check
Mount.umounted. After umount2(MNT_DETACH), a mount's .umounted flag is
set but .ns is not cleared until the last reference is dropped, so a
detached-but-referenced mount passed the existing check and could be
cloned via open_tree(OPEN_TREE_CLONE), then re-attached via
move_mount(2) -- reversing the detach.
This mirrors the fix in 6a112c6 for
BindAt, ConnectMountAt, MoveMountAt, and propagateMount.
Fixes #134811 parent 2cb8057 commit e712060
2 files changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
260 | 267 | | |
261 | 268 | | |
262 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
733 | 762 | | |
734 | 763 | | |
735 | 764 | | |
| |||
0 commit comments