if (saved_root_name[0]) {
root_device_name = saved_root_name; // <---- (!) usage of a cut-down root param
if (!strncmp(root_device_name, "mtd", 3) ||
!strncmp(root_device_name, "ubi", 3)) {
mount_block_root(root_device_name, root_mountflags);
Does not look like we are hitting either EACCES or EINVAL and so we fall through to panic():
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic/tree/init/do_mounts.c?id=Ubuntu-4.15.0-47.50#n381
void __init mount_block_root(char *name, int flags)
// ...
for (p = fs_names; *p; p += strlen(p)+1) {
int err = do_mount_root(name, p, flags, root_mount_data);
switch (err) {
case 0:
goto out;
case -EACCES:
case -EINVAL:
continue;
}
/*
* Allow the user to distinguish between failed sys_open
* and bad superblock on root device.
* and give them a list of the available devices
*/
#ifdef CONFIG_BLOCK
__bdevname(ROOT_DEV, b);
#endif
printk("VFS: Cannot open root device \"%s\" or %s: error %d\n",
root_device_name, b, err);
printk("Please append a correct \"root=\" boot option; here are the available partitions:\n");
printk_all_partitions();
#ifdef CONFIG_DEBUG_BLOCK_EXT_DEVT
printk("DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify "
"explicit textual name for \"root=\" boot option.\n");
#endif
panic("VFS: Unable to mount root fs on %s", b);
echo -n 'BOOT_IMAGE=http:// 10.10.101. 2:5248/ images/ ubuntu/ amd64/generic/ bionic/ daily/boot- kernel nomodeset ro root=squash:http:// 10.10.101. 2:5248/ images/ ubuntu/ amd64/generic/ bionic/ daily/squashfs ip=:::: maas-vhost6: BOOTIF ip6=off overlayroot=tmpfs overlayroot_ cfgdisk= disabled cc:{'datasource _list': ['MAAS']}end_cc cloud-config-url=http:// 10.10.101. 2:5248/ MAAS/metadata/ latest/ by-id/xeqrrw/ ?op=get_ preseed apparmor=0 log_host= 10.10.101. 2 log_port=5247 --- console= ttyS0,115200 initrd=http:// 10.10.101. 2:5248/ images/ ubuntu/ amd64/generic/ bionic/ daily/boot- initrd BOOTIF= 01-52-54- 00-3f-ae- 46' | wc -c
576
arch/x86/ include/ asm/setup. h:
#define COMMAND_LINE_SIZE 2048
#define PARAM_SIZE 4096 /* sizeof(struct boot_params) */
Doesn't look like we are any close to the kernel limits on parameters.
However, the root argument as printed in the panic message looks like a 64-byte string (last byte for null termination):
echo -n 'squash:http:// 10.10.101. 2:5248/ images/ ubuntu/ amd64/generic/ bion' | wc -c
63
It looks like this is coming from the following code (strlcpy into a 64-byte array):
https:/ /git.launchpad. net/~ubuntu- kernel/ ubuntu/ +source/ linux/+ git/bionic/ tree/init/ do_mounts. c?id=Ubuntu- 4.15.0- 47.50#n42
static char __initdata saved_root_ name[64] ;
static int __init root_dev_setup(char *line) saved_root_ name, line, sizeof( saved_root_ name));
{
strlcpy(
return 1;
}
__setup("root=", root_dev_setup);
And the overall code-path (judging by the md auto-detection log messages):
https:/ /git.launchpad. net/~ubuntu- kernel/ ubuntu/ +source/ linux/+ git/bionic/ tree/init/ do_mounts. c?id=Ubuntu- 4.15.0- 47.50#n545
prepare_namespace ->
if (saved_ root_name[ 0]) { root_device_ name, "mtd", 3) || strncmp( root_device_ name, "ubi", 3)) { block_root( root_device_ name, root_mountflags);
root_device_name = saved_root_name; // <---- (!) usage of a cut-down root param
if (!strncmp(
!
mount_
Does not look like we are hitting either EACCES or EINVAL and so we fall through to panic():
https:/ /git.launchpad. net/~ubuntu- kernel/ ubuntu/ +source/ linux/+ git/bionic/ tree/init/ do_mounts. c?id=Ubuntu- 4.15.0- 47.50#n381 root(char *name, int flags) ROOT_DEV, b); device_ name, b, err);
void __init mount_block_
// ...
for (p = fs_names; *p; p += strlen(p)+1) {
int err = do_mount_root(name, p, flags, root_mount_data);
switch (err) {
case 0:
goto out;
case -EACCES:
case -EINVAL:
continue;
}
/*
* Allow the user to distinguish between failed sys_open
* and bad superblock on root device.
* and give them a list of the available devices
*/
#ifdef CONFIG_BLOCK
__bdevname(
#endif
printk("VFS: Cannot open root device \"%s\" or %s: error %d\n",
root_
printk("Please append a correct \"root=\" boot option; here are the available partitions:\n");
printk_ all_partitions( ); DEBUG_BLOCK_ EXT_DEVT "DEBUG_ BLOCK_EXT_ DEVT is enabled, you need to specify "
#ifdef CONFIG_
printk(
"explicit textual name for \"root=\" boot option.\n");
#endif
panic("VFS: Unable to mount root fs on %s", b);