|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3 |
|
| #
07f8230b |
| 02-Apr-2024 |
Justin Stitt <[email protected]> |
init: replace deprecated strncpy with strscpy_pad
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfa
init: replace deprecated strncpy with strscpy_pad
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces.
data_page wants to be NUL-terminated and NUL-padded, use strscpy_pad to provide both of these. data_page no longer awkwardly relies on init_mount to perform its NUL-termination, although that sanity check is left unchanged.
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: <[email protected]> Signed-off-by: Justin Stitt <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4 |
|
| #
386dc41c |
| 06-Feb-2024 |
Christian Brauner <[email protected]> |
init: flush async file closing
When unpacking the initramfs or when mounting block devices we need to ensure that any delayed fput() finished to prevent spurious errors. The init process can be a pr
init: flush async file closing
When unpacking the initramfs or when mounting block devices we need to ensure that any delayed fput() finished to prevent spurious errors. The init process can be a proper kernel thread or a user mode helper. In the latter case PF_KTHREAD isn't set. So we need to do both flush_delayed_work() and task_work_run().
Since we'll port block device opening and closing to regular file open and closing we need to ensure the same as for the initramfs. So just make that a little helper.
Tested-by: Marek Szyprowski <[email protected]> Tested-by: Srikanth Aithal <[email protected]> Link: https://lore.kernel.org/r/CA+G9fYttTwsbFuVq10igbSvP5xC6bf_XijM=mpUqrJV=uvUirQ@mail.gmail.com Signed-off-by: Christian Brauner <[email protected]>
show more ...
|
|
Revision tags: v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3 |
|
| #
21528c69 |
| 20-Nov-2023 |
Stefan Berger <[email protected]> |
rootfs: Fix support for rootfstype= when root= is given
Documentation/filesystems/ramfs-rootfs-initramfs.rst states:
If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by defaul
rootfs: Fix support for rootfstype= when root= is given
Documentation/filesystems/ramfs-rootfs-initramfs.rst states:
If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by default. To force ramfs, add "rootfstype=ramfs" to the kernel command line.
This currently does not work when root= is provided since then saved_root_name contains a string and rootfstype= is ignored. Therefore, ramfs is currently always chosen when root= is provided.
The current behavior for rootfs's filesystem is:
root= | rootfstype= | chosen rootfs filesystem ------------+-------------+-------------------------- unspecified | unspecified | tmpfs unspecified | tmpfs | tmpfs unspecified | ramfs | ramfs provided | ignored | ramfs
rootfstype= should be respected regardless whether root= is given, as shown below:
root= | rootfstype= | chosen rootfs filesystem ------------+-------------+-------------------------- unspecified | unspecified | tmpfs (as before) unspecified | tmpfs | tmpfs (as before) unspecified | ramfs | ramfs (as before) provided | unspecified | ramfs (compatibility with before) provided | tmpfs | tmpfs (new) provided | ramfs | ramfs (new)
This table represents the new behavior.
Fixes: 6e19eded3684 ("initmpfs: use initramfs if rootfstype= or root= specified") Cc: <[email protected]> Signed-off-by: Rob Landley <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Reviewed-and-Tested-by: Mimi Zohar <[email protected]> Signed-off-by: Stefan Berger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1 |
|
| #
84d2b696 |
| 07-Sep-2023 |
Jianyong Wu <[email protected]> |
init/mount: print pretty name of root device when panics
Given a wrong root device, current log may not give the pretty name which is useful to locate root cause.
For example, there are 2 blk devs
init/mount: print pretty name of root device when panics
Given a wrong root device, current log may not give the pretty name which is useful to locate root cause.
For example, there are 2 blk devs in a VM, /dev/vda which has 2 partitials /dev/vda1 and /dev/vda2 and /dev/vdb which is blank. /dev/vda2 is the right root dev. When set "root=/dev/vdb", we get error log:
[ 0.635575] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(254,16)
It's not straightforward to find out the root cause as there is lack of the root devive name therefore hard for people to get those info from the device number, in the example, (254,16).
It is more comprehensive way to hint the root cause if pretty name is given here, like:
[ 0.559887] Kernel panic - not syncing: VFS: Unable to mount root fs on "/dev/vdb" or unknown-block(254,16)
Signed-off-by: Jianyong Wu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
show more ...
|
|
Revision tags: v6.5, v6.5-rc7, v6.5-rc6 |
|
| #
45071e1c |
| 13-Aug-2023 |
Loic Poulain <[email protected]> |
init: Add support for rootwait timeout parameter
Add an optional timeout arg to 'rootwait' as the maximum time in seconds to wait for the root device to show up before attempting forced mount of the
init: Add support for rootwait timeout parameter
Add an optional timeout arg to 'rootwait' as the maximum time in seconds to wait for the root device to show up before attempting forced mount of the root filesystem.
Use case: In case of device mapper usage for the rootfs (e.g. root=/dev/dm-0), if the mapper is not able to create the virtual block for any reason (wrong arguments, bad dm-verity signature, etc), the `rootwait` param causes the kernel to wait forever. It may however be desirable to only wait for a given time and then panic (force mount) to cause device reset. This gives the bootloader a chance to detect the problem and to take some measures, such as marking the booted partition as bad (for A/B case) or entering a recovery mode.
In success case, mounting happens as soon as the root device is ready, unlike the existing 'rootdelay' parameter which performs an unconditional pause.
Signed-off-by: Loic Poulain <[email protected]> Message-Id: <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3 |
|
| #
6aee6723 |
| 18-May-2023 |
Angus Chen <[email protected]> |
init: add bdev fs printk if mount_block_root failed
Booting with the QEMU command line: "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..." will panic if ext4 is not builtin and a request
init: add bdev fs printk if mount_block_root failed
Booting with the QEMU command line: "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..." will panic if ext4 is not builtin and a request to load the ext4 module fails.
[ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.730603] Please append a correct "root=" boot option; here are the available partitions: [ 1.732323] fd00 256000 vda [ 1.732329] driver: virtio_blk [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0) [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 1.735772] Call Trace: [ 1.735950] <TASK> [ 1.736113] dump_stack_lvl+0x32/0x50 [ 1.736367] panic+0x108/0x310 [ 1.736570] mount_block_root+0x161/0x310 [ 1.736849] ? rdinit_setup+0x40/0x40 [ 1.737088] prepare_namespace+0x10c/0x180 [ 1.737393] kernel_init_freeable+0x354/0x450 [ 1.737707] ? rest_init+0xd0/0xd0 [ 1.737945] kernel_init+0x16/0x130 [ 1.738196] ret_from_fork+0x1f/0x30
As a hint, print all the bdev fstypes which are available.
[[email protected]: fix spelling in printk message] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Angus Chen <[email protected]> Acked-by: Nick Desaulniers <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Mike Rapoport (IBM) <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
73648e6f |
| 17-May-2023 |
Arnd Bergmann <[email protected]> |
init: move cifs_root_data() prototype into linux/mount.h
cifs_root_data() is defined in cifs and called from early init code, but lacks a global prototype:
fs/cifs/cifsroot.c:83:12: error: no previ
init: move cifs_root_data() prototype into linux/mount.h
cifs_root_data() is defined in cifs and called from early init code, but lacks a global prototype:
fs/cifs/cifsroot.c:83:12: error: no previous prototype for 'cifs_root_data'
Move the declaration from do_mounts.c into an appropriate header.
Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Dennis Zhou <[email protected]> Cc: Eric Paris <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Helge Deller <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Michal Simek <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Moore <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Russell King <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Waiman Long <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
702f3189 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
block: move the code to do early boot lookup of block devices to block/
Create a new block/early-lookup.c to keep the early block device lookup code instead of having this code sit with the early mo
block: move the code to do early boot lookup of block devices to block/
Create a new block/early-lookup.c to keep the early block device lookup code instead of having this code sit with the early mount code.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
079caa35 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: clear root_wait on all invalid root= strings
Instead of only clearing root_wait in devt_from_partuuid when the UUID format was invalid, do that in parse_root_device for all strings that failed
init: clear root_wait on all invalid root= strings
Instead of only clearing root_wait in devt_from_partuuid when the UUID format was invalid, do that in parse_root_device for all strings that failed to parse.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
cf056a43 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: improve the name_to_dev_t interface
name_to_dev_t has a very misleading name, that doesn't make clear it should only be used by the early init code, and also has a bad calling convention that
init: improve the name_to_dev_t interface
name_to_dev_t has a very misleading name, that doesn't make clear it should only be used by the early init code, and also has a bad calling convention that doesn't allow returning different kinds of errors. Rename it to early_lookup_bdev to make the use case clear, and return an errno, where -EINVAL means the string could not be parsed, and -ENODEV means it the string was valid, but there was no device found for it.
Also stub out the whole call for !CONFIG_BLOCK as all the non-block root cases are always covered in the caller.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
c0c1a7dc |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: move the nfs/cifs/ram special cases out of name_to_dev_t
The nfs/cifs/ram special case only needs to be parsed once, and only in the boot code. Move them out of name_to_dev_t and into prepare
init: move the nfs/cifs/ram special cases out of name_to_dev_t
The nfs/cifs/ram special case only needs to be parsed once, and only in the boot code. Move them out of name_to_dev_t and into prepare_namespace.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
3701c600 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: factor the root_wait logic in prepare_namespace into a helper
The root_wait logic is a bit obsfucated right now. Expand it and move it into a helper.
Signed-off-by: Christoph Hellwig <hch@ls
init: factor the root_wait logic in prepare_namespace into a helper
The root_wait logic is a bit obsfucated right now. Expand it and move it into a helper.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
07d63cbb |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: handle ubi/mtd root mounting like all other root types
Assign a Root_Generic magic value for UBI/MTD root and handle the root mounting in mount_root like all other root types. Besides making
init: handle ubi/mtd root mounting like all other root types
Assign a Root_Generic magic value for UBI/MTD root and handle the root mounting in mount_root like all other root types. Besides making the code more clear this also means that UBI/MTD root can be used together with an initrd (not that anyone should care).
Also factor parsing of the root name into a helper now that it can be easily done and will get more complicated with subsequent patches.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
73231b58 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: don't remove the /dev/ prefix from error messages
Remove the code that drops the /dev/ prefix from root_device_name, which is only used for error messages when mounting the root device fails.
init: don't remove the /dev/ prefix from error messages
Remove the code that drops the /dev/ prefix from root_device_name, which is only used for error messages when mounting the root device fails.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
c8643c72 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: pass root_device_name explicitly
Instead of declaring root_device_name as a global variable pass it as an argument to the functions using it.
Signed-off-by: Christoph Hellwig <[email protected]> Lin
init: pass root_device_name explicitly
Instead of declaring root_device_name as a global variable pass it as an argument to the functions using it.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
a6a41d39 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: refactor mount_root
Provide stubs for all the lower level mount helpers, and just switch on ROOT_DEV in the main function.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.ker
init: refactor mount_root
Provide stubs for all the lower level mount helpers, and just switch on ROOT_DEV in the main function.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
e3102722 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
init: rename mount_block_root to mount_root_generic
mount_block_root is also used to mount non-block file systems, so give it a better name.
Signed-off-by: Christoph Hellwig <[email protected]> Link: http
init: rename mount_block_root to mount_root_generic
mount_block_root is also used to mount non-block file systems, so give it a better name.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
aa5f6ed8 |
| 31-May-2023 |
Christoph Hellwig <[email protected]> |
driver core: return bool from driver_probe_done
bool is the most sensible return value for a yes/no return. Also add __init as this funtion is only called from the early boot code.
Signed-off-by:
driver core: return bool from driver_probe_done
bool is the most sensible return value for a yes/no return. Also add __init as this funtion is only called from the early boot code.
Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
| #
26e293f7 |
| 20-May-2023 |
Yihuan Pan <[email protected]> |
init: remove unused names parameter in split_fs_names()
The split_fs_names() function takes a names parameter, but the function actually uses the root_fs_names global variable instead. This names pa
init: remove unused names parameter in split_fs_names()
The split_fs_names() function takes a names parameter, but the function actually uses the root_fs_names global variable instead. This names parameter is not used in the function, so it can be safely removed.
This change does not affect the functionality of split_fs_names() or any other part of the kernel.
Signed-off-by: Yihuan Pan <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Message-Id: <4lsiigvaw4lxcs37rlhgepv77xyxym6krkqcpc3xfncnswok3y@b67z3b44orar> Signed-off-by: Christian Brauner <[email protected]>
show more ...
|
|
Revision tags: v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4, v6.3-rc3, v6.3-rc2, v6.3-rc1, v6.2, v6.2-rc8, v6.2-rc7, v6.2-rc6, v6.2-rc5, v6.2-rc4, v6.2-rc3, v6.2-rc2, v6.2-rc1, v6.1, v6.1-rc8, v6.1-rc7, v6.1-rc6, v6.1-rc5, v6.1-rc4, v6.1-rc3, v6.1-rc2, v6.1-rc1, v6.0, v6.0-rc7, v6.0-rc6, v6.0-rc5, v6.0-rc4, v6.0-rc3, v6.0-rc2 |
|
| #
a1d3a6d9 |
| 18-Aug-2022 |
Wolfram Sang <[email protected]> |
init: move from strlcpy with unused retval to strscpy
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated
init: move from strlcpy with unused retval to strscpy
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script.
Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.0-rc1, v5.19, v5.19-rc8, v5.19-rc7, v5.19-rc6, v5.19-rc5, v5.19-rc4, v5.19-rc3, v5.19-rc2, v5.19-rc1, v5.18, v5.18-rc7, v5.18-rc6, v5.18-rc5, v5.18-rc4, v5.18-rc3, v5.18-rc2, v5.18-rc1, v5.17, v5.17-rc8, v5.17-rc7, v5.17-rc6, v5.17-rc5, v5.17-rc4, v5.17-rc3, v5.17-rc2 |
|
| #
322cbb50 |
| 24-Jan-2022 |
Christoph Hellwig <[email protected]> |
block: remove genhd.h
There is no good reason to keep genhd.h separate from the main blkdev.h header that includes it. So fold the contents of genhd.h into blkdev.h and remove genhd.h entirely.
Si
block: remove genhd.h
There is no good reason to keep genhd.h separate from the main blkdev.h header that includes it. So fold the contents of genhd.h into blkdev.h and remove genhd.h entirely.
Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
|
Revision tags: v5.17-rc1, v5.16, v5.16-rc8, v5.16-rc7, v5.16-rc6, v5.16-rc5, v5.16-rc4, v5.16-rc3, v5.16-rc2, v5.16-rc1, v5.15, v5.15-rc7, v5.15-rc6, v5.15-rc5, v5.15-rc4, v5.15-rc3, v5.15-rc2 |
|
| #
40c8ee67 |
| 14-Sep-2021 |
Leon Romanovsky <[email protected]> |
init: don't panic if mount_nodev_root failed
Attempt to mount 9p file system as root gives the following kernel panic:
9pnet_virtio: no channels available for device root Kernel panic - not synci
init: don't panic if mount_nodev_root failed
Attempt to mount 9p file system as root gives the following kernel panic:
9pnet_virtio: no channels available for device root Kernel panic - not syncing: VFS: Unable to mount root "root" (9p), err=-2 CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc1+ #127 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x45/0x59 panic+0x1e2/0x44b ? __warn_printk+0xf3/0xf3 ? free_unref_page+0x2d4/0x4a0 ? trace_hardirqs_on+0x32/0x120 ? free_unref_page+0x2d4/0x4a0 mount_root+0x189/0x1e0 prepare_namespace+0x136/0x165 kernel_init_freeable+0x3b8/0x3cb ? rest_init+0x2e0/0x2e0 kernel_init+0x19/0x130 ret_from_fork+0x1f/0x30 Kernel Offset: disabled ---[ end Kernel panic - not syncing: VFS: Unable to mount root "root" (9p), err=-2 ]---
QEMU command line: "qemu-system-x86_64 -append root=/dev/root rw rootfstype=9p rootflags=trans=virtio ..."
This error is because root_device_name is truncated in prepare_namespace() from being "/dev/root" to be "root" prior to call to mount_nodev_root().
As a solution, don't treat errors in mount_nodev_root() as errors that require panics and allow failback to the mount flow that existed before patch citied in Fixes tag.
Fixes: f9259be6a9e7 ("init: allow mounting arbitrary non-blockdevice filesystems as root") Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Al Viro <[email protected]>
show more ...
|
| #
b51593c4 |
| 17-Sep-2021 |
Vivek Goyal <[email protected]> |
init/do_mounts.c: Harden split_fs_names() against buffer overflow
split_fs_names() currently takes comma separate list of filesystems and converts it into individual filesystem strings. Pleaces thes
init/do_mounts.c: Harden split_fs_names() against buffer overflow
split_fs_names() currently takes comma separate list of filesystems and converts it into individual filesystem strings. Pleaces these strings in the input buffer passed by caller and returns number of strings.
If caller manages to pass input string bigger than buffer, then we can write beyond the buffer. Or if string just fits buffer, we will still write beyond the buffer as we append a '\0' byte at the end.
Pass size of input buffer to split_fs_names() and put enough checks in place so such buffer overrun possibilities do not occur.
This patch does few things.
- Add a parameter "size" to split_fs_names(). This specifies size of input buffer.
- Use strlcpy() (instead of strcpy()) so that we can't go beyond buffer size. If input string "names" is larger than passed in buffer, input string will be truncated to fit in buffer.
- Stop appending extra '\0' character at the end and avoid one possibility of going beyond the input buffer size.
- Do not use extra loop to count number of strings.
- Previously if one passed "rootfstype=foo,,bar", split_fs_names() will return only 1 string "foo" (and "bar" will be truncated due to extra ,). After this patch, now split_fs_names() will return 3 strings ("foo", zero-sized-string, and "bar").
Callers of split_fs_names() have been modified to check for zero sized string and skip to next one.
Reported-by: xu xin <[email protected]> Signed-off-by: Vivek Goyal <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Al Viro <[email protected]>
show more ...
|
|
Revision tags: v5.15-rc1, v5.14 |
|
| #
c4b2b7d1 |
| 24-Aug-2021 |
Christoph Hellwig <[email protected]> |
block: remove CONFIG_DEBUG_BLOCK_EXT_DEVT
This might have been a neat debug aid when the extended dev_t was added, but that time is long gone.
Signed-off-by: Christoph Hellwig <[email protected]> Link: ht
block: remove CONFIG_DEBUG_BLOCK_EXT_DEVT
This might have been a neat debug aid when the extended dev_t was added, but that time is long gone.
Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
show more ...
|
|
Revision tags: v5.14-rc7, v5.14-rc6, v5.14-rc5, v5.14-rc4, v5.14-rc3, v5.14-rc2 |
|
| #
6e7c1770 |
| 14-Jul-2021 |
Christoph Hellwig <[email protected]> |
fs: simplify get_filesystem_list / get_all_fs_names
Just output the '\0' separate list of supported file systems for block devices directly rather than going through a pointless round of string mani
fs: simplify get_filesystem_list / get_all_fs_names
Just output the '\0' separate list of supported file systems for block devices directly rather than going through a pointless round of string manipulation.
Based on an earlier patch from Al Viro <[email protected]>.
Vivek: Modified list_bdev_fs_names() and split_fs_names() to return number of null terminted strings to caller. Callers now use that information to loop through all the strings instead of relying on one extra null char being present at the end.
Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Vivek Goyal <[email protected]> Signed-off-by: Al Viro <[email protected]>
show more ...
|