Ubuntu

change in readlink() errno in 2.6.39 and later kernels causes FTBFS for packages with older gnulib

Reported by Jamie Strandboge on 2011-07-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Undecided
Unassigned
Hardy
High
Unassigned
Lucid
High
Unassigned
Maverick
High
Unassigned
Natty
High
Unassigned
Oneiric
Undecided
Unassigned
linux (Ubuntu)
Undecided
Andy Whitcroft
Hardy
Undecided
Unassigned
Lucid
Undecided
Unassigned
Maverick
Undecided
Unassigned
Natty
Undecided
Unassigned
Oneiric
Undecided
Andy Whitcroft
m4 (Debian)
Fix Released
Unknown

Bug Description

When building packages in a chroot with gnulib testcases for readlink() on a 2.6.39 (Oneiric or newer) kernel, these packages may FTBFS. This is due to the following:
http://lists.gnu.org/archive/html/bug-gnulib/2011-03/msg00308.html

"coreutils' "make check" failed on rawhide due to a kernel change
in how readlink and readlinkat treat the empty file name.
Before, they'd fail with ENOENT. Now, it's EINVAL."

This was discovered when preparing security updates for libvirt, but will affect more than libvirt, (see Debian http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630902). For libvirt, the patch in the above bug can be applied to gnulib/tests/test-areadlink.h to get these building again on newer releases. This is SRU-worthy, as libvirt will not build once the buildds are running newer kernels. If it is not SRUd before the next security update, the security team will do it as part of their update process.

Upstream kernel commit that introduced the change: 65cfc6722361570bfe255698d9cd4dccaf47570d

Jamie Strandboge (jdstrand) wrote :

libvirt in Oneiric builds fine.

Changed in libvirt (Ubuntu Oneiric):
status: New → Invalid
Changed in libvirt (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → High
Changed in libvirt (Ubuntu Maverick):
status: New → Triaged
importance: Undecided → High
Changed in libvirt (Ubuntu Natty):
status: New → Triaged
importance: Undecided → High
Changed in libvirt (Ubuntu Hardy):
status: New → Triaged
importance: Undecided → High
Changed in linux (Ubuntu Hardy):
status: New → Invalid
Changed in linux (Ubuntu Lucid):
status: New → Invalid
Changed in linux (Ubuntu Maverick):
status: New → Invalid
Changed in linux (Ubuntu Natty):
status: New → Invalid
Changed in libvirt (Ubuntu Hardy):
milestone: none → hardy-updates
Changed in libvirt (Ubuntu Lucid):
milestone: none → lucid-updates
Changed in libvirt (Ubuntu Maverick):
milestone: none → maverick-updates

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 817187

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete

This doesn't need log files. Attached is a simple reproducer.

Changed in libvirt (Ubuntu Natty):
milestone: none → natty-updates
Changed in linux (Ubuntu Oneiric):
status: Incomplete → Confirmed
Jamie Strandboge (jdstrand) wrote :
summary: - libvirt FTBFS on 2.6.39 and later kernels
+ change in readlink() errno in 2.6.39 and later kernels causes FTBFS for
+ packages with older gnulib
description: updated
Andy Whitcroft (apw) wrote :

This is a notty one. The behavour has indeed changed, ENOENT was the previous return and now we return EINVAL. I do not have a POSIX manual to hand, but the gist of the restriction is as below:

   Empty pathname
       In the original Unix, the empty pathname referred to the current
       directory. Nowadays POSIX decrees that an empty pathname must not be
       resolved successfully. Linux returns ENOENT in this case.

It could be argued that the new behaviour is just as valid. A change is however unhelpful. Especially as kernel behaviour is exposed in chroots.

description: updated
description: updated
description: updated
Andy Whitcroft (apw) wrote :

A quick review of other syscalls reacting to "" as a pathname tend to now place readlink as an inconsistant outsider:

  open("", O_RDONLY) = -1 ENOENT (No such file or directory)
  chmod("", 0777) = -1 ENOENT (No such file or directory)
  readlink("", 0x7fff794533c0, 2048) = -1 EINVAL (Invalid argument)
  stat("", 0x7fff79453330) = -1 ENOENT (No such file or directory)
  rename("", "") = -1 ENOENT (No such file or directory)
  unlink("") = -1 ENOENT (No such file or directory)

Andy Whitcroft (apw) on 2011-07-27
Changed in linux (Ubuntu Oneiric):
assignee: nobody → Andy Whitcroft (apw)
status: Confirmed → In Progress
Kees Cook (kees) wrote :

Packages with gnulib in their source:

main:

augeas
binfmt-support
eglibc
findutils
gdb
glib2.0
groff
grub2
hello
hello-debhelper
liblouis
libpipeline
libtasn1-3
libvirt
man-db
mlocate
texinfo

universe/multiverse:

amanda
eiskaltdcpp
freedink
genparse
hivex
instantbird
libdc0
libdrizzle
liblouisxml
mpop
msmtp
z80asm

Andy Whitcroft (apw) wrote :

Have started a thread upstream to discuss this change.

Changed in m4 (Debian):
status: Unknown → Fix Released
JC Hulce (soaringsky) wrote :

This bug affects Ubuntu 10.10, Maverick Meerkat. Maverick has reached end-of-life and is no longer supported, so I am closing the bugtask for Maverick. Please upgrade to a newer version of Ubuntu.
More information here: https://lists.ubuntu.com/archives/ubuntu-announce/2012-April/000158.html

Changed in libvirt (Ubuntu Maverick):
status: Triaged → Invalid
dino99 (9d9) wrote :
Changed in libvirt (Ubuntu Hardy):
status: Triaged → Invalid
Changed in libvirt (Ubuntu Natty):
status: Triaged → Invalid
Changed in linux (Ubuntu Oneiric):
status: In Progress → Invalid
Changed in linux (Ubuntu):
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.