patches: add v1.11.0 no-symlinks patch and its leil-rig proof
build / build (push) Successful in 9m26s

0005-posix-no-symlinks.patch makes VersityGW's posix backend resolve every
path below its root and versioning directory from a descriptor of that
directory, opened once at start: each directory on the way with openat2
and RESOLVE_NO_SYMLINKS|RESOLVE_BENEATH (one O_NOFOLLOW open per element
where openat2 is missing), the last element acted on without following
it. Upstream followed a link anywhere on a key's way, so on a host that
mounts more than one namespace a link planted in a bucket served,
overwrote and deleted another namespace's objects (Norn M5 stage 13).

A link, FIFO, socket or device is no object: at the end of a key it
reads as missing (404) and is never opened, on the way it answers as a
file there does (404, 409 ObjectParentIsFile), listings skip it and
never enter it, and PUT, copy, complete and DELETE act on the entry
itself, never on what a link points to (owner, 2026-11-27).
--bucketlinks still follows a link at the bucket level only.

Proven on leil-rig on 2026-11-27, against a stock 0001-0004 control:
- tests/no-symlinks/proof.sh, throwaway gateways on leil-test-1:
  87/87 (control 38/87).
- tests/no-symlinks/rig-replay.sh, with the build pinned on the rig's
  four instances: 75/75 twice (control 17/75).
- rig-gateway-check.sh 20/20 in both namespaces.
- go test, every package but plugins/: 35/35.
The rig was put back on 26e5a763.

docs/no-symlinks.md has the rules, the proof and what it costs: GET
+3-9%, HEAD +8-25%, listings 2x on a local disk and within noise on
LeilFS. README.md and docs/multi-version-pipeline.md name the patch and
how to check a rebase of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-27 01:50:15 -06:00
1 parent a52f92c100
commit 11d219961a
9 files changed
+4864 -13

No files matched your search

+46 -7
View File
@@ -14,7 +14,7 @@ Artifact names are intentionally **unchanged** — the binary stays
drop-in compatible with existing configs, systemd units, and the
`versitygw` CLI. Only the embedded web UI is rebranded to "S3 Gateway".
The v1.11.0 series also carries two behavioural patches:
The v1.11.0 series also carries three behavioural patches:
- **Owner-scoped bucket access**: a bucket's ACL and policy may name
only the owner's own keys, public access is read-only, and deleting a
@@ -26,6 +26,10 @@ The v1.11.0 series also carries two behavioural patches:
instead of a delete and a create, so the account never goes missing
and a failed update leaves it as it was. See
[docs/vault-atomic-update.md](docs/vault-atomic-update.md).
- **No symbolic links**: the posix backend resolves every path without
following a symbolic link, so a link planted in a bucket never
reaches another namespace; a link, FIFO, socket or device is no
object. See [docs/no-symlinks.md](docs/no-symlinks.md).
```
upstream tag (vX.Y.Z) this repo
@@ -55,7 +59,8 @@ s3-gateway/
│ │ ├── 0001-webui-debrand.patch
│ │ ├── 0002-webui-dark-theme.patch
│ │ ├── 0003-owner-scoped-access.patch
│ │ └── 0004-vault-atomic-update-user.patch
│ │ ├── 0004-vault-atomic-update-user.patch
│ │ └── 0005-posix-no-symlinks.patch
│ └── archive/ # superseded; kept, not built
│ ├── v1.10.0/
│ ├── v1.8.0/
@@ -64,12 +69,14 @@ s3-gateway/
│ └── v1.5.0/
├── tests/
│ ├── owner-scope/ # leil-rig proof test for 0003 (proof.sh, s3req.py)
│ └── vault-update/ # leil-rig proof test for 0004 (proof.sh, watch.py, vaultproxy.py)
│ ├── vault-update/ # leil-rig proof test for 0004 (proof.sh, watch.py, vaultproxy.py)
│ └── no-symlinks/ # leil-rig proof tests for 0005 (proof.sh, race.py, rig-replay.sh, bench.sh/.py)
├── .gitea/workflows/build.yml
└── docs/
├── multi-version-pipeline.md
├── owner-scoped-access.md # what 0003 does, and its proof test
└── vault-atomic-update.md # what 0004 does, and its proof test
├── vault-atomic-update.md # what 0004 does, and its proof test
└── no-symlinks.md # what 0005 does, its proof tests and its cost
```
## Build locally
@@ -109,7 +116,7 @@ Currently maintained:
| Upstream tag | Patch set | Contents |
|--------------|---------------|--------------------------------------------------------------------------------------------------------------------------------|
| `v1.11.0` | `v1.11.0/` | `0001-webui-debrand.patch`, `0002-webui-dark-theme.patch`, `0003-owner-scoped-access.patch`, `0004-vault-atomic-update-user.patch` |
| `v1.11.0` | `v1.11.0/` | `0001-webui-debrand.patch`, `0002-webui-dark-theme.patch`, `0003-owner-scoped-access.patch`, `0004-vault-atomic-update-user.patch`, `0005-posix-no-symlinks.patch` |
**v1.11.0 is the only supported version.** It supersedes `v1.10.0`
with 42 further upstream fixes, so the older series — `v1.10.0`,
@@ -184,8 +191,9 @@ account's `UserID`.
- An ACL holding the `all-users` `READ` grant can be written back
unchanged (upstream answers `500`).
It and `0004` are the series' only patches outside `webui/`, and both
have unit tests: after a rebase run `go test ./auth/ ./s3api/...` (on
It, `0004` and `0005` are the series' only patches outside `webui/`,
and all three have unit tests: after a rebase run
`go test ./auth/ ./s3api/... ./backend/...` (on
Linux — on Windows upstream's standalone-IAM, posix and CLI tests fail
with or without the series) and
the leil-rig proof test in
@@ -215,6 +223,37 @@ Its unit tests run with the ones above (`go test ./auth/`); its
leil-rig proof test is in
[docs/vault-atomic-update.md](docs/vault-atomic-update.md#proving-the-patch-is-in-on-leil-rig).
### What the no-symlinks patch does
`0005-posix-no-symlinks.patch` makes the posix backend resolve every
path below its root and versioning directory from a descriptor of that
directory, opened once at start, with `openat2` and
`RESOLVE_NO_SYMLINKS|RESOLVE_BENEATH` for each directory on the way
(one `O_NOFOLLOW` open per element where `openat2` is missing), and the
last element acted on without following it. Upstream followed a link
anywhere on a key's way, so on a host that mounts more than one
namespace a link planted in a bucket served, overwrote and deleted
another namespace's objects.
- **A link, FIFO, socket or device is no object.** At the end of a key
it reads as missing (`404 NoSuchKey`) and is never opened; on the way
it answers as a file there does (reads `404`, writes
`409 ObjectParentIsFile`); listings skip it and never enter it.
- **Writes and deletes act on the entry itself.** PUT, a CopyObject
destination and CompleteMultipartUpload replace it; a DELETE of its
key removes it. What a link points to is never touched.
- **Still followed:** the root and versioning directory as named, and
with `--bucketlinks` a link at the bucket level only.
- `backend.MkdirAll`/`MoveFile` gain FS-taking forms
(`MkdirAllFS`/`MoveFileFS`) that the backend calls with its own file
system; the xattr metadata storer is wrapped to resolve the same way.
Sidecar metadata, ScoutFS's own calls and Windows are unchanged.
Its unit tests are Linux-only (`go test ./backend/posix/ -run
'NoFollow|RootFS'`, on xfs or ext4, also as root); its two-stage
leil-rig proof and what it costs are in
[docs/no-symlinks.md](docs/no-symlinks.md#proving-the-patch-is-in-on-leil-rig).
## Adding / refreshing a version
When upstream cuts a new release you want a build of, you rebase the