spiegel_podman/pkg/util
rcmadhankumar bf7dcd5619 Fix: Remove appending rw as the default mount option
The backstory for this is that runc 1.2 (opencontainers/runc#3967)
fixed a long-standing bug in our mount flag handling (a bug that crun
still has). Before runc 1.2, when dealing with locked mount flags that
user namespaced containers cannot clear, trying to explicitly clearing
locked flags (like rw clearing MS_RDONLY) would silently ignore the rw
flag in most cases and would result in a read-only mount. This is
obviously not what the user expects.

What runc 1.2 did is that it made it so that passing clearing flags
like rw would always result in an attempt to clear the flag (which was
not the case before), and would (in all cases) explicitly return an
error if we try to clear locking flags. (This also let us finally fix a
bunch of other long-standing issues with locked mount flags causing
seemingly spurious errors).

The problem is that podman sets rw on all mounts by default (even if
the user doesn't specify anything). This is actually a no-op in
runc 1.1 and crun because of a bug in how clearing flags were handled
(rw is the absence of MS_RDONLY but until runc 1.2 we didn't correctly
track clearing flags like that, meaning that rw would literally be
handled as if it were not set at all by users) but in runc 1.2 leads to
unfortunate breakages and a subtle change in behaviour (before, a ro
mount being bind-mounted into a container would also be ro -- though
due to the above bug even setting rw explicitly would result in ro in
most cases -- but with runc 1.2 the mount will always be rw even if
the user didn't explicitly request it which most users would find
surprising). By the way, this "always set rw" behaviour is a departure
from Docker and it is not necesssary.

Signed-off-by: rcmadhankumar <madhankumar.chellamuthu@suse.com>
2025-04-23 17:18:03 +05:30
..
camelcase Fix typos 2023-02-11 18:23:24 +01:00
changes.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
changes_test.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
filters.go Replace strings.SplitN with strings.Cut 2024-01-11 13:50:15 +00:00
filters_test.go bump go to 1.22 2024-09-03 15:14:15 +02:00
kube.go Kube Play - allow creating image based volumes 2024-01-24 11:55:29 +02:00
mount_opts.go Fix: Remove appending rw as the default mount option 2025-04-23 17:18:03 +05:30
mount_opts_linux.go util: rename files to snake case 2024-03-21 11:33:02 +01:00
mount_opts_other.go util: rename files to snake case 2024-03-21 11:33:02 +01:00
utils.go pkg/util: remove redundant min/max helper functions 2025-03-06 21:39:36 +08:00
utils_darwin.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
utils_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
utils_linux.go Fix race condition when listing /dev 2024-08-12 10:28:01 -04:00
utils_linux_test.go Match VT device paths to be blocked from mounting exactly 2023-01-28 05:18:40 -05:00
utils_supported.go util: specify a not empty pause dir for root too 2024-05-06 12:14:00 +02:00
utils_test.go Fix: Remove appending rw as the default mount option 2025-04-23 17:18:03 +05:30
utils_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
utils_windows.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00