[lxc-users] lxc-usernsexec completely unexpected behaviour, reproducible on trunk?

Fiedler Roman Roman.Fiedler at ait.ac.at
Tue Oct 13 17:52:51 UTC 2015


Hello List,

I've accidentally destroyed some files due to following unexpected
behaviour. Is this also reproducible on trunk?

# echo "content" > file
# cat file 
content
# lxc-usernsexec -m u:0:851968:65536 -m g:0:851968:65536 -- /bin/echo xxx <
file
# cat file 
xxx
ent

It seems, that the bad magic at least on Ubuntu trusty version is from:

readlink("/proc/self/fd/0", "/tmp/file", 256) = 40  # don't know why, but
stdin link is copied
pipe([3, 4])                            = 0
pipe([5, 6])                            = 0
clone(Process 8253 attached

# stdin link is opened RW and duped to stdin/out/err
[pid  8253] open("/tmp/file", O_RDWR|O_NONBLOCK) = 3
[pid  8253] fcntl(3, F_GETFL)           = 0x8802 (flags
O_RDWR|O_NONBLOCK|O_LARGEFILE)
[pid  8253] fcntl(3, F_SETFL, O_RDWR|O_LARGEFILE) = 0
[pid  8253] close(0)                    = 0
[pid  8253] close(1)                    = 0
[pid  8253] close(2)                    = 0
[pid  8253] dup2(3, 0)                  = 0
[pid  8253] dup2(3, 1)                  = 1
[pid  8253] dup2(3, 2)                  = 2




DI Roman Fiedler
Scientist
Digital Safety & Security Department
Assistive Healthcare Information Technology

AIT Austrian Institute of Technology GmbH
Reininghausstraße 13/1 | 8020 Graz | Austria
T +43(0) 50550 2957 | M +43(0) 664 8561599 | F +43(0) 50550 2950
roman.fiedler at ait.ac.at | http://www.ait.ac.at/

FN: 115980 i HG Wien  |  UID: ATU14703506
http://www.ait.ac.at/Email-Disclaimer


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6344 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151013/65ef06ff/attachment.bin>


More information about the lxc-users mailing list