Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp919129ybh; Sun, 19 Jul 2020 03:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQVaiQLESaYj8HKYnaREDweGjsFrs4KV8rW73xqzzreG0oe8Uvt9IE9VY+wIxMtNHs3+xp X-Received: by 2002:a17:906:f752:: with SMTP id jp18mr15820888ejb.538.1595153174773; Sun, 19 Jul 2020 03:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595153174; cv=none; d=google.com; s=arc-20160816; b=HYrOFUR0zi/W2XyMxKqhnneO2eLmXZ3zDNYSsUkv5UIPjH8AH/Hel+qgG4OZjGj9or Zv0tgX7dhBbsoZzKgsSL49Dw6Je0Dmo5DMqDxcJUwR7wBO+EbYQLJI5CygL2UhC77X1q XHPkFhtQLpdkaTj/dKebdK+kArIK+6yzMz7X9bjwlGbxZHTGYxW8qpiSfNTqyZDiTrqH Ez+2XH8ASUZuQ8PwlZgOGvAK0o9+uhTxMjiqUEBvMH1DiPt4EwoUfCBL+FYsna6BFqRZ iF6SBlzPGaWMkaIMQBNzVFxhoVOFVmrwJj7e6j84nclXfWtIGSX301MjGt/fyx+NAivl ryJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BU4zHRLNeLmtJp1vQ0m3cQQlG87+5cFcTzYcoDBrgTc=; b=Ovei78RMwADcszLGXdMRSokeOlUpEHekQENOXM+PyE23UpxFGIx7jy9kQUk3gIbJO9 FMntphTGEqLqwrIySSCdvrMO5NcMS1QQfio2nKIemQt5fC0DwI4Kkdfv8f87wu+8jrJs d/G0nP5jS6S7T51tCqANYpbHJnBhjpyaTCDgfGF5FuTuk9WOQ99zcXA9o+S/wAf2gQax qBHEpsDeRe8kM2/yfzvdvKUzrjeXvDCFpmRYzORmBcBinkzM54rjbCs88HEmt3eu/KsL FHuslUFw8dfPArQIUtWT0WEPobWnOUfevXiCYl3pOmxyLjRqyEGzA2QCSdaRSkk5wP/g OnxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JXBeYFSD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg2si9211709edb.326.2020.07.19.03.05.51; Sun, 19 Jul 2020 03:06: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=@redhat.com header.s=mimecast20190719 header.b=JXBeYFSD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbgGSKFe (ORCPT + 99 others); Sun, 19 Jul 2020 06:05:34 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:32364 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725988AbgGSKFe (ORCPT ); Sun, 19 Jul 2020 06:05:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595153133; 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=BU4zHRLNeLmtJp1vQ0m3cQQlG87+5cFcTzYcoDBrgTc=; b=JXBeYFSDkgJD/VF77gm/vn58nil5qpe6Dl6YxzgT4izEwcSZoDxTJfgE1WHk8TEk8HI7Mc S4Jy/PuHs/czi8jokbPTnEUB9OeIIJlwrjz+NJIIekynvp+6AiDfXbdbQvi406au489NbT mGl9NaCbRFlwBL2zaKKyohV53EJQtIg= 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-349-tTZzcga0No-9970HV4U0bA-1; Sun, 19 Jul 2020 06:05:31 -0400 X-MC-Unique: tTZzcga0No-9970HV4U0bA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3053F107ACCA; Sun, 19 Jul 2020 10:05:28 +0000 (UTC) Received: from dcbz.redhat.com (ovpn-112-10.ams2.redhat.com [10.36.112.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id C36AC710A8; Sun, 19 Jul 2020 10:05:16 +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?q?Micha=C5=82=20C=C5=82api=C5=84ski?= , 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 v6 0/7] capabilities: Introduce CAP_CHECKPOINT_RESTORE Date: Sun, 19 Jul 2020 12:04:10 +0200 Message-Id: <20200719100418.2112740-1-areber@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is v6 of the 'Introduce CAP_CHECKPOINT_RESTORE' patchset. The changes to v5 are: * split patch dealing with /proc/self/exe into two patches: * first patch to enable changing it with CAP_CHECKPOINT_RESTORE and detailed history in the commit message * second patch changes -EINVAL to -EPERM * use kselftest_harness.h infrastructure for test * replace if (!capable(CAP_SYS_ADMIN) || !capable(CAP_CHECKPOINT_RESTORE)) with if (!checkpoint_restore_ns_capable(&init_user_ns)) Adrian Reber (5): capabilities: Introduce CAP_CHECKPOINT_RESTORE pid: use checkpoint_restore_ns_capable() for set_tid pid_namespace: use checkpoint_restore_ns_capable() for ns_last_pid proc: allow access in init userns for map_files with CAP_CHECKPOINT_RESTORE selftests: add clone3() CAP_CHECKPOINT_RESTORE test Nicolas Viennot (2): prctl: Allow local CAP_CHECKPOINT_RESTORE to change /proc/self/exe prctl: exe link permission error changed from -EINVAL to -EPERM 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 | 13 +- security/selinux/include/classmap.h | 5 +- tools/testing/selftests/clone3/.gitignore | 1 + tools/testing/selftests/clone3/Makefile | 4 +- .../clone3/clone3_cap_checkpoint_restore.c | 177 ++++++++++++++++++ 10 files changed, 212 insertions(+), 15 deletions(-) create mode 100644 tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c base-commit: d31958b30ea3b7b6e522d6bf449427748ad45822 -- 2.26.2