Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1208648imm; Wed, 26 Sep 2018 13:36:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV600XUIeGuDqJMsCAuJSvp4CAi7mqUEF1a5Kw3PAog88X/PT9woPpNJWFOiEUqKho+TfXruG X-Received: by 2002:a17:902:7283:: with SMTP id d3-v6mr7572551pll.326.1537994169521; Wed, 26 Sep 2018 13:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537994169; cv=none; d=google.com; s=arc-20160816; b=dQw0N34RSjfQ+JUcbezs/6F+tfYkgwHSnSBVddVhCM7vhPT0nZNA2p7Brdq8e6O3Aa iJwDoTs0yrKk3H+n49+yvPx6JKI+irS+NNNSYpXzZSYL8Hd1XlbLypDWXGB4rqsLWY20 K82hSo550oDrI4IjtM/bjUNHF8MDXD/OgS4SNDz70FrxClFBsApE3lGnpn7wF2PE+NZL NV8ELcboF/o64l5JMikFXfkD4ByzezdClYs+GTWS4I+klMYMFJbKzm9QePSGy7SwlsQt Vs6bv42nz4q9D6wqrbNr2uJHkjpt/rsrwthYbtQMMkYbADyqCV6HA5TbpyKDVd1AtDJK STFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=0fJMsa1WOAxDYbn1DppM8xuYir5Wgv5+p3PkoPkySFY=; b=qWA1pwsys2FgDavLIf0e+VLdXYMPCT4d3OrAEyM6gtOsdb1CpuNQZfzXPiXFoVSRQf e60Donebo2JG/idcTXuBUHpWB6vSM04gswJYDydtW7+n0xPKezOet1axsdGWOVa9bzgM e+KanPszrKOfcRJpG9PygOuPddCwL6SylE8PHoHluQnSYP+P+ApGdTLhyVNcQb37wCoI 50Cf3CiwGWjhrAUpgQN3yrSPvWtWrauUagSGKn6REZE2Dgv+dAn14xG2PY9FHqgbIwJV KDVOprS9rm6fn2uY1pnHmLii1EyB3dFjKDXebfpjaaX4vOAMawxRvKagTBVXRmKLOH8b vPDw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17-v6si5976460pgf.660.2018.09.26.13.35.55; Wed, 26 Sep 2018 13:36:09 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727014AbeI0Ctd (ORCPT + 99 others); Wed, 26 Sep 2018 22:49:33 -0400 Received: from mga01.intel.com ([192.55.52.88]:12173 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbeI0Ctd (ORCPT ); Wed, 26 Sep 2018 22:49:33 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 13:34:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,307,1534834800"; d="scan'208";a="93990977" Received: from cschaufl-mobl.amr.corp.intel.com ([10.251.154.97]) by orsmga001.jf.intel.com with ESMTP; 26 Sep 2018 13:34:47 -0700 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-)