spiegel_podman/pkg/specgen/generate
Giuseppe Scrivano 458fcaa1ba
specgen: fix pod mount options leaking between mounts
Replace the JSON marshal/unmarshal round-trip in Inherit() with
copier.Copy. json.Unmarshal reuses existing slice backing arrays
and does not zero struct fields absent from the JSON (omitempty),
so mount options like "ro" from one mount would leak into another
mount at the same backing-array position.

Fixes the case where running:
  podman run --pod mypod \
    --mount type=bind,src=/a,target=/mylog \
    --mount type=bind,src=/b,target=/mytmp,ro=true \
    alpine touch /mylog/a

incorrectly fails with "Read-only file system" because /mylog
inherits "ro" from /mytmp.

Fixes: https://issues.redhat.com/browse/RHEL-154348

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-03-10 09:14:38 +01:00
..
kube api/compat: switch to moby/moby 2026-03-09 11:09:23 +01:00
config_common.go enable gofumpt formatter 2025-11-11 12:32:46 +01:00
config_common_test.go Fix: Improve error message for empty device modes in API requests 2025-07-31 16:24:29 +00:00
config_freebsd.go lint: reenable revive unused-parameter check 2025-10-01 10:42:08 -04:00
config_linux.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
config_linux_seccomp.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
config_linux_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container.go libpod: Validate that log tag requires journald driver 2026-03-04 14:48:46 +02:00
container_create.go specgen: fix pod mount options leaking between mounts 2026-03-10 09:14:38 +01:00
container_create_test.go specgen: fix pod mount options leaking between mounts 2026-03-10 09:14:38 +01:00
namespaces.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
namespaces_freebsd.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
namespaces_linux.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
oci.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
oci_freebsd.go Merge pull request #26445 from aaron-ang/update-ulimit 2026-01-16 08:38:00 -05:00
oci_linux.go Clamp rootless rlimits to host on format 2025-11-20 22:59:50 -08:00
pause_image.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
pod_create.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
pod_create_test.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
ports.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
ports_bench_test.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
ports_test.go Make most of libpod, and everything that relies on it, non-darwin 2026-02-27 22:18:36 +01:00
security_freebsd.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
security_linux.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
storage.go Merge pull request #28166 from mtrmac/platform-restriction 2026-03-03 10:27:57 -05:00
storage_freebsd.go Switch common, storage and image to monorepo. 2025-09-01 12:33:04 +02:00
storage_linux.go lint: reenable revive unused-parameter check 2025-10-01 10:42:08 -04:00
validate_freebsd.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
validate_linux.go pkg/specgen/generate/validate_linux.go: Remove Cgroups v1 2025-11-12 15:15:33 -05:00