public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Reisner <d@falconindy.com>
To: Karel Zak <kzak@redhat.com>
Cc: Werner Fink <werner@suse.de>, util-linux@vger.kernel.org
Subject: Re: [PATCH 4/5] sulogin: mount temporary /dev and /proc if not found
Date: Sat, 22 Dec 2012 23:33:42 -0500	[thread overview]
Message-ID: <20121223043342.GA633@rampage> (raw)
In-Reply-To: <20121218152311.GA13554@x2.net.home>

On Tue, Dec 18, 2012 at 04:23:11PM +0100, Karel Zak wrote:
> On Mon, Dec 10, 2012 at 01:27:10PM +0100, Werner Fink wrote:
> >  configure.ac   |   10 +++++++++
> >  lib/consoles.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 76 insertions(+)
> 
>  Note that I have applied this (fixed) version of the patch.
> 
>     Karel
> 

This is pretty broken. Using the constructor and destructor attributes
means that ANY programs linking in the code will invoke these functions.
As it's not a direct inclusion, but part of a libtool convenience lib,
the effect is pretty severe:

$ git grep -F libcommon.la | wc -l
78

This includes things such as libblkid and libmount, among others.

It wouldn't generally matter (though I'm still in favor of finding
another solution for this), but this breaks early userspace pretty hard.
Invoking mount (or even findmnt) will preemptively run this code. I'm
not clear on why, but the filesystems were NOT umounted by the
destructor, and my busybox umount as well as util-linux's switch_root
simply failed with EINVAL.

I suggest that this code be relegated to sulogin.

d

  reply	other threads:[~2012-12-23  4:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  8:00 [PATCH 1/5] sulogin: use the linked lists from list.h for consoles list Werner Fink
2012-12-07  8:00 ` [PATCH 2/5] sulogin: make usleep() workaround work Werner Fink
2012-12-18 15:07   ` Karel Zak
2012-12-07  8:00 ` [PATCH 3/5] sulogin: use alarm function to indicate if a timeout occurs Werner Fink
2012-12-18 15:15   ` Karel Zak
2012-12-07  8:00 ` [PATCH 4/5] sulogin: mount temporary /dev and /proc if not found Werner Fink
2012-12-07 14:17   ` Dave Reisner
2012-12-07 15:49     ` [util-linux] " Dr. Werner Fink
2012-12-07 17:01       ` Dave Reisner
2012-12-07 17:25         ` Dr. Werner Fink
2012-12-10 12:27         ` Werner Fink
2012-12-18 15:23           ` Karel Zak
2012-12-23  4:33             ` Dave Reisner [this message]
2012-12-23 21:53               ` Karel Zak
2012-12-10 12:27         ` [PATCH 5/5] sulogin: add multi console feature from SysVinit sulogin Werner Fink
2012-12-18 15:18           ` Karel Zak
2012-12-18 15:17   ` [PATCH 4/5] sulogin: mount temporary /dev and /proc if not found Karel Zak
2012-12-07  8:00 ` [PATCH 5/5] sulogin: add multi console feature from SysVinit sulogin Werner Fink
2012-12-07 10:27   ` Dr. Werner Fink
2012-12-18 15:05 ` [PATCH 1/5] sulogin: use the linked lists from list.h for consoles list 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=20121223043342.GA633@rampage \
    --to=d@falconindy.com \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    --cc=werner@suse.de \
    /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