<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/namespace.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-07-06T09:04:15Z</updated>
<entry>
<title>userns and mnt_idmap leak in open_tree_attr(2)</title>
<updated>2025-07-06T09:04:15Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-24T14:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=142db4e76110dd80239f4e79810f85ea1735ad60'/>
<id>urn:sha1:142db4e76110dd80239f4e79810f85ea1735ad60</id>
<content type='text'>
[ Upstream commit 0748e553df0225754c316a92af3a77fdc057b358 ]

Once want_mount_setattr() has returned a positive, it does require
finish_mount_kattr() to release -&gt;mnt_userns.  Failing do_mount_setattr()
does not change that.

As the result, we can end up leaking userns and possibly mnt_idmap as
well.

Fixes: c4a16820d901 ("fs: add open_tree_attr()")
Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>attach_recursive_mnt(): do not lock the covering tree when sliding something under it</title>
<updated>2025-07-06T09:04:14Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-22T22:03:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=15633fe1f06d0e6a95502d6f07cf391a07a820a5'/>
<id>urn:sha1:15633fe1f06d0e6a95502d6f07cf391a07a820a5</id>
<content type='text'>
[ Upstream commit ce7df19686530920f2f6b636e71ce5eb1d9303ef ]

If we are propagating across the userns boundary, we need to lock the
mounts added there.  However, in case when something has already
been mounted there and we end up sliding a new tree under that,
the stuff that had been there before should not get locked.

IOW, lock_mnt_tree() should be called before we reparent the
preexisting tree on top of what we are adding.

Fixes: 3bd045cc9c4b ("separate copying and locking mount tree on cross-userns copies")
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>do_move_mount(): split the checks in subtree-of-our-ns and entire-anon cases</title>
<updated>2025-06-19T13:41:07Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-06T22:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=917677d599e269bf0495e1a314f16232ed586b7b'/>
<id>urn:sha1:917677d599e269bf0495e1a314f16232ed586b7b</id>
<content type='text'>
commit 290da20e333955637f00647d9fff7c6e3c0b61e0 upstream.

... and fix the breakage in anon-to-anon case.  There are two cases
acceptable for do_move_mount() and mixing checks for those is making
things hard to follow.

One case is move of a subtree in caller's namespace.
        * source and destination must be in caller's namespace
	* source must be detachable from parent
Another is moving the entire anon namespace elsewhere
	* source must be the root of anon namespace
	* target must either in caller's namespace or in a suitable
	  anon namespace (see may_use_mount() for details).
	* target must not be in the same namespace as source.

It's really easier to follow if tests are *not* mixed together...

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Fixes: 3b5260d12b1f ("Don't propagate mounts into detached trees")
Reported-by: Allison Karlitskaya &lt;lis@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Don't propagate mounts into detached trees</title>
<updated>2025-06-19T13:41:05Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-05-23T23:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02689a8961869170600321a9de819351cc9e69be'/>
<id>urn:sha1:02689a8961869170600321a9de819351cc9e69be</id>
<content type='text'>
commit 3b5260d12b1fe76b566fe182de8abc586b827ed0 upstream.

All versions up to 6.14 did not propagate mount events into detached
tree.  Shortly after 6.14 a merge of vfs-6.15-rc1.mount.namespace
(130e696aa68b) has changed that.

Unfortunately, that has caused userland regressions (reported in
https://lore.kernel.org/all/CAOYeF9WQhFDe+BGW=Dp5fK8oRy5AgZ6zokVyTj1Wp4EUiYgt4w@mail.gmail.com/)

Straight revert wouldn't be an option - in particular, the variant in 6.14
had a bug that got fixed in d1ddc6f1d9f0 ("fix IS_MNT_PROPAGATING uses")
and we don't want to bring the bug back.

This is a modification of manual revert posted by Christian, with changes
needed to avoid reintroducing the breakage in scenario described in
d1ddc6f1d9f0.

Cc: stable@vger.kernel.org
Reported-by: Allison Karlitskaya &lt;lis@redhat.com&gt;
Tested-by: Allison Karlitskaya &lt;lis@redhat.com&gt;
Acked-by: Christian Brauner &lt;brauner@kernel.org&gt;
Co-developed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>do_change_type(): refuse to operate on unmounted/not ours mounts</title>
<updated>2025-06-19T13:40:50Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-04T16:27:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19554c79a2095ddde850906a067915c1ef3a4114'/>
<id>urn:sha1:19554c79a2095ddde850906a067915c1ef3a4114</id>
<content type='text'>
[ Upstream commit 12f147ddd6de7382dad54812e65f3f08d05809fc ]

Ensure that propagation settings can only be changed for mounts located
in the caller's mount namespace. This change aligns permission checking
with the rest of mount(2).

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Fixes: 07b20889e305 ("beginning of the shared-subtree proper")
Reported-by: "Orlando, Noah" &lt;Noah.Orlando@deshaw.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clone_private_mnt(): make sure that caller has CAP_SYS_ADMIN in the right userns</title>
<updated>2025-06-19T13:40:50Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-02T00:11:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38628ae06e2a37770cd794802a3f1310cf9846e3'/>
<id>urn:sha1:38628ae06e2a37770cd794802a3f1310cf9846e3</id>
<content type='text'>
[ Upstream commit c28f922c9dcee0e4876a2c095939d77fe7e15116 ]

What we want is to verify there is that clone won't expose something
hidden by a mount we wouldn't be able to undo.  "Wouldn't be able to undo"
may be a result of MNT_LOCKED on a child, but it may also come from
lacking admin rights in the userns of the namespace mount belongs to.

clone_private_mnt() checks the former, but not the latter.

There's a number of rather confusing CAP_SYS_ADMIN checks in various
userns during the mount, especially with the new mount API; they serve
different purposes and in case of clone_private_mnt() they usually,
but not always end up covering the missing check mentioned above.

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Reported-by: "Orlando, Noah" &lt;Noah.Orlando@deshaw.com&gt;
Fixes: 427215d85e8d ("ovl: prevent private clone if bind mount is not allowed")
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: allow clone_private_mount() for a path on real rootfs</title>
<updated>2025-06-19T13:40:50Z</updated>
<author>
<name>KONDO KAZUMA(近藤　和真)</name>
</author>
<published>2025-05-15T12:18:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e56b53b6f17a7bcaab9f5f38215411920e6880f'/>
<id>urn:sha1:7e56b53b6f17a7bcaab9f5f38215411920e6880f</id>
<content type='text'>
[ Upstream commit 4954346d80fb047cb78776d9f2ebd6a050f80c5f ]

Mounting overlayfs with a directory on real rootfs (initramfs)
as upperdir has failed with following message since commit
db04662e2f4f ("fs: allow detached mounts in clone_private_mount()").

  [    4.080134] overlayfs: failed to clone upperpath

Overlayfs mount uses clone_private_mount() to create internal mount
for the underlying layers.

The commit made clone_private_mount() reject real rootfs because
it does not have a parent mount and is in the initial mount namespace,
that is not an anonymous mount namespace.

This issue can be fixed by modifying the permission check
of clone_private_mount() following [1].

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Fixes: db04662e2f4f ("fs: allow detached mounts in clone_private_mount()")
Link: https://lore.kernel.org/all/20250514190252.GQ2023217@ZenIV/ [1]
Link: https://lore.kernel.org/all/20250506194849.GT2023217@ZenIV/
Suggested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Kazuma Kondo &lt;kazuma-kondo@nec.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fix propagation graph breakage by MOVE_MOUNT_SET_GROUP move_mount(2)</title>
<updated>2025-06-19T13:40:49Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-03T21:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=327d444c951752fcba2e960eef4c0226ba4d0edc'/>
<id>urn:sha1:327d444c951752fcba2e960eef4c0226ba4d0edc</id>
<content type='text'>
[ Upstream commit d8cc0362f918d020ca1340d7694f07062dc30f36 ]

9ffb14ef61ba "move_mount: allow to add a mount into an existing group"
breaks assertions on -&gt;mnt_share/-&gt;mnt_slave.  For once, the data structures
in question are actually documented.

Documentation/filesystem/sharedsubtree.rst:
        All vfsmounts in a peer group have the same -&gt;mnt_master.  If it is
	non-NULL, they form a contiguous (ordered) segment of slave list.

do_set_group() puts a mount into the same place in propagation graph
as the old one.  As the result, if old mount gets events from somewhere
and is not a pure event sink, new one needs to be placed next to the
old one in the slave list the old one's on.  If it is a pure event
sink, we only need to make sure the new one doesn't end up in the
middle of some peer group.

"move_mount: allow to add a mount into an existing group" ends up putting
the new one in the beginning of list; that's definitely not going to be
in the middle of anything, so that's fine for case when old is not marked
shared.  In case when old one _is_ marked shared (i.e. is not a pure event
sink), that breaks the assumptions of propagation graph iterators.

Put the new mount next to the old one on the list - that does the right thing
in "old is marked shared" case and is just as correct as the current behaviour
if old is not marked shared (kudos to Pavel for pointing that out - my original
suggested fix changed behaviour in the "nor marked" case, which complicated
things for no good reason).

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Fixes: 9ffb14ef61ba ("move_mount: allow to add a mount into an existing group")
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>path_overmount(): avoid false negatives</title>
<updated>2025-06-19T13:40:49Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-01T18:02:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65b107ec5b9daba5f60e1ba96172b5b58df60ad0'/>
<id>urn:sha1:65b107ec5b9daba5f60e1ba96172b5b58df60ad0</id>
<content type='text'>
[ Upstream commit 5f31c549382bcddbbd754c72c5433b19420d485d ]

Holding namespace_sem is enough to make sure that result remains valid.
It is *not* enough to avoid false negatives from __lookup_mnt().  Mounts
can be unhashed outside of namespace_sem (stuck children getting detached
on final mntput() of lazy-umounted mount) and having an unrelated mount
removed from the hash chain while we traverse it may end up with false
negative from __lookup_mnt().  We need to sample and recheck the seqlock
component of mount_lock...

Bug predates the introduction of path_overmount() - it had come from
the code in finish_automount() that got abstracted into that helper.

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Fixes: 26df6034fdb2 ("fix automount/automount race properly")
Fixes: 6ac392815628 ("fs: allow to mount beneath top mount")
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs/fhandle.c: fix a race in call of has_locked_children()</title>
<updated>2025-06-19T13:40:49Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2025-06-01T18:23:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=287c7d34eedd37af1272dfb3b6e8656f4f026424'/>
<id>urn:sha1:287c7d34eedd37af1272dfb3b6e8656f4f026424</id>
<content type='text'>
[ Upstream commit 1f282cdc1d219c4a557f7009e81bc792820d9d9a ]

may_decode_fh() is calling has_locked_children() while holding no locks.
That's an oopsable race...

The rest of the callers are safe since they are holding namespace_sem and
are guaranteed a positive refcount on the mount in question.

Rename the current has_locked_children() to __has_locked_children(), make
it static and switch the fs/namespace.c users to it.

Make has_locked_children() a wrapper for __has_locked_children(), calling
the latter under read_seqlock_excl(&amp;mount_lock).

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Fixes: 620c266f3949 ("fhandle: relax open_by_handle_at() permission checks")
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
