Skip to content

Commit ba75d01

Browse files
authored
Merge pull request #1951 from microsoft/agents/issue-1608-link-unlinked
openvmm: pin the refusal to link a node whose last name is gone
2 parents 8d08ec0 + 2bc1c9c commit ba75d01

3 files changed

Lines changed: 54 additions & 20 deletions

File tree

‎doc/design/3.6-host-filesystem.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ names at and below the affected path in every node, and an exchanging rename
216216
swaps them. A rename that changes nothing on the host keeps them: one of a
217217
name onto itself, or, on a Linux host, one of a hard link onto another link of
218218
the same object. A Windows host removes the source link of the latter, and the
219-
names follow it.
219+
names follow it. A node whose names are all removed keeps the last one, where
220+
another object may since appear, so a hard link to the node fails with
221+
`ENOENT`, as Linux refuses to link an unlinked file.
220222

221223
`OPEN`, `OPENDIR`, and `CREATE` return handles. A handle owns a host
222224
descriptor, opened without following the final component, which every request

‎doc/openvmm-upstream-roadmap.md‎

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
- Mapped fork tip: `1e492803287f04b40bb7c17e8648c4b96af52ecc`, position 126. The graph, PR
1010
summary, and commit mapping below cover positions 001-126, the PR18 fixups at positions 302,
1111
333, 342, 345, 347, and 351, and the PR13 fixups at positions 340 and 349.
12-
- NVX's pinned OpenVMM revision: `8bea555dbb4e5ac9cbb2de041c1ba9a111b292b5`, position 351, the head
13-
of microsoft/openvmm#5217, whose commit follows position 350, `189dc519f`, the head of
12+
- NVX's pinned OpenVMM revision: `3aefff9ba4e7ff50d5d34671678da6b58cd423c6`, position 352, the head
13+
of microsoft/openvmm#5218, whose commit follows position 351, `8bea555db`, the head of
14+
microsoft/openvmm#5217, whose commit follows position 350, `189dc519f`, the head of
1415
microsoft/openvmm#5216, whose commit follows position 349, `2a483a06f`, the head of
15-
microsoft/openvmm#5215, whose commit follows position 348, `1270a975b`, the head of
16-
microsoft/openvmm#5214, whose commit follows position 347, `a533d6a55`, the head of
17-
microsoft/openvmm#5213, whose commit follows position 346, `c819952cf`, the head of
18-
microsoft/openvmm#5212, whose commit follows position 345, `8986cc537`, the head of
19-
microsoft/openvmm#5211, whose commit follows position 344, `076889dbb`, the head of
20-
`feature/microvm/dev`, where microsoft/openvmm#5210 landed position 344 on position 343,
21-
`afa0e9c20`, where microsoft/openvmm#5209 landed position 343 on position 342, `5c82edac4`, where
16+
`feature/microvm/dev`, where microsoft/openvmm#5215 landed position 349 on position 348,
17+
`1270a975b`, where microsoft/openvmm#5214 landed position 348 on position 347, `a533d6a55`, where
18+
microsoft/openvmm#5213 landed position 347 on position 346, `c819952cf`, where
19+
microsoft/openvmm#5212 landed position 346 on position 345, `8986cc537`, where
20+
microsoft/openvmm#5211 landed position 345 on position 344, `076889dbb`, where
21+
microsoft/openvmm#5210 landed position 344 on position 343, `afa0e9c20`, where
22+
microsoft/openvmm#5209 landed position 343 on position 342, `5c82edac4`, where
2223
microsoft/openvmm#5208 landed position 342 on position 341, `ed2d7e3a1`, where
2324
microsoft/openvmm#5207 landed position 341 on position 340, `32888344a`, where
2425
microsoft/openvmm#5206 landed position 340 on position 339, `b51f9156c`, the head of the
@@ -28,10 +29,10 @@
2829
landed, so each later commit's position is one less than before, and it added five fixups at its
2930
tip, positions 335-339. Of the 334 replayed commits, 47 conflicted with upstream and 13 replayed
3031
with new context; see [Conflicts of the v7.2 rebase](#conflicts-of-the-v72-rebase). The pin is
31-
225 commits past the mapped tip on the same first-parent chain. Positions 127-301, 303-332, 334,
32-
341, 343, 344, 346, 348, and 350 are not yet assigned to PRs, positions 302, 333, 342, 345, 347,
33-
and 351 are PR18 fixups, positions 340 and 349 are PR13 fixups, and positions 316 and 335-339 are
34-
rebase fixups; see [Commits after the mapped tip](#commits-after-the-mapped-tip).
32+
226 commits past the mapped tip on the same first-parent chain. Positions 127-301, 303-332, 334,
33+
341, 343, 344, 346, 348, 350, and 352 are not yet assigned to PRs, positions 302, 333, 342, 345,
34+
347, and 351 are PR18 fixups, positions 340 and 349 are PR13 fixups, and positions 316 and 335-339
35+
are rebase fixups; see [Commits after the mapped tip](#commits-after-the-mapped-tip).
3536
- Upstream main: `bf353460ff70e4a65627bb7003bed2cad1ce121f` (2026-11-21), the fork base; see
3637
[Upstream main past the fork base](#upstream-main-past-the-fork-base).
3738

@@ -1637,7 +1638,8 @@ bf353460f
16371638
-> PR13 fixup [349]
16381639
-> virtio-fs aggregate root reads too small for their next entry refused [350]
16391640
-> PR18 fixup [351]
1640-
-> 8bea555db (NVX pin)
1641+
-> virtio-fs links refused for nodes whose names are all gone [352]
1642+
-> 3aefff9ba (NVX pin)
16411643
```
16421644

16431645
For upstream review, PR01-PR03, PR05, PR06, and PR14 can be rebased independently onto current
@@ -1697,7 +1699,7 @@ tests.
16971699

16981700
## Commits after the mapped tip
16991701

1700-
The NVX pin extends the chain past position 126 without merges. Of its 225 later commits, positions
1702+
The NVX pin extends the chain past position 126 without merges. Of its 226 later commits, positions
17011703
302, 333, 342, 345, 347, and 351 are PR18 fixups, positions 340 and 349 are PR13 fixups, position
17021704
316 is the fixup of the v7.1 rebase, positions 335-339 are the fixups of the v7.2 rebase, and the
17031705
others are not yet classified or assigned to PRs.
@@ -1708,15 +1710,15 @@ of the v4.0 reorganization, positions 201-206 followed it, positions 207-213 fol
17081710
reorganization, positions 214 and 215 followed the v5.1 rebase, positions 216-253 followed the
17091711
v6.0 reorganization, positions 254-296 followed the v6.1 rebase, positions 297-315 followed the
17101712
v7.0 reorganization, position 316 is the v7.1 rebase's fixup, positions 317-334 followed the
1711-
v7.1 rebase, positions 335-339 are the v7.2 rebase's fixups, and positions 340-351 followed the
1713+
v7.1 rebase, positions 335-339 are the v7.2 rebase's fixups, and positions 340-352 followed the
17121714
v7.2 rebase, so they combine none, apart from
17131715
position 215, which combines v5.1 positions 222 and 223, and the commits that the v7.0
17141716
reorganization folded into them. Each commit through position 316 has the position that it had in
17151717
v7.0 and v7.1, and each of positions 317-334 is its v7.1 position less one, since the v7.2 rebase
17161718
dropped v7.1 position 317, upstream's microsoft/openvmm#5160, which v7.1 had backported. Each
17171719
commit's v6.1 position is its v6.0 position less seven, the number of commits that the v6.1 rebase
17181720
dropped before it, and its v6.0 position is its v5.1 position through 147 and one less from v5.1
1719-
position 149 on, and positions 297-351 have no earlier position; see
1721+
position 149 on, and positions 297-352 have no earlier position; see
17201722
[Conflicts of the v7.2 rebase](#conflicts-of-the-v72-rebase),
17211723
[The v7.0 reorganization](#the-v70-reorganization),
17221724
[Conflicts of the v6.1 rebase](#conflicts-of-the-v61-rebase), and
@@ -1954,6 +1956,7 @@ whose first 220 commits are those of `feature/microvm/release/v6.0`, and a v4.0
19541956
| 349 | `2a483a06f` | - | - | - | - | - | - | virtiofs: keep node names when renaming one hard link onto another (microsoft/openvmm#5215); fold into 048, its test into 166 |
19551957
| 350 | `189dc519f` | - | - | - | - | - | - | virtiofs: fail a synthetic root read too small for its next entry (microsoft/openvmm#5216) |
19561958
| 351 | `8bea555db` | - | - | - | - | - | - | virtiofs: skip gone or hidden entries in microVM READDIRPLUS (microsoft/openvmm#5217); fold into 083, its policy test into 160 |
1959+
| 352 | `3aefff9ba` | - | - | - | - | - | - | virtiofs: refuse to link a node whose last name is gone (microsoft/openvmm#5218) |
19571960

19581961
The remarks that say whether commits apply to upstream main record what was found on upstream main
19591962
when each commit was mapped: the v3.0 reorganization's base, `b2676222b`, for the commits that it
@@ -1964,7 +1967,7 @@ and `c0694c4da`, upstream main on 2026-11-16, for positions 297-306, `c4419be15`
19641967
main on 2026-11-19, for positions 321-324, `78af54a51`, upstream main on 2026-11-20, for position
19651968
325, `d83f87209`, upstream main later that day, for position 326, `265f0a73f`, upstream main
19661969
later still, for positions 327 and 328, and `bf353460f`, upstream main on 2026-11-21 and the v7.2
1967-
fork base, for positions 329-334 and 340-351.
1970+
fork base, for positions 329-334 and 340-352.
19681971
They name the positions that the commits have now, but neither the v7.2 rebase on `bf353460f`, the
19691972
v7.1 rebase on `9a875b563`, nor the v7.0 reorganization on `e6b458cc0` checked them again, nor did
19701973
the v6.1 rebase check the earlier ones on `7d90c4104`.
@@ -4705,6 +4708,35 @@ its `read_dir_with` already skips such entries. Replaying the commit there confl
47054708
microVM's `file.rs`, `fs_tests.rs`, and `policy_tests.rs`, which upstream main lacks, so it follows
47064709
PR18 upstream.
47074710

4711+
Position 352 has `FUSE_LINK` to a node whose names the guest has all removed fail with `ENOENT`, as
4712+
Linux's `linkat` fails for an unlinked file, rather than link whatever object has since appeared at
4713+
the node's last name (microsoft/nvx#1608). PR13's position 048 records the names through which the
4714+
guest reaches each node and drops them when the guest removes them or renames another entry over
4715+
them, and a node whose last name it drops keeps that name, which upstream's `VirtioFsInode::link`
4716+
linked: a guest that unlinked a file, or renamed another entry over it, and then put another object
4717+
at its name linked that object, recorded the new name for the stale node, and got the stale node's
4718+
ID with the other object's attributes. Since position 160's access policy, a link through a
4719+
read-only file's own node fails with `EXDEV`, so that the file gets no name in a writable path, but
4720+
through a stale node whose last name the file had taken, the guest could give it one. A new
4721+
`VirtioFsInode::object_path` returns a node's path only while the guest still knows a name for its
4722+
object, and `link` takes the target's path from it. The saved state keeps its format. It changes the
4723+
path that upstream's `VirtioFsInode::link` links in `inode.rs`, a line that no chain commit
4724+
changes, after the confinement checks that PR18's position 081 adds and PR27's position 126
4725+
changes, and adds `object_path` after upstream's `get_path`, which PR18's position 083 makes
4726+
`pub(crate)`, reading the names that position 048 adds; PR06's position 010, PR22's position 102,
4727+
positions 160, 165, 322, 331, 332, and 334, and PR13's fixup at position 349 also change the file.
4728+
It adds a test to the microVM's policy tests, which position 160 adds and positions 164, 194, 344,
4729+
and 346 and PR18's fixup at position 351 also change. It changes nothing that a mapped PR adds, and
4730+
it fixes no defect of position 048, whose names it reads: the defect is upstream's `link`, which
4731+
links the object at the target's last name; the names of position 048 only make it record the new
4732+
name for the target too, and the policy of position 160 only makes it a way to give a read-only
4733+
file a writable name, so it is not a PR13 fixup. Upstream main has the defect, in the same `link`,
4734+
since its nodes keep the name of their last lookup through removals, though without the names of
4735+
position 048, which tell that a node's names are gone, or a write policy. Replaying the commit
4736+
there conflicts in the microVM's `policy_tests.rs`, which upstream main lacks, and its
4737+
`object_path` reads the names that position 048 adds, which upstream main lacks too, so it cannot
4738+
go upstream on its own.
4739+
47084740
## PR summary
47094741

47104742
Each count is of v7.2 commits, which include the fixups that the v3.0, v4.0, v5.0, v6.0, and v7.0

0 commit comments

Comments
 (0)