From doconnor@gsoft.com.au  Tue Sep 27 07:11:19 2005
Return-Path: <doconnor@gsoft.com.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6FBCE16A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Sep 2005 07:11:19 +0000 (GMT)
	(envelope-from doconnor@gsoft.com.au)
Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DACF343D48
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Sep 2005 07:11:18 +0000 (GMT)
	(envelope-from doconnor@gsoft.com.au)
Received: from inchoate.gsoft.com.au (inchoate.gsoft.com.au [203.31.81.31])
	(authenticated bits=0)
	by cain.gsoft.com.au (8.13.4/8.13.4) with ESMTP id j8R7BAQ0037746
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Sep 2005 16:41:16 +0930 (CST)
	(envelope-from doconnor@gsoft.com.au)
Message-Id: <200509271641.05870.doconnor@gsoft.com.au>
Date: Tue, 27 Sep 2005 16:41:05 +0930
From: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Subject: linux emulator interacts oddly with cp

>Number:         86619
>Category:       kern
>Synopsis:       [linux] linux emulator interacts oddly with cp
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-emulation
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 27 07:20:16 GMT 2005
>Closed-Date:    
>Last-Modified:  Tue Aug 17 19:53:40 UTC 2010
>Originator:     Daniel O'Connor
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD inchoate.localdomain 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Thu 
Sep 15 12:51:11 CST 2005 
darius@inchoate.localdomain:/usr/src/sys/i386/compile/INCHOATE i386


>Description:
The Linux cp command (at least with suse-9.3) interacts oddly with the Linux 
emualtor, ie
[inchoate 12:19] ~ >touch /tmp/abc
[inchoate 12:19] ~ >ls -la /tmp/abc
-rw-r--r--  1 darius  wheel  0 Sep 27 12:19 /tmp/abc
[inchoate 12:19] ~ >/compat/linux/bin/cp.foo -p /tmp/abc /tmp/def
[inchoate 12:19] ~ >ls -la /tmp/def
-----wS---  1 darius  wheel  0 Sep 27 12:19 /tmp/def
[inchoate 12:20] ~ >rm -f /tmp/def
[inchoate 12:20] ~ >/compat/linux/bin/cp.foo -p /tmp/abc /tmp/def
[inchoate 12:20] ~ >ls -la /tmp/def
-rwsrwxrwx  1 darius  wheel  0 Sep 27 12:20 /tmp/def

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:

From: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Andrew Bliznak <andriko.b@gmail.com>
Subject: Re: kern/86619: linux emulator interacts oddly with cp
Date: Thu, 29 Sep 2005 10:53:54 +0930

 --nextPart5477054.gcDxGBhEZW
 Content-Type: text/plain;
   charset="utf-8"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 On Wednesday 28 September 2005 02:29, Andrew Bliznak wrote:
 > Look like behaviour depends on cp binary
 > gentoo:
 > andrew@beef$ ldd /compat/linux/bin/cp
 > /compat/linux/bin/cp:
 > libc.so.6 =3D> /lib/libc.so.6 (0x28075000)
 > /lib/ld-linux.so.2 (0x28057000)
 > debian:
 > andrew@beef$ ldd /compat/linux/bin/cp
 > /compat/linux/bin/cp:
 > libacl.so.1 =3D> /lib/libacl.so.1 (0x28070000)
 > libc.so.6 =3D> /lib/libc.so.6 (0x28077000)
 > libattr.so.1 =3D> /lib/libattr.so.1 (0x281aa000)
 > /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x28055000)
 
 Hmm, so RH & Gentoo are OK, but SUSE is not.
 
 I have seen oddities while trying to build Gentoo stage 1 though - I could =
 not=20
 get the most recent one to build. It would install binaries with whacky=20
 permissions.
 
 linux_ktrace shows both creating the file with the same permissions (100644)
   1925 cp-rh8   CALL  linux_open(0xbfbfeaeb,0x8041,0x81a4)
   1925 cp-rh8   NAMI  "def"
   1925 cp-rh8   RET   linux_open 4
 
   1923 cp-suse9.3 CALL  linux_open(0xbfbfeaeb,0x8041,0x81a4)
   1923 cp-suse9.3 NAMI  "def"
   1923 cp-suse9.3 RET   linux_open 4
 
 However the SUSE binary chown's the file
   1923 cp-suse9.3 CALL  linux_chmod(0xbfbfeaeb,0xbfbfe430)
   1923 cp-suse9.3 NAMI  "def"
   1923 cp-suse9.3 RET   linux_chmod 0
 
 Obviously the chmod is broken..
 It looks like it's passing a pointer as the mode_t (!)
 
 =2D-=20
 Daniel O'Connor software and network engineer
 for Genesis Software - http://www.gsoft.com.au
 "The nice thing about standards is that there
 are so many of them to choose from."
   -- Andrew Tanenbaum
 GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
 
 --nextPart5477054.gcDxGBhEZW
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (FreeBSD)
 
 iD8DBQBDO0Ix5ZPcIHs/zowRAh5aAJ9RAAdGiPzXR6vv3YO9ceoitVygOACdG24r
 aJ98s7maUs1Fc/cMqegQG7I=
 =JyHM
 -----END PGP SIGNATURE-----
 
 --nextPart5477054.gcDxGBhEZW--

From: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: Andrew Bliznak <andriko.b@gmail.com>, FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/86619: linux emulator interacts oddly with cp
Date: Fri, 30 Sep 2005 11:33:43 +0930

 --nextPart1229977.IN0848lVx8
 Content-Type: text/plain;
   charset="utf-8"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 On Thursday 29 September 2005 18:23, Andrew Bliznak wrote:
 > > I have seen oddities while trying to build Gentoo stage 1 though - I
 > > could not
 > > get the most recent one to build. It would install binaries with whacky
 > > permissions.
 >
 > I think acl is main problem. Try disable acl support in linux distribution
 
 I'm not sure that is true. The RH8.0 binary has ACL support (well it's link=
 ed=20
 to it) yet it does not exhibit this problem.
 
 > > However the SUSE binary chown's the file
 > > 1923 cp-suse9.3 CALL linux_chmod(0xbfbfeaeb,0xbfbfe430)
 > > 1923 cp-suse9.3 NAMI "def"
 > > 1923 cp-suse9.3 RET linux_chmod 0
 > >
 > > Obviously the chmod is broken..
 > > It looks like it's passing a pointer as the mode_t (!)
 
 I don't know where I can get the SUSE9.3 ls source (well I do, but I suspec=
 t I=20
 will have to sift through a lot of stuff to get it in a useful form and/or =
 be=20
 sure it's the source that actually went into building the binary)
 
 PS you keep dropping the CC.
 
 =2D-=20
 Daniel O'Connor software and network engineer
 for Genesis Software - http://www.gsoft.com.au
 "The nice thing about standards is that there
 are so many of them to choose from."
   -- Andrew Tanenbaum
 GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
 
 --nextPart1229977.IN0848lVx8
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (FreeBSD)
 
 iD8DBQBDPJ0F5ZPcIHs/zowRAt9xAJ9aEHwhBgGljlO8tyWpmp/oFwlUagCglimO
 fl+ATtcZ9CypJ6JOzzGk28Q=
 =INMU
 -----END PGP SIGNATURE-----
 
 --nextPart1229977.IN0848lVx8--
Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation 
Responsible-Changed-By: arundel 
Responsible-Changed-When: Tue Aug 17 19:52:10 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86619 
>Unformatted:
