Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4121012imm; Tue, 25 Sep 2018 11:41:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV62/SyEGU6f6IHUXMjyj/PKBbUT5pm51y8/hVqbO7TPfR4J3mlRNIKa2/zwYlJN6b8Uz90o6 X-Received: by 2002:a62:1dc2:: with SMTP id d185-v6mr2354704pfd.219.1537900890593; Tue, 25 Sep 2018 11:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537900890; cv=none; d=google.com; s=arc-20160816; b=ncrxVEN43fkdFU1Uhb/yL6DPqyPVg16FD4i3A3R0IQcH0oLr8Nw9ZJB6FB63wVp8Cv +piSgQIhyFPNapTPGe+o9OAEIvuOr+YIEWdnEeSYNI+NPwyLtElQ6ICEUrDgj6Shdxn4 tZXvgR4pnDmRsZoRlJJc201Csf2unigGqR0hummKz5/LeVkd/zqwJ2BsdbvU5BIhq/EV qqLUuGqhKtS99pIxT+x8TL1Ro0ekXTclg+uKCEghhxAX+41wmIXcHysU1jA/40Wjk3/8 /YN0CLUj6QD9eBJJjglldvBhOm7Hlz1aV5P+swID3UX4LgsJhil9vMiBsIvAYntZflWE GWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Bf/kOSKPzlxMwypWAl8xQxWu6OTVaBwwN2qrsj88BE8=; b=L3xv1m7puo4ppD1XPO/BZyiA7ffnB4uY8vshFfK3Ox41TlnFulOZdncNiscJXt0Aez TrzxHmiKyvdkwHf/tQBkW6ARFd1LEAqLUlUZXBuoYZmAEAqob1ZRf1FDzE7ti7ccvkWM zOBjGIasdHMHIw3vw3c7o8cy2HP2B1lTtbA1at8M1FPqv+izbYDIvX/v5SSWTmRJlm6+ NlzCMRBpX7VUr/2FRObRx/aanbwqX9r1WBS88rBdxB2vRX5G16lF8DzX7PUSF7cH4lPU yh7S4CBjNMiAln54hWNkrAr1Xtxgq0Be747/h/RS4LDidp2GHzXi0kEAoBYsv7WCu4kn gOVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11-v6si2993593pgf.558.2018.09.25.11.41.15; Tue, 25 Sep 2018 11:41:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727359AbeIZAts (ORCPT + 99 others); Tue, 25 Sep 2018 20:49:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55518 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbeIZAts (ORCPT ); Tue, 25 Sep 2018 20:49:48 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8B26B107E; Tue, 25 Sep 2018 18:40:56 +0000 (UTC) Date: Tue, 25 Sep 2018 20:40:54 +0200 From: Greg KH To: Cyrill Gorcunov Cc: Tong Zhang , tglx@linutronix.de, akpm@linux-foundation.org, linux@dominikbrodowski.net, ebiederm@xmission.com, keescook@chromium.org, Dave.Martin@arm.com, wolffhardt.schwabe@fau.de, yang.shi@linux.alibaba.com, linux-kernel@vger.kernel.org, wenbo.s@samsung.com Subject: Re: different capability from different namespace required for prctl_set_mm_exe_file Message-ID: <20180925184054.GA15291@kroah.com> References: <990D0DB4-35C7-4B7B-A938-2B984CD97E78@vt.edu> <20180925173745.GA20508@kroah.com> <20180925183427.GH15710@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180925183427.GH15710@uranus> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 25, 2018 at 09:34:27PM +0300, Cyrill Gorcunov wrote: > On Tue, Sep 25, 2018 at 07:37:45PM +0200, Greg KH wrote: > > On Tue, Sep 25, 2018 at 01:26:55PM -0400, Tong Zhang wrote: > > > Kernel Version: 4.18.5 > > > > > > Problem Description: > > > > > > We discovered inconsistent check when using prctl_set_mm_exe_file(), which is used to setup exe file link. > > > > > > It is required to have capable(CAP_SYS_RESOURCE) in prctl_set_mm(). > > > while ns_capable(CAP_SYS_ADMIN) in prctl_set_mm_map(). > > > > > > There are two differences: > > > 1)requiring capability from: user namespace, init namespace. > > > 2)capability bit required is different > > > > Can you submit a patch showing what you think is the correct fix here? > > It is done this way on purpose. The prctl_set_mm_map is a complex call > which carries a bunch of parameters and allowed if you're inside user-ns admin, > in turn prctl_set_mm allows to modify settings one by one. So no, it is not > an error but rather call specifics. I was hoping that when the submitter went to create such a patch, they would have realized that. You learn more when trying to fix a problem than when someone has to tell you the answers :) thanks, greg k-h