From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbdAYCcv (ORCPT ); Tue, 24 Jan 2017 21:32:51 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:55779 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750984AbdAYCcs (ORCPT ); Tue, 24 Jan 2017 21:32:48 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: "Michael Kerrisk \(man-pages\)" Cc: "Serge E. Hallyn" , Linux API , lkml , "linux-fsdevel\@vger.kernel.org" , Andrey Vagin , James Bottomley , "W. Trevor King" , Alexander Viro References: <93e5c7f9-9dc1-6c93-ad20-0ba053d8bfef@gmail.com> <963f76f9-3ae5-b316-e688-00d3e59cad30@gmail.com> <87d1fblx2s.fsf@xmission.com> <877f5jlvs1.fsf@xmission.com> Date: Wed, 25 Jan 2017 15:28:27 +1300 In-Reply-To: <877f5jlvs1.fsf@xmission.com> (Eric W. Biederman's message of "Wed, 25 Jan 2017 15:26:38 +1300") Message-ID: <87tw8nkh4k.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1cWDO4-00031S-Lk;;;mid=<87tw8nkh4k.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=101.100.131.98;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+pY4RVUkfdzJqCWUVf2nOkTJEyuAZavb0= X-SA-Exim-Connect-IP: 101.100.131.98 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.0 XM_Body_Obfu01 BODY: Obfuscations * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4587] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;"Michael Kerrisk \(man-pages\)" X-Spam-Relay-Country: X-Spam-Timing: total 5544 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 3.6 (0.1%), b_tie_ro: 2.5 (0.0%), parse: 1.10 (0.0%), extract_message_metadata: 14 (0.3%), get_uri_detail_list: 2.0 (0.0%), tests_pri_-1000: 6 (0.1%), tests_pri_-950: 1.18 (0.0%), tests_pri_-900: 1.00 (0.0%), tests_pri_-400: 20 (0.4%), check_bayes: 19 (0.3%), b_tokenize: 6 (0.1%), b_tok_get_all: 6 (0.1%), b_comp_prob: 2.0 (0.0%), b_tok_touch_all: 2.2 (0.0%), b_finish: 0.68 (0.0%), tests_pri_0: 1160 (20.9%), check_dkim_signature: 0.54 (0.0%), check_dkim_adsp: 3.0 (0.1%), tests_pri_500: 4334 (78.2%), poll_dns_idle: 4328 (78.1%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v4 0/2] Add further ioctl() operations for namespace discovery X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ebiederm@xmission.com (Eric W. Biederman) writes: > "Michael Kerrisk (man-pages)" writes: > >> Hi Eric, >> >> On 25 January 2017 at 14:58, Eric W. Biederman wrote: >>> "Michael Kerrisk (man-pages)" writes: >>> >>>> I would like to write code that discovers the namespace setup on a live >>>> system. The NS_GET_PARENT and NS_GET_USERNS ioctl() operations added in >>>> Linux 4.9 provide much of what I want, but there are still a couple of >>>> small pieces missing. Those pieces are added with this patch series. >>> >>> So it looks like the -EOVERFLOW change broke your example program. >>> Causing it to abort if -EOVERFLOW is hit. Do we really want to return >>> -EOVERFLOW? Or do you want to fix your program? >> >> Bother! Yes, I should have kept the example program in sync. (I >> overlooked that it was not any more in sync.) >> >> So, I want to make sure I understand correctly, before I aswer your >> question. Suppose we have >> >> 1. Outer namespace owned by UID 0 >> 2. Inner namespace owned by UID 1000 >> 3. A UID mapping in the inner namespace that maps '0 1000 1' >> 4. A processs, X, in the outer namespace with UID 0 (and all caps). >> >> That's the case you're meaning, right? > > I think so I just noticed you did not handle -EOVERFLOW in > the one NS_GET_OWNER_UID call. > >> So, UID 0 doesn't have a >> mapping into the inner namespace, but does have all capabilities in >> that inner namespace, right? > > That is correct. My concern is that the difference between returning -EOVERFLOW and overflow_uid is primarily about usability. If you haven't played with the usability I don't trust that we have made the proper trade off. Eric