In the example showing how locked mounts in a less privileged mount
namespace can not be split, first </etc/shadow> is bind mounted, then an
attempt is done to unmount </mnt/dir>, which gives an error complaining
that </etc/shadow> is not mounted. The unmount should also refer to
</etc/shadow>.
Fixes: 906ab4945cd3 (2021-08-20; "mount_namespaces.7: Rewrite locked mounts examples to use/etc/shadow")
Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=217709>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
Cc: Rajesh <r.pandian@gmail.com>
Message-ID: <26546.13734.573762.288144@gargle.gargle.HOWL>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
.EX
# \fBunshare \-\-user \-\-map\-root\-user \-\-mount \[rs]\fP
\fBstrace \-o /tmp/log \[rs]\fP
- \fBumount /mnt/dir\fP
+ \fBumount /etc/shadow\fP
umount: /etc/shadow: not mounted.
# \fBgrep \[aq]\[ha]umount\[aq] /tmp/log\fP
umount2("/etc/shadow", 0) = \-1 EINVAL (Invalid argument)