Your message dated Wed, 20 May 2026 22:04:59 +0000
with message-id <[email protected]>
and subject line Bug#1137058: fixed in fakeroot 1.38.1-1
has caused the Debian Bug report #1137058,
regarding cp segfaults when handling extended file attributes
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.)


-- 
1137058: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1137058
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: fakeroot
Version: 1.38-1

I ran into a segfault from cp -pR, under fakeroot, with files that
have extended attributes. The sequence of events is as follows:

* cp (either directly or via a lib) attempts a fchownat, which fails
with errno set to EPERM (1)
* the fakeroot wrapper hides the return value but keeps errno (This is legal)
* cp calls down into attr_copy_fd from libattr
* attr_copy_fd attempts to flistxattr on a NULL buffer of size 0, this
returns 33 (size of buffer) and leaves errno unchanged (still EPERM)
* the fakeroot wrapper catches the stale EPERM, clears errno, and
returns 0 to indicate an empty xattr (which is incorrect)
* attr_copy_fd does not have any special handling for returned size of
0, so it continues and allocates a 1 byte buffer (size+1)
* attr_copy_fd then attempts to flistxattr on the 1 byte buffer with
size 0. This successfully returns 33 again, as is correct when size is
0.
* fakeroot correctly forwards the successful call now that errno is 0
* attr_copy_fd overwrites it's size variable with the new result (33),
and reads well past the allocated buffer into a segfault. (It also
skips over it's end pointer and reads much more than 33 bytes, but
that's another issue)

This appears to have been inadvertently introduced by changes in
#1136815. Some of the introduced !r checks probably need to be changed
to r > 0 to allow positive return values to be returned unmodified.
I'd also like to note that it's *not* legal for syscalls to clear
errno, which may now happen if you have a pre-set errno coming into a
modified syscall, but I've not run into any issues tied to it.

I am using Arch Linux which is downstream from this package, but not
currently running any patches

--- End Message ---
--- Begin Message ---
Source: fakeroot
Source-Version: 1.38.1-1
Done: Clint Adams <[email protected]>

We believe that the bug you reported is fixed in the latest version of
fakeroot, 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.
Clint Adams <[email protected]> (supplier of updated fakeroot 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: Wed, 20 May 2026 17:37:08 -0400
Source: fakeroot
Binary: fakeroot fakeroot-dbgsym libfakeroot libfakeroot-dbgsym
Architecture: source
Version: 1.38.1-1
Distribution: unstable
Urgency: medium
Maintainer: Clint Adams <[email protected]>
Changed-By: Clint Adams <[email protected]>
Description:
 fakeroot   - tool for simulating superuser privileges
 libfakeroot - tool for simulating superuser privileges - shared libraries
Closes: 1031355 1137058
Changes:
 fakeroot (1.38.1-1) unstable; urgency=medium
 .
   [ Janneke Nieuwenhuizen ]
   * Respect r > 0 success values for get/list xattrs,
     closes: #1137058.
   * test: Add t.xattr2: Does fakeroot setfattr user.* change the
     file-system?
 .
   [ Clint Adams ]
   * Patch from Sebastian van Ohr to fix unknown file handling
     in process_setxattr.  closes: #1031355.
Checksums-Sha1:
 068fafd5fdb846dc2bb1b3500a40af897c49fa8d 1958 fakeroot_1.38.1-1.dsc
 8cb51d4e3fab1c967ebc2785aec7b108d06de335 596141 fakeroot_1.38.1.orig.tar.gz
 c6a22fc3811c24953a55b1fc4b0865f1a5f88242 27088 fakeroot_1.38.1-1.debian.tar.xz
Checksums-Sha256:
 77742f4875506075c00a1c689047ea7b22f49b093801ed82db5d97f1b85ff9f5 1958 
fakeroot_1.38.1-1.dsc
 37c5063942efe2e2aeefd6e71ae2690bcb9b7d512c53bc6409b54d0730cbdac1 596141 
fakeroot_1.38.1.orig.tar.gz
 1a4d283c5a757ae4fa2eae5533aec7d859dd3dd4e557da1afdd5a7b033ac3743 27088 
fakeroot_1.38.1-1.debian.tar.xz
Files:
 cb6bbc9cbf732e2f3290b0506c9b2fd3 1958 utils optional fakeroot_1.38.1-1.dsc
 3ddaf823f62e1b665895fb5db24afd74 596141 utils optional 
fakeroot_1.38.1.orig.tar.gz
 7be5c2469fc9599eabd538403f8b1c79 27088 utils optional 
fakeroot_1.38.1-1.debian.tar.xz

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

iQIzBAEBCgAdFiEEdYHsh0BT5sgHeRubVZIzHhmdOKgFAmoOKu4ACgkQVZIzHhmd
OKgXzBAAppXiMxGHX3NLK1ywonP8wpTCG2AsUKI5+g6KcxP5aG9iIzikGljZ60Cs
Seqpxb2aPPmNFmDkI3vAl+5Ak26LYgK2EUJg37HSdRW0/G7/GHpl5Y2j1EoiP06B
SkRx7s2uMirb5GxTweeSJ3YO0Dbg4nt5jMNhfxNBSeykCQvy9lZ7bKUVodg1WFBt
ttACqO4ST27gZk8LAQeUgHRX/t1jC6iEci/HqjDHQuEYi6xsiP3ut+jIMvnPdvQv
4ZjNsxhofAOxezZTa8O6yc+gE39t72rda34oPDzc/LjAg696iOMvTS1oDmCNQoWE
1I0eTe59q9mASVHKl0nKLwRLkzw9zWPcv2g6abY2kqaVMeCfN3+MThTn3j/F1mXf
mNn4jl+sAKKQM7bD3l/EuRG9jlz+9fAv/qhOnQC6Zvq59a91Fb+1isf9aGnFkFWs
9yIhW/SH03yKAyqB+B+9dKnt9LZlJCQr+5qwZe2wWrIHOcp2tpQZTcI+4/oCPi+o
4Gd4mJh6aYvHtp9MsWyLbEsEC5POUUt9GDPLrDW/QvakJBcXLnQfaCeVCUu8dE+S
rtMAeFLpuY0vltqQF0qdbu4uSA1P2guAvuFA9VgrM6w2/Fs8KHWuNSg9O8hUHjGp
KVoBXLvtQB5m7o0X8m4Nzb+tHx0PBV6vq4SiZ/grXTiyaOe+o40=
=YeTV
-----END PGP SIGNATURE-----

Attachment: pgpjkneTm1rw2.pgp
Description: PGP signature


--- End Message ---

Reply via email to