From: "Thomas Bächler" <thomas@archlinux.org>
To: Dave Reisner <dreisner@archlinux.org>,
util-linux@vger.kernel.org, thomas@archlinux.org
Subject: Re: [PATCH] switch_root: verify initramfs by f_type, not devno
Date: Thu, 03 Apr 2014 10:09:09 +0200 [thread overview]
Message-ID: <533D1725.2060204@archlinux.org> (raw)
In-Reply-To: <20140403013808.GD585@rampage>
[-- Attachment #1: Type: text/plain, Size: 1463 bytes --]
Am 03.04.2014 03:38, schrieb Dave Reisner:
> On Wed, Apr 02, 2014 at 10:41:30AM -0400, Dave Reisner wrote:
>> As of linux 3.14, the initramfs device will have both major and
>> minor 0, causing our paranoia check to fail. Make this version agnostic
>> by checking the filesystem type, rather than a device number.
>>
>> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
>> ---
>> This is essentially what busybox's switch_root does. I don't think there's much
>> value in checking the devno at all, as it seems to be a needless restriction.
>> Let's just allow deleting anything that looks like non-persistent storage.
>
> A bisect of the kernel reveals that 9e30cc9595303 is the responsible
> change. It seems the kernel maintains its own mounts which are never
> exposed to userspace (which also would explain the FSID gaps in
> /proc/self/mountinfo). An instance of sysfs used to be one of these
> kernel only mounts but, for some time now, has not needed to be. The
> mentioned commit removes this kern_mount() call for sysfs, making the
> initramfs the first entry in the mount table -- FSID 0 instead of 1.
>
> I guess FSIDs are about as reliable as the numbering on block devices,
> and this comparison in switch_root was never really the right
> approach...
Thanks for getting to the bottom of this Dave. I guess going the way of
busybox (checking for RAMFS or TMPFS) is the right thing to do, as your
patch suggests.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2014-04-03 8:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 14:41 [PATCH] switch_root: verify initramfs by f_type, not devno Dave Reisner
2014-04-03 1:38 ` Dave Reisner
2014-04-03 8:09 ` Thomas Bächler [this message]
2014-04-04 12:55 ` Karel Zak
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=533D1725.2060204@archlinux.org \
--to=thomas@archlinux.org \
--cc=dreisner@archlinux.org \
--cc=util-linux@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.