Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp706842ybs; Sun, 24 May 2020 19:04:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGshl/aQGxN7Ku23KVKXhbkf89U9vrCFwoAA3lKkC7p22IazkTbpLAIY97NEpExpL/o82k X-Received: by 2002:aa7:ce17:: with SMTP id d23mr13333124edv.387.1590372254486; Sun, 24 May 2020 19:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590372254; cv=none; d=google.com; s=arc-20160816; b=U4BXW6qy+VhUXaFr4OuOTKWd1c7AlyBm0A7z/TLXhSG9LtQ3hW2BbuuJy5GnsGGh7X FbFgQZ4+kgZJQI2iszCQg8JphOCgkJQt4tDp91s42i28gMZ2/zRXF85D500MeKpp2Xzv oSnsQz+wu93wPYBvRbXEZg6YhQkBiPkDIulbsrV2LACriTqNMVqv7sHmpULxRqpytif7 v5T5QZnGPDpmikjTgUfpv34Q/v6nUbmX0SM8NW5h8QwjFOnjF8yUxiVLDQ69/tWgR5VR SlVuGtnvAKQ+dP2/ZhLMWPAX45ICLN4kT+Qru/CJkI6r1r6g73GxyVpGcsO7oVgRp4bP BhsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=tYESN0eqAx8PHt4e/6wtNye6dToYMIDWe9kIG2IyPIw=; b=MzXha22BMEuqYc38iwde2ERXCl+DK5JXTt628/XTUK4NqWPuaGUoOkO8OdNbraHMST 18QuGxgFodjr6XQcWdRj1Sz2qq00sJnAEPkW637GUdPFMsWw/OSRxteprdf9zZgwI+od +1BgPzwP65IEczl715cUyKnTxdQv53ktDn1zjbTdyPdpW9oI9HoOqJFNlj+7aS9RA6tT sns4i4sUINRVmP7IK+ZS+Jd1tnxghtlrdEKdBjdOWCFc+oZuffaUDBF/Hl8Lswtg6XCE Nbos4R9W1E/ZHf/6gcyb1M36Zz/iiNJj0vZkA8tM7JStt+qa4MWji3jE3+Qg/TO5lVhD 0qXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=ElwM1OmY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id uz8si8537931ejb.67.2020.05.24.19.03.50; Sun, 24 May 2020 19:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=ElwM1OmY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388691AbgEYCCF (ORCPT + 99 others); Sun, 24 May 2020 22:02:05 -0400 Received: from sonic307-16.consmr.mail.ne1.yahoo.com ([66.163.190.39]:45676 "EHLO sonic307-16.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388090AbgEYCCE (ORCPT ); Sun, 24 May 2020 22:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1590372122; bh=tYESN0eqAx8PHt4e/6wtNye6dToYMIDWe9kIG2IyPIw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=ElwM1OmYfifcqP/OYp8yN9Xv6U3F/0vfWpYH58b7rNEKS2M+FsOCjkLs748pcpLd3cSK+hxoClHvGqCscYcB1t2CXe0g5c/o6sJQIp9NxRzBYC8/qtR2F54bwGBht3A2UimG+7SAsjeCiUPMFO6izHW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oCmLWLekio3LVoBEf sZWQFORCD4.B3bvLVtyVoema6KVKMDzkrlPdUccIah4tqKNS9yYlML3Ngje_x_WgIvW99Vy8Qm.l nx5CGehjo9dnzJ6DdWshgjXpweTrKWCE0E5F5x12lO.dBL4QM0f9naXXQJ8dDO0OPVYiQ9PETIhc 66.rXepOC4fbMHdC8AKAZI02jGgFBG_gFLfaLL5Bbe8tZTKF0QzOzULmiWnOWIJsRegj7dR.mz6d XA2EwGP2daHt9mIadv_aoB560y3bj.BgtAFa1JDTBQJInbbgFjIlFfVK0RA45fX9D4RKoAaF0IMH s4D1oYStcoo4ED8WK46lsw0a0jsKBwKs27g5FxVzA1125Sf6lsBnYGie8mTed6rxMPHVZ1_Ym6qq xkXqsqkzjS0OcXbp8xgUaqnqzEn8vVtTqPSVpYwCu5IXJliu8H7lyISEvAYaSl9oKXE7GM.MnSxz j4un3AU4zXvKkypUEjzawziUZ2SZFxiJZZ3Cu7XSBt4W1tpHRNJihxG5TpGNaUVLFVNaXHWrZvU_ kWB3wrc91GjP_jZHpdSMdsmc- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Mon, 25 May 2020 02:02:02 +0000 Received: by smtp408.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID eb555deb44d72beca2d23355708db932; Mon, 25 May 2020 02:01:57 +0000 (UTC) Subject: Re: [PATCH] capabilities: Introduce CAP_RESTORE To: Andrei Vagin Cc: Adrian Reber , Christian Brauner , Eric Biederman , Pavel Emelyanov , Oleg Nesterov , Dmitry Safonov <0x7f454c46@gmail.com>, Nicolas Viennot , =?UTF-8?B?TWljaGHFgiBDxYJhcGnFhHNraQ==?= , Kamil Yurtsever , Dirk Petersen , Christine Flood , Mike Rapoport , Radostin Stoyanov , Cyrill Gorcunov , Serge Hallyn , Stephen Smalley , Sargun Dhillon , Arnd Bergmann , Aaron Goidel , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, selinux@vger.kernel.org, Eric Paris , Jann Horn , Casey Schaufler References: <20200522055350.806609-1-areber@redhat.com> <20200523042749.GA19115@gmail.com> From: Casey Schaufler Autocrypt: addr=casey@schaufler-ca.com; keydata= mQINBFzV9HABEAC/mmv3jeJyF7lR7QhILYg1+PeBLIMZv7KCzBSc/4ZZipoWdmr77Lel/RxQ 1PrNx0UaM5r6Hj9lJmJ9eg4s/TUBSP67mTx+tsZ1RhG78/WFf9aBe8MSXxY5cu7IUwo0J/CG vdSqACKyYPV5eoTJmnMxalu8/oVUHyPnKF3eMGgE0mKOFBUMsb2pLS/enE4QyxhcZ26jeeS6 3BaqDl1aTXGowM5BHyn7s9LEU38x/y2ffdqBjd3au2YOlvZ+XUkzoclSVfSR29bomZVVyhMB h1jTmX4Ac9QjpwsxihT8KNGvOM5CeCjQyWcW/g8LfWTzOVF9lzbx6IfEZDDoDem4+ZiPsAXC SWKBKil3npdbgb8MARPes2DpuhVm8yfkJEQQmuLYv8GPiJbwHQVLZGQAPBZSAc7IidD2zbf9 XAw1/SJGe1poxOMfuSBsfKxv9ba2i8hUR+PH7gWwkMQaQ97B1yXYxVEkpG8Y4MfE5Vd3bjJU kvQ/tOBUCw5zwyIRC9+7zr1zYi/3hk+OG8OryZ5kpILBNCo+aePeAJ44znrySarUqS69tuXd a3lMPHUJJpUpIwSKQ5UuYYkWlWwENEWSefpakFAIwY4YIBkzoJ/t+XJHE1HTaJnRk6SWpeDf CreF3+LouP4njyeLEjVIMzaEpwROsw++BX5i5vTXJB+4UApTAQARAQABtChDYXNleSBTY2hh dWZsZXIgPGNhc2V5QHNjaGF1Zmxlci1jYS5jb20+iQJUBBMBCAA+FiEEC+9tH1YyUwIQzUIe OKUVfIxDyBEFAlzV9HACGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOKUV fIxDyBG6ag/6AiRl8yof47YOEVHlrmewbpnlBTaYNfJ5cZflNRKRX6t4bp1B2YV1whlDTpiL vNOwFkh+ZE0eI5M4x8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OW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200523042749.GA19115@gmail.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Mailer: WebService/1.1.15960 hermes_yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.6) Content-Length: 1715 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/22/2020 9:27 PM, Andrei Vagin wrote: > On Fri, May 22, 2020 at 09:40:37AM -0700, Casey Schaufler wrote: >> On 5/21/2020 10:53 PM, Adrian Reber wrote: >>> There are probably a few more things guarded by CAP_SYS_ADMIN require= d >>> to run checkpoint/restore as non-root, >> If you need CAP_SYS_ADMIN anyway you're not gaining anything by >> separating out CAP_RESTORE. >> >>> but by applying this patch I can >>> already checkpoint and restore processes as non-root. As there are >>> already multiple workarounds I would prefer to do it correctly in the= >>> kernel to avoid that CRIU users are starting to invent more workaroun= ds. >> You've presented a couple of really inappropriate implementations >> that would qualify as workarounds. But the other two are completely >> appropriate within the system security policy. They don't "get around"= >> the problem, they use existing mechanisms as they are intended. >> > With CAP_CHECKPOINT_RESTORE, we will need to use the same mechanisms. Then why call them out as objectionable "workarounds"? > The problem is that CAP_SYS_ADMIN is too wide. This is well understood, and irrelevant. If we broke out CAP_SYS_ADMIN properly we'd have hundreds of capabilities, and no one would be able to manage the capability sets on anything. Just breaking out of CAP_SYS_ADMIN, especially if the process is going to need other capabilities anyway, gains you nothing. > If a process has > CAP_SYS_ADMIN, it can do a lot of things and the operation of forking = a > process with a specified pid isn't the most dangerous one in this case.= > Offten security policies don't allow to grant CAP_SYS_ADMIN to any > third-party tools even in non-root user namespaces. >