Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4116857imm; Tue, 25 Sep 2018 11:36:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV62uP+4G2ATmi0+vRfzmGR/6Xh26G9WO1I461hP5Di4dzo6YKz5X6aH3G2ljbJNvaRNB3Vsg X-Received: by 2002:a62:24c3:: with SMTP id k64-v6mr2365378pfk.195.1537900615371; Tue, 25 Sep 2018 11:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537900615; cv=none; d=google.com; s=arc-20160816; b=lWVBGwjelsm0sVyqKPWiJgOiMAj6fgDvD+W1PIrQl3/BwUnKs1MHh3K2DAIHDThJft Nuk70D9h304o6i0vcG7TOZfzJAmjup2MTONAJriUb6h1W3VvnY8XnSPBXlWDwSaSKyKm yX9L9lByTch74NwuzblKMpCWQEYPszhl6KTdaDp1XxijdxSbCD/5bFxAEI9VFg6zeMeQ lN6VyCARF5Qwo9FeWrogn+QDQLKnCaKc2vg3Wzs2mRdkyk/CaCfUw56A5v0cgK/3nEf4 TvsRdZlEIdqlMK2miSHa+92hMTKiWVGm3HNlA0wudWu2sGZJbxIICs22AdNy0S7SUWlH oSFw== 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:dkim-signature; bh=vtF2WnPfMp0rvBJ/agfJKfz0EM6aVYZy58VMrDEw1mY=; b=ffBH3NbjPgDHyrsa+bo485tbreMBJo0bTAwsWS+nZc3TNJowcyhs/Zpt6ekr1WErBs 0tJMTajCiDXWF97DgwNQXcKCaKieiEOeB2RGSDlebVptkw+Nhq3lPaiqC29+erTT9DRU mcJ2tn8ZnFyrwxKTC7GivjrwI8DLDAI0oWAy452dD3yd+xniJVcNwhplM+gFL8g4W5Aa t0HjXMotLrZYSzGdd6fXzXm8vr7CBCofGSvZZV3bkchQ43SsFwtYfu/AmCHFCXXNz22+ zE+AWyWevp48nInyvBYTPelRtQ73iPbtzyrryNHVZx1AgYUTuORfMB9AWbYwXxP6zrXI CBDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=md71q13N; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63-v6si2658161pfg.67.2018.09.25.11.36.39; Tue, 25 Sep 2018 11:36:55 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=md71q13N; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727516AbeIZAnT (ORCPT + 99 others); Tue, 25 Sep 2018 20:43:19 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45607 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbeIZAnT (ORCPT ); Tue, 25 Sep 2018 20:43:19 -0400 Received: by mail-lf1-f66.google.com with SMTP id m80-v6so10381117lfi.12 for ; Tue, 25 Sep 2018 11:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vtF2WnPfMp0rvBJ/agfJKfz0EM6aVYZy58VMrDEw1mY=; b=md71q13NyKCl5XXzv1XMn/yqhoCc1ZsnGr9vQkAK+k1ahnklJn9CFnpnjL8K/Npblf QKV3t27CrboM95OGmDGFry1igvoDN55Kg3NsYw+lwsndG1C2UKcn4JIsXTONM/r7uBBS hyb5LZnqFKhtPyDCjAYJateSR0LITjW4VczbQ21/F7bpQRwgpS02GPQtBi+SI2IJwOCJ LYI09MdbsmZuKZ+MVV6UlvclnVdhtrGNpgCn8qpqiGQz3knhblI29pPcGVHKjwEYZQGy h50Z2GNma+dFjMSDjV3bJgTdu2iKCeF8QNZxHSoz2EfgxYf99j4L5rtu7KADcjfgCxTb QPWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vtF2WnPfMp0rvBJ/agfJKfz0EM6aVYZy58VMrDEw1mY=; b=lZ/n15iFvFW44z0S9MhQd/QBcWm+ND89hYoon6F+p5We/pdGuBG46K1Bf9mIOeUc6m sSHl3H9qsOF367xBNntEz9pPsxX+xmes//4vyVvW+km3jgUd64tUNfxRp57XP1YN5OGc l/mWZ9AL6lrKP3DDgOa70vlQaOc8euG1NSIZKMeEciozH7zZd2xutxDBx7ojs9UDL2Ke CIuLCo3ZwPlgor8fA5GxT4Egslv0LEk3dcDv5YUFsc/tG3Ecyvr9LyUktMJjU1GwdQ5M aoSbgnNjpC5zTcd6YsweddoFP15NSn69zjIgA7qsRkCybfJxc8Qzcz+5q4az2eH1YyiU hihg== X-Gm-Message-State: ABuFfoi/f7jD4U8I6iHdvhhlZ7bFwcVa0PnHk/T1Id5fh1scTUEMVLyO SNk/BXKP1u7x+WrApFhxSsU= X-Received: by 2002:a19:6544:: with SMTP id c4-v6mr1779140lfj.31.1537900468707; Tue, 25 Sep 2018 11:34:28 -0700 (PDT) Received: from uranus.localdomain ([5.18.102.224]) by smtp.gmail.com with ESMTPSA id c30-v6sm551108lfj.28.2018.09.25.11.34.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Sep 2018 11:34:27 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id 6F48046067E; Tue, 25 Sep 2018 21:34:27 +0300 (MSK) Date: Tue, 25 Sep 2018 21:34:27 +0300 From: Cyrill Gorcunov To: Greg KH 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: <20180925183427.GH15710@uranus> References: <990D0DB4-35C7-4B7B-A938-2B984CD97E78@vt.edu> <20180925173745.GA20508@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180925173745.GA20508@kroah.com> 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 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.