lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 7 Nov 2007 23:10:20 +0300
From:	Al Boldi <a1426z@...ab.com>
To:	linux-kernel@...r.kernel.org
Cc:	hpa@...or.com, akpm@...ux-foundation.org
Subject: Re: [PATCH] init: Introduce rootdir bootparm to select which dir to sys_chroot

Al Boldi wrote:
> This patch introduces a rootdir kernel boot parameter, which specifies the
> path to the kernel sys_chroot boot dir.
>
> This is useful for systems that have more than one distribution installed
> on the same fs/partition.
>
>
> Cc: H. Peter Anvin <hpa@...or.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Al Boldi <a1426z@...ab.com>
>
> ---
>
> --- a/init/do_mounts.c
> +++ b/init/do_mounts.c
> @@ -252,6 +252,15 @@ __setup("rootflags=", root_data_setup);
>  __setup("rootfstype=", fs_names_setup);
>  __setup("rootdelay=", root_delay_setup);
>
> +static char * __initdata root_dir;
> +static int __init root_dir_setup(char *str)
> +{
> +	root_dir = strcat("./",str);

This line is probably using an overloaded function that does not exist.
Use this instead:

static char __initdata root_dir[128];
static int __init root_dir_setup(char *str)
{
	strcpy(root_dir, "./");
	strlcat(root_dir, str, sizeof(root_dir) - strlen(root_dir) - 1);
	return 1;
}

> +__setup("rootdir=", root_dir_setup);
> +
>  static void __init get_fs_names(char *page)
>  {
>  	char *s = page;
> @@ -469,6 +478,10 @@ void __init prepare_namespace(void)
>  	mount_root();
>  out:
>  	sys_mount(".", "/", NULL, MS_MOVE, NULL);
> +
> +	if(root_dir)
> +		sys_chdir(root_dir);
> +
>  	sys_chroot(".");
>  	security_sb_post_mountroot();
>  }


Thanks!

--
Al

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists