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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 12 Apr 2011 11:57:39 +0200
From:	Michal Marek <mmarek@...e.cz>
To:	Paul Bolle <pebolle@...cali.nl>
Cc:	"H. Peter Anvin" <hpa@...or.com>, linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, x86@...nel.org
Subject: Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

On 12.4.2011 07:01, Paul Bolle wrote:
> On Mon, 2011-04-11 at 17:08 +0200, Michal Marek wrote:
>> Subject: [PATCH] x86: Do not set the rood_dev field in bzImage
[...]
> I'm not familiar with the rdev command. I assume it allows one to
> manipulate the two rootdev bytes in a kernel image.

Yes.


> Anyhow, shouldn't
> the above patch be complemented with something like the following?
>
> diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
> index ee3a4ea..fdc60a0 100644

That makes sense. Will you send it as a proper patch or should I fold it 
into my patch?

Michal

> --- a/arch/x86/boot/tools/build.c
> +++ b/arch/x86/boot/tools/build.c
> @@ -130,7 +130,7 @@ static void die(const char * str, ...)
>
>   static void usage(void)
>   {
> -	die("Usage: build setup system [rootdev] [>  image]");
> +	die("Usage: build setup system [>  image]");
>   }
>
>   int main(int argc, char ** argv)
> @@ -138,39 +138,14 @@ int main(int argc, char ** argv)
>   	unsigned int i, sz, setup_sectors;
>   	int c;
>   	u32 sys_size;
> -	u8 major_root, minor_root;
>   	struct stat sb;
>   	FILE *file;
>   	int fd;
>   	void *kernel;
>   	u32 crc = 0xffffffffUL;
>
> -	if ((argc<  3) || (argc>  4))
> +	if (argc != 3)
>   		usage();
> -	if (argc>  3) {
> -		if (!strcmp(argv[3], "CURRENT")) {
> -			if (stat("/",&sb)) {
> -				perror("/");
> -				die("Couldn't stat /");
> -			}
> -			major_root = major(sb.st_dev);
> -			minor_root = minor(sb.st_dev);
> -		} else if (strcmp(argv[3], "FLOPPY")) {
> -			if (stat(argv[3],&sb)) {
> -				perror(argv[3]);
> -				die("Couldn't stat root device.");
> -			}
> -			major_root = major(sb.st_rdev);
> -			minor_root = minor(sb.st_rdev);
> -		} else {
> -			major_root = 0;
> -			minor_root = 0;
> -		}
> -	} else {
> -		major_root = DEFAULT_MAJOR_ROOT;
> -		minor_root = DEFAULT_MINOR_ROOT;
> -	}
> -	fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
>
>   	/* Copy the setup code */
>   	file = fopen(argv[1], "r");
> @@ -193,8 +168,8 @@ int main(int argc, char ** argv)
>   	memset(buf+c, 0, i-c);
>
>   	/* Set the default root device */
> -	buf[508] = minor_root;
> -	buf[509] = major_root;
> +	buf[508] = DEFAULT_MINOR_ROOT;
> +	buf[509] = DEFAULT_MAJOR_ROOT;
>
>   	fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
>
>
>

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ