public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andries Brouwer <aeb@veritas.com>
To: Marcus Sundberg <marcus@cendio.se>
Cc: linux-kernel@vger.kernel.org
Subject: Re: real_root_dev
Date: Tue, 28 Nov 2000 01:49:05 +0100	[thread overview]
Message-ID: <20001128014905.B9220@veritas.com> (raw)
In-Reply-To: <200011270556.VAA12506@baldur.yggdrasil.com> <20001127094139.H599@almesberger.net> <200011270839.AAA28672@pizda.ninka.net> <20001127182113.A15029@athlon.random> <20001127182113.A15029@athlon.random> <20001127123655.A16930@munchkin.spectacle-pond.org> <vey9y5umvv.fsf@lipta.cendio.se>
In-Reply-To: <vey9y5umvv.fsf@lipta.cendio.se>; from marcus@cendio.se on Mon, Nov 27, 2000 at 10:27:00PM +0100

On Mon, Nov 27, 2000 at 10:27:00PM +0100, Marcus Sundberg wrote:

> This reminded me of an old bug which apparently still hasn't been
> fixed (not in 2.2 at least). In init/main.c we have:
> 
> extern int rd_image_start;	/* starting block # of image */
> #ifdef CONFIG_BLK_DEV_INITRD
> kdev_t real_root_dev;
> #endif
> #endif
> 
> int root_mountflags = MS_RDONLY;
> 
> and then in kernel/sysctl.c:
> 
> #ifdef CONFIG_BLK_DEV_INITRD
> 	{KERN_REALROOTDEV, "real-root-dev", &real_root_dev, sizeof(int),
> 	 0644, NULL, &proc_dointvec},
> #endif
> 
> Because rd_image_start and root_mountflags are both int-aligned,
> this happens to work on little endian platforms. On big endian
> platforms however writing a value in the range 0-65535 to 
> /proc/sys/kernel/real-root-dev will place 0 in real_root_dev,
> and the actual value in the two padding bytes...
> 
> Unfortunately proc_dointvec() doesn't support shorts, so what is
> the correct fix? Changing:
> kdev_t real_root_dev;
> into
> int real_root-dev;
> is a perfectly working solution, but is it acceptable?

If you compile the kernel and use an integral type for kdev_t, perhaps.
On the other hand, I usually use a pointer type for kdev_t, and then
this entire sysctl construction is broken.

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

  reply	other threads:[~2000-11-28  1:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-27  5:56 [PATCH] removal of "static foo = 0" Adam J. Richter
2000-11-27  8:41 ` Werner Almesberger
2000-11-27  8:39   ` David S. Miller
2000-11-27  9:08     ` Werner Almesberger
2000-11-27 17:21     ` Andrea Arcangeli
2000-11-27 17:36       ` Michael Meissner
2000-11-27 19:06         ` Andrea Arcangeli
2000-11-27 19:34           ` Richard B. Johnson
2000-11-28  0:28             ` Andrea Arcangeli
2000-11-28 11:25               ` Horst von Brand
2000-11-28  3:10           ` kumon
2000-11-28  3:28             ` Andrea Arcangeli
2000-11-28  3:35               ` Alexander Viro
2000-11-28  4:15                 ` Michael Meissner
2000-11-28  9:55                 ` Andreas Schwab
2000-11-28 15:16                   ` Andrea Arcangeli
2000-11-28 16:09                     ` Andreas Schwab
2000-11-28 19:29                       ` Andrea Arcangeli
2000-11-28 16:44                     ` Michael Meissner
2000-11-27 21:27         ` Marcus Sundberg
2000-11-28  0:49           ` Andries Brouwer [this message]
2000-11-27 18:11       ` Richard B. Johnson
2000-11-27 18:01   ` Michael Meissner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001128014905.B9220@veritas.com \
    --to=aeb@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcus@cendio.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox