Re: [PATCH] fs: check pointer returned by get_fsdevice_by_path before dereferencing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sascha,

On Mon, Mar 19, 2018 at 09:36:29AM +0100, Sascha Hauer wrote:
> ...
> I wonder though what calls into the filesystem layer before / is
> mounted in your case.
>

The issue is trigger by function stat() in start_barebox(), right before
I expect to have a shell.

Here.

	if (IS_ENABLED(CONFIG_COMMAND_SUPPORT)) {
		pr_info("running /env/bin/init...\n");

		if (!stat("/env/bin/init", &s))
			run_command("source /env/bin/init");
		else
			pr_err("/env/bin/init not found\n");
	}

My configuration is very minimal for now. I do not have (yet) any FS
selected (excepted devfs) and I do not have any root device mounted
either in this configuration.

I guess this is why fs_dev_root is NULL and why get_fsdevice_by_path()
returns fs_dev_root (because there is nothing to iterate in list
fs_device_list).

Gael

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux