From patchwork Wed Jun 3 16:23:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Reber X-Patchwork-Id: 11585989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C461790 for ; Wed, 3 Jun 2020 16:24:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB1C3207F7 for ; Wed, 3 Jun 2020 16:24:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cn6HxHR/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726090AbgFCQYY (ORCPT ); Wed, 3 Jun 2020 12:24:24 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:49627 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725904AbgFCQYX (ORCPT ); Wed, 3 Jun 2020 12:24:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591201462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=K/e5rx/iSdIPyyr6wHaDjY9+WjqdNoTwnBgR1lFZZNw=; b=cn6HxHR/pDsnhIMBNnmS6ah+9MtFOWWsmypvfrje2CrKTu50/AzFRQMyGwX5ASxNskDmJt aSxop4wmNTDB9V4VDdJWY+u7SJMQBQgmnKpR/BKHxTbBxW+PmbRcbXG4mkKJfzZYGUBCRx dioW0IiTI+HjHaN6FqwL1HnQboVVxC8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-8L99PjuHMAmWPrd2pPycnA-1; Wed, 03 Jun 2020 12:24:20 -0400 X-MC-Unique: 8L99PjuHMAmWPrd2pPycnA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2FE1EC1B1; Wed, 3 Jun 2020 16:24:17 +0000 (UTC) Received: from dcbz.redhat.com (ovpn-113-67.ams2.redhat.com [10.36.113.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CF2B19C71; Wed, 3 Jun 2020 16:24:07 +0000 (UTC) From: Adrian Reber To: Christian Brauner , Eric Biederman , Pavel Emelyanov , Oleg Nesterov , Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Nicolas Viennot , =?utf-8?b?TWljaGHFgiBDxYJh?= =?utf-8?b?cGnFhHNraQ==?= , Kamil Yurtsever , Dirk Petersen , Christine Flood , Casey Schaufler Cc: Mike Rapoport , Radostin Stoyanov , Adrian Reber , Cyrill Gorcunov , Serge Hallyn , Stephen Smalley , Sargun Dhillon , Arnd Bergmann , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, selinux@vger.kernel.org, Eric Paris , Jann Horn , linux-fsdevel@vger.kernel.org Subject: [PATCH v2 0/3] capabilities: Introduce CAP_CHECKPOINT_RESTORE Date: Wed, 3 Jun 2020 18:23:25 +0200 Message-Id: <20200603162328.854164-1-areber@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: This is v2 of the 'Introduce CAP_CHECKPOINT_RESTORE' patchset. The difference from v1 are: * Renamed CAP_RESTORE to CAP_CHECKPOINT_RESTORE * Added a test * Added details about CRIU's use of map_files * Allow changing /proc/self/exe link with CAP_CHECKPOINT_RESTORE The biggest difference is that the patchset now provides all the changes, which are necessary to use CRIU to checkpoint and restore a process as non-root if CAP_CHECKPOINT_RESTORE is set. Adrian Reber (2): capabilities: Introduce CAP_CHECKPOINT_RESTORE selftests: add clone3() CAP_CHECKPOINT_RESTORE test Nicolas Viennot (1): prctl: Allow ptrace capable processes to change exe_fd fs/proc/base.c | 8 +- include/linux/capability.h | 6 + include/uapi/linux/capability.h | 9 +- kernel/pid.c | 2 +- kernel/pid_namespace.c | 2 +- kernel/sys.c | 21 +- security/selinux/include/classmap.h | 5 +- tools/testing/selftests/clone3/Makefile | 4 +- .../clone3/clone3_cap_checkpoint_restore.c | 203 ++++++++++++++++++ 9 files changed, 245 insertions(+), 15 deletions(-) create mode 100644 tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c base-commit: 48f99181fc118d82dc8bf6c7221ad1c654cb8bc2