Bug 688948 - glibc_post_upgrade test is not correct for modern kernels
Summary: glibc_post_upgrade test is not correct for modern kernels
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-18 15:46 UTC by Bill Nottingham
Modified: 2016-11-24 12:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-06 19:20:37 UTC
Type: ---


Attachments (Terms of Use)

Description Bill Nottingham 2011-03-18 15:46:15 UTC
Description of problem:

...
  /* Check if we are not inside of some chroot, because we'd just
     timeout and leave /etc/initrunlvl.  */
  if (readlink ("/proc/1/exe", initpath, 256) <= 0 ||
      readlink ("/proc/1/root", initpath, 256) <= 0)
    _exit (0);

  if (check_elf ("/proc/1/exe"))
    verbose_exec (116, "/sbin/telinit", "/sbin/telinit", "u");
...

These tests all succeed on a modern kernel in brief testing; /proc/1/{exe,root} are readable, and reading /proc/1/exe gives you the init binary, even if it's not in the chroot.

Version-Release number of selected component (if applicable):

glibc-2.13.90-6.x86_64

How reproducible:

Looked at the code when debugging something else

Comment 1 Andreas Schwab 2011-03-18 16:20:06 UTC
How is that a bug?

Comment 2 Bill Nottingham 2011-03-18 17:04:48 UTC
It was obviously written as a check to see if it's in a chroot, as it doesn't want to perform some of the actions if it is in a chroot. (See the comment, for example).

As a test for a chroot, it doesn't work.

Comment 3 Andreas Schwab 2011-03-21 10:25:54 UTC
Does it create any problems?

Comment 4 Bill Nottingham 2011-03-21 15:54:40 UTC
It causes it to run telinit & sshd restart in situations where it shouldn't, relying on telinit and sshd's own mechanisms to error out, not stall the transaction, not do other weird things, etc.

Comment 5 Andreas Schwab 2011-03-21 16:02:49 UTC
Please provide a test case.

Comment 6 Fedora Admin XMLRPC Client 2011-11-14 19:45:02 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Jeff Law 2012-02-06 19:20:37 UTC
I've improved the code to detect when we're in a chroot by checking inode numbers for the root directory.  It's not 100% foolproof, but it will catch the common cases.


Note You need to log in before you can comment on or make changes to this bug.