Your message dated Tue, 18 Sep 2018 13:04:44 +0000
with message-id <[email protected]>
and subject line Bug#909011: fixed in libuv1 1.23.0-2
has caused the Debian Bug report #909011,
regarding libuv1 calls readlink() with buffer size zero for /proc/self
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
909011: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909011
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libuv1
Version: 1.20.3
Tags: patch

libuv1 calls readlink() with buffer size zero for /proc/self due to
downstream patch 'path_max'.

This breaks a nodejs test-case on chroot, containers, and s390x (in
Ubuntu at least), on which /dev/stdin is a symlink pointing to
/proc/self/fd/0.

On sid chroot:

    # apt-get update
    # apt-get install nodejs strace
    # apt-get source nodejs
    # cd nodejs-*

The /dev/stdin device is a symlink to /proc/self/...

    # ls -l /dev/stdin
    lrwxrwxrwx 1 root root 15 Sep 14 13:40 /dev/stdin -> /proc/self/fd/0

The lstat() call reports 'st_size' of zero for /proc/self:

    # strace -e lstat \
      stat /proc/self \
      2>&1 | grep -e lstat -e File: -e Size:
    lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
      File: /proc/self -> 15804
      Size: 0               Blocks: 0          IO Block: 1024   symbolic link

This causes libuv1 to call readlink() with a buffer size of zero, and
hit EINVAL:

    # strace -f -e lstat,readlink \
      node test/parallel/test-fs-realpath-pipe.js

    [pid 15906] lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3780, ...}) = 0
    [pid 15907] lstat("/dev/stdin", {st_mode=S_IFLNK|0777, st_size=15, ...}) = 0
    [pid 15909] lstat("/dev/stdin", {st_mode=S_IFLNK|0777, st_size=15, ...}) = 0
    [pid 15909] readlink("/dev/stdin", "/proc/self/fd/0", 15) = 15

    [pid 15906] lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
    [pid 15907] lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
    [pid 15909] lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
    [pid 15909] readlink("/proc/self", 0x7ffa38000b40, 0) = -1 EINVAL
(Invalid argument)

With this patch applied, the call to readlink() has a non-zero buffer
size and returns correctly:

    # dpkg -i libuv1_1.23.0-1+fixpathmax1_amd64.deb

    # strace -f -e lstat,readlink \
      node test/parallel/test-fs-realpath-pipe.js

    [pid 31068] lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3780, ...}) = 0
    [pid 31068] lstat("/dev/stdin", {st_mode=S_IFLNK|0777, st_size=15, ...}) = 0
    [pid 31068] lstat("/dev/stdin", {st_mode=S_IFLNK|0777, st_size=15, ...}) = 0
    [pid 31068] readlink("/dev/stdin", "/proc/self/fd/0", 15) = 15

    [pid 31068] lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
    [pid 31068] lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
    [pid 31068] lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
    [pid 31068] readlink("/proc/self", "31068", 256) = 5

    [pid 31068] lstat("/proc/31068", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
    [pid 31068] lstat("/proc/31068/fd", {st_mode=S_IFDIR|0500,
st_size=0, ...}) = 0
    [pid 31068] lstat("/proc/31068/fd/0", {st_mode=S_IFLNK|0700,
st_size=64, ...}) = 0
    [pid 31068] lstat("/proc/31068/fd/0", {st_mode=S_IFLNK|0700,
st_size=64, ...}) = 0
    [pid 31068] readlink("/proc/31068/fd/0", "socket:[266186]", 64) = 15

Thanks,

-- 
Mauricio Faria de Oliveira

Attachment: sid-libuv1-path_max_zero_st_size.debdiff
Description: Binary data


--- End Message ---
--- Begin Message ---
Source: libuv1
Source-Version: 1.23.0-2

We believe that the bug you reported is fixed in the latest version of
libuv1, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dominique Dumont <[email protected]> (supplier of updated libuv1 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 18 Sep 2018 14:18:27 +0200
Source: libuv1
Binary: libuv1-dev libuv1
Architecture: source
Version: 1.23.0-2
Distribution: unstable
Urgency: medium
Maintainer: Dominique Dumont <[email protected]>
Changed-By: Dominique Dumont <[email protected]>
Description:
 libuv1     - asynchronous event notification library - runtime library
 libuv1-dev - asynchronous event notification library - development files
Closes: 909011
Changes:
 libuv1 (1.23.0-2) unstable; urgency=medium
 .
   * gbp.conf: set update-tag for all tools
   * add patch to fix zero buffer size of readlink()
     Thanks to Mauricio Faria de Oliveira <[email protected]> (LP: 1792647)
     (Closes: 909011)
Checksums-Sha1:
 854e3aa6d1ffddc115f6369dede09dd25f0ef85d 2074 libuv1_1.23.0-2.dsc
 5a9cf85c0cfcb3429cfc73ea93b057809adac1a7 17204 libuv1_1.23.0-2.debian.tar.xz
 8c63b4fb436dafe82d176eb1f93a223a7e7a1652 5574 libuv1_1.23.0-2_source.buildinfo
Checksums-Sha256:
 b42eae32ff60bb5ddfc7ce0da9c9eea20568009205186704d676758364a2a4fd 2074 
libuv1_1.23.0-2.dsc
 04fe2de90dcabf99cd42b55ec0e5c7cfb805c1476bc80ecafcd357adc2306756 17204 
libuv1_1.23.0-2.debian.tar.xz
 8d549a92be27636c01f5a238fdccc2276096ec2cccb1c06cb643c41512e8711e 5574 
libuv1_1.23.0-2_source.buildinfo
Files:
 2842d5516b515d241a421f9e9644857d 2074 libs optional libuv1_1.23.0-2.dsc
 cdc295fe26eba944f54a0d7bd7536706 17204 libs optional 
libuv1_1.23.0-2.debian.tar.xz
 e4e7cf96e5dfb206cd0029eede3cff5b 5574 libs optional 
libuv1_1.23.0-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEn3I5/LZk8Qsz6dwDwx9P2UmrK2wFAlug8xEACgkQwx9P2Umr
K2z3Kg/6AjglwoS4GsBdH8LtpVTIOPP0d0OcZUYcpj86YOGfIjwiErMXdl6bZ3JU
3miI1F63Q+Lz2qiDh4GLvVQyQNdZglhl9DlGGDnoF/z2Xsq4G4b92BZDJIdv/6Cz
uDZE3FYETT5QXLvd5BoUZTqh1gkJbW3xHQa9d/uxVzwfqrlPo0Eq9o4EqvmVTy3Q
dSvTm0LFdNmNN1zUQ4mx25Uunt3kQ5iS7kL8rNKurZcsaKT4QIseryZtvcZkEXhw
icsxfExjQOyD1W7YmInX2hSyJVWjrlaIppTUjn68xfhmbZxgiXb1NHmzdcUqs6Sh
YkTal3afKOXYThOsBMmHWoAPWVwYewanVch/+0BIXRByhvmz3RZg29KZA3H/3BMk
SHoUupmljQG4qWjf4Lq3TO300AKz694EVOLD76aqK1+0PIE5naLKFlZV/CVavYlN
Z62L8yEdhBfo33MwRQsrCGWLLGjo4LB7kX7xKzE9oXqVBJr1uuk0HyOVgA0x9O25
PGgOPu3K5d3kfmwmY+WgT1w6UNiYnG6dw0FK01pDKU7cA6I6UZB4qkw1o5Vp0lXQ
hK8eNUZxPmVg1p1LQx6vZKOWiY3AwF+FTLfsZYV7CGStBTWzHGZ1jTWcB3YzM2oY
t4o4FnUMHR3U02ssc/wTmVNABUUWDruSex+Pe61T3ZJ0Bazzdw4=
=OGN8
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to