Re: Problem with busybox mount -o remount and long lines in /proc/mounts

2025-12-15 Thread Natanael Copa
On Mon, 15 Dec 2025 18:59:37 +0100
Natanael Copa  wrote:

> Hi!
> 
> We have bumped into a problem with busybox mount, which does not handle
> remounts very well if there are lines in /proc/mounts that are longer
> than 504 bytes.
> 
> This happens in docker on fedora 43, which has the longest line of 591 bytes.

The downstream bug report is found here:

https://github.com/k0sproject/k0s/issues/6774
___
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox


Problem with busybox mount -o remount and long lines in /proc/mounts

2025-12-15 Thread Natanael Copa
Hi!

We have bumped into a problem with busybox mount, which does not handle
remounts very well if there are lines in /proc/mounts that are longer
than 504 bytes.

This happens in docker on fedora 43, which has the longest line of 591 bytes.

This can be reproduce with this patch:

diff --git a/util-linux/mount.c b/util-linux/mount.c
index d0f0ae1ad..9115207c5 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -2385,6 +2385,8 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
// take -o opts from mtab (takes only mount source).
fstabname = bb_path_mtab_file;
}
+   // DEBUG
+   fstabname = "/tmp/fake-mounts";
fstab = setmntent(fstabname, "r");
if (!fstab)
bb_perror_msg_and_die("can't read '%s'", fstabname);



and then create a /tmp/fake-mounts:

cat > /tmp/fake-mounts