From patchwork Wed Sep 26 20:34:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schaufler, Casey" X-Patchwork-Id: 10616753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1308E15E8 for ; Wed, 26 Sep 2018 20:35:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 050FB2B7FC for ; Wed, 26 Sep 2018 20:35:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECA8D2B7FA; Wed, 26 Sep 2018 20:35:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 1D9D92B7FA for ; Wed, 26 Sep 2018 20:35:02 +0000 (UTC) Received: (qmail 11419 invoked by uid 550); 26 Sep 2018 20:35:00 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 11387 invoked from network); 26 Sep 2018 20:35:00 -0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,307,1534834800"; d="scan'208";a="93990977" From: Casey Schaufler To: kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, casey.schaufler@intel.com, dave.hansen@intel.com, deneen.t.dock@intel.com, kristen@linux.intel.com, arjan@linux.intel.com Subject: [PATCH v5 0/5] LSM: Support ptrace sidechannel access checks Date: Wed, 26 Sep 2018 13:34:41 -0700 Message-Id: <20180926203446.2004-1-casey.schaufler@intel.com> X-Mailer: git-send-email 2.17.0 X-Virus-Scanned: ClamAV using ClamSMTP v5: Revamped to match Jiri Kosina Harden spectrev2 userspace-userspace protection v7 Fixed locking issues in the LSM code. Dropped the new LSM hook and use a ptrace hook instead. v4: select namespace checks if user namespaces are enabled and credential checks are request. v3: get_task_cred wasn't a good choice due to refcounts. Use lower level protection instead v2: SELinux access policy corrected. Use real_cred instead of cred. This patchset provide a mechanism by which a security module can advise the system about potential side-channel vulnerabilities. The existing security modules have been updated to avoid locking issues in the face of PTRACE_MODE_SCHED. A new security module is provided to make determinations regarding task attributes including namespaces. Signed-off-by: Casey Schaufler --- include/linux/lsm_hooks.h | 5 +++ kernel/ptrace.c | 2 - security/Kconfig | 1 + security/Makefile | 2 + security/apparmor/domain.c | 2 +- security/apparmor/include/ipc.h | 2 +- security/apparmor/ipc.c | 8 ++-- security/apparmor/lsm.c | 5 ++- security/commoncap.c | 2 + security/security.c | 1 + security/selinux/hooks.c | 2 + security/sidechannel/Kconfig | 13 ++++++ security/sidechannel/Makefile | 1 + security/sidechannel/sidechannel.c | 88 ++++++++++++++++++++++++++++++++++++++ security/smack/smack_lsm.c | 3 +- 15 files changed, 127 insertions(+), 10 deletions(-)