Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756716AbcJNUCG (ORCPT ); Fri, 14 Oct 2016 16:02:06 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:36971 "EHLO mail-it0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbcJNUCE (ORCPT ); Fri, 14 Oct 2016 16:02:04 -0400 Date: Fri, 14 Oct 2016 14:01:47 -0600 From: Tycho Andersen To: Andy Lutomirski Cc: Jann Horn , Peter Zijlstra , Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Borislav Petkov , Linux API , Linus Torvalds , Kees Cook , Tetsuo Handa Subject: Re: [PATCH 1/3] proc: Stop reporting eip and esp in /proc/PID/stat Message-ID: <20161014200147.GJ9796@smitten> References: <20160930185642.GH14666@pc.thejh.net> <20161001103728.GM14666@pc.thejh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1912 Lines: 43 On Fri, Oct 14, 2016 at 11:25:58AM -0700, Andy Lutomirski wrote: > On Sat, Oct 1, 2016 at 3:37 AM, Jann Horn wrote: > > On Fri, Sep 30, 2016 at 07:01:13PM -0700, Andy Lutomirski wrote: > >> On an unrelated note, can we please lock down all the silly historical > >> *userspace* info leaks in /proc? Nasty ones include: net, cmdline (at > >> the very least, only argv[0] should be visible if the reader lacks > >> ptrace access). > >> > >> Less nasty ones include: limits, sched, autogroup, comm, wchan, > >> schedstat, cpuset, cgroup, oom_*, sessionid, coredump_filter > > > > If that doesn't break stuff, I'm very much in favor of it. > > > > > >> uid_map, gid_map, etc are just screwed up. They should be per > >> *namespace* somewhere, and they should require creds on the namespace. > > > > What do you have in mind? Something like > > /proc/namespaces/user:123456/{uid_map,gid_map,setgroups,parent_ns}, > > with jumped fake symlinks to the directory and its entries in /proc/$pid/? > > > > Something along those lines would be nice. > > There's an unfortunate tension between having names for namespaces > (like 123456 in your example) for ease of use and *not* having names > so CRIU can restore them more easily. As long as the namespaces aren't visible to the container itself, it has been okay. For example, LXC (and IIUC OpenVZ as well) put containers in a /lxc/ cgroup, which with cgroup namespaces isn't visible to the container. CRIU implements support for rewriting this prefix, so we can do renaming on the fly. Since most container engines won't allow two containers with the same name, we avoid clashes at a higher level before we end up with an actual "namespace ID" (cgroup path) clash. We're doing a similar thing for AppArmor namespaces. Of course, if the IDs are visible to the container like they would be in this case, then it is much harder. Cheers, Tycho