Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1525910
| From | Willy Tarreau <w@1wt.eu> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions |
| Date | 2016-11-19 10:30 +0100 |
| Message-ID | <sFa8b-33e-67@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <su3Wq-53C-39@gated-at.bofh.it> <su6AW-6Om-1@gated-at.bofh.it> <su8jn-7Y3-9@gated-at.bofh.it> <sEyme-3v8-89@gated-at.bofh.it> <sF86o-1NG-81@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sat, Nov 19, 2016 at 08:17:00AM +0100, Willy Tarreau wrote:
> Hi Eric,
>
> On Thu, Nov 17, 2016 at 11:02:47AM -0600, Eric W. Biederman wrote:
> >
> > With everyone heading to Kernel Summit and Plumbers I put this set of
> > patches down temporarily. Now is the time to take it back up and to
> > make certain I am not missing something stupid in this set of patches.
>
> I couldn't get your patch set to apply to any of the kernels I tried,
> I manually adjusted some parts but the second one has too many rejects.
> What kernel should I apply this to ? Or maybe some preliminary patches
> are needed ?
OK I finally managed to get it to work on top of 4.8.9 (required less changes
than master). I also had to drop the user_ns changes since there's no such
user_ns in mm_struct there.
I could run a test on it, that looks reasonable :
FS:
admin@vm:~$ strace -e trace=fstat,uname,ioctl,open uname
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7f3f9a1663e3, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(0x7ffd01bbeeb0, O_RDONLY|O_CLOEXEC) = 3
fstat(3, {...}) = 0
open(0x7ffd01bbee80, O_RDONLY|O_CLOEXEC) = 3
fstat(3, {...}) = 0
uname({...}) = 0
fstat(1, {...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7ffd01bbf400) = 0
admin@vm:~$ sudo strace -e trace=fstat,uname,ioctl,open uname
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib64/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib64/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib64/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0555, st_size=101312, ...}) = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0555, st_size=1479016, ...}) = 0
uname({sys="Linux", node="vm", ...}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(4, 64), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo ...}) = 0
Network:
admin@vm:~$ strace -e trace=socket,setsockopt,connect /tmp/nc 198.18.3 22
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {...}, 110) = -1 ENOENT (No such file or directory)
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {...}, 110) = -1 ENOENT (No such file or directory)
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, 0x7ffd2c26bdbc, 4) = 0
connect(3, {...}, 16) = 0
admin@vm:~$ sudo strace -e trace=socket,setsockopt,connect /tmp/nc 198.18.3 22
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(22), sin_addr=inet_addr("198.18.0.3")}, 16) = 0
So in short now we can at least see what syscall fails eventhough we can't
know why. I think it can be an acceptable trade-off.
Thanks,
Willy
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:10 +0100
[REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:20 +0100
Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP Kees Cook <keescook@chromium.org> - 2016-11-18 00:20 +0100
Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 20:00 +0100
Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP Andy Lutomirski <luto@amacapital.net> - 2016-11-18 00:30 +0100
Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 00:50 +0100
[REVIEW][PATCH 3/3] exec: Ensure mm->user_ns contains the execed files ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:20 +0100
[REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:20 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file Willy Tarreau <w@1wt.eu> - 2016-11-17 21:50 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file Kees Cook <keescook@chromium.org> - 2016-11-17 22:10 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file Willy Tarreau <w@1wt.eu> - 2016-11-17 22:40 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 23:00 +0100
[REVIEW][PATCH 2/3] ptrace: Don't allow accessing an undumpable mm ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 00:00 +0100
Re: [REVIEW][PATCH 2/3] ptrace: Don't allow accessing an undumpable mm Kees Cook <keescook@chromium.org> - 2016-11-18 00:20 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file Andy Lutomirski <luto@amacapital.net> - 2016-11-18 00:30 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file Andy Lutomirski <luto@amacapital.net> - 2016-11-18 00:40 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 01:00 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file Andy Lutomirski <luto@amacapital.net> - 2016-11-18 01:20 +0100
Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 01:40 +0100
Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions Willy Tarreau <w@1wt.eu> - 2016-11-19 08:20 +0100
Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions Willy Tarreau <w@1wt.eu> - 2016-11-19 10:30 +0100
Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions Willy Tarreau <w@1wt.eu> - 2016-11-19 10:40 +0100
Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-19 19:50 +0100
Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-19 19:40 +0100
Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-19 19:50 +0100
csiph-web