From patchwork Wed Aug 15 23:53:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schaufler, Casey" X-Patchwork-Id: 10567519 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 1B1855A4 for ; Thu, 16 Aug 2018 13:48:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07D612B17B for ; Thu, 16 Aug 2018 13:48:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F00012B193; Thu, 16 Aug 2018 13:48:52 +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=unavailable version=3.3.1 Received: from uhil19pa12.eemsg.mail.mil (uhil19pa12.eemsg.mail.mil [214.24.21.85]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 200BB2B17B for ; Thu, 16 Aug 2018 13:48:51 +0000 (UTC) Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by uhil19pa12.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 16 Aug 2018 13:48:49 +0000 X-IronPort-AV: E=Sophos;i="5.53,247,1531785600"; d="scan'208";a="14907691" IronPort-PHdr: 9a23:mImgvBCAc2eUJkwRT48lUyQJP3N1i/DPJgcQr6AfoPdwSPn9ocqwAkXT6L1XgUPTWs2DsrQY07SQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeT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gEgwGCAqoog34BhmKGUYQfP4N2hHkBEgGFdwKNQjCMewcCgX+NUQsVji6TIYFDAzNhcU0jUIJpgiUXjWFWT32LGYI6AQE Received: from tarius.tycho.ncsc.mil (HELO tarius.infosec.tycho.ncsc.mil) ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 16 Aug 2018 13:48:48 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus.infosec.tycho.ncsc.mil [192.168.25.40]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7GDmhmc024209; Thu, 16 Aug 2018 09:48:44 -0400 Received: from tarius.infosec.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id w7FNsUCI004968 for ; Wed, 15 Aug 2018 19:54:30 -0400 Received: from goalie.tycho.ncsc.mil (goalie.infosec.tycho.ncsc.mil [144.51.242.250]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7FNsShn004257 for ; Wed, 15 Aug 2018 19:54:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AbBQDsvHRbfSNjr8ZdHgEGDIUxFhKYLIINlhOBeguEbAKDNCE1FwECAQEBAQEBAhQBARY6hWcDA4EJIDFXBxKDIoICrGuDfgGGYIZNgkeBWD+DdosCAo1yjHkHAoF/jVELFY4skyGBQgE1gVNNI4M5giUXjWFWHzCOQQEB X-IPAS-Result: A1AbBQDsvHRbfSNjr8ZdHgEGDIUxFhKYLIINlhOBeguEbAKDNCE1FwECAQEBAQEBAhQBARY6hWcDA4EJIDFXBxKDIoICrGuDfgGGYIZNgkeBWD+DdosCAo1yjHkHAoF/jVELFY4skyGBQgE1gVNNI4M5giUXjWFWHzCOQQEB X-IronPort-AV: E=Sophos;i="5.53,245,1531800000"; d="scan'208";a="347547" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm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2WVDevRNKLUrE/N/e8kPvONeJ5QvTHxNvwoz+DhgGV/mlIHe6Stm5wNZzTwBfliIkOEcVLwk9wBFiEMpQN4Q+v0zBW5dBd4RDO+Xrk3+yogIIanFpvYANj0xrub02PzFZRNa3EAEVuMGGrmc4iec/YKdC+WZMRml3hMWbG/Rskh3Be1uQnSyrx7I+6S8Sod8drv2d546uuViVc+8jd3J8Wbz2yJCWpzmydARCU3x7xyp2R5y1Gewe55heBVEZpY4PYNGg4gN5fa5+h7Dc3iHAPHYtqNDl2hR4aIGzY0G/k42NIfK312G9y/gBTOxWL+CLYOmq3NH5c0+7/S23XrD8d713vCkqImig91EYN0KWS6i/snpEDoDInTnhDBmg== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0H/BADsvHRbfSNjr8ZdHgEGDIUxFhKYLYINlhOBeguEbAKDNSE1FwECAQEBAQEBAgEBAhABARY6L4I1IoJiAwOBCSAxVwcSgyKCAqxrg34BhmCGTYJHgVg/g3aLAgKNcox5BwKBf41RCxWOLJMhgUIBNYFUTSODOYIlF41hVh8wjkEBAQ X-IPAS-Result: A0H/BADsvHRbfSNjr8ZdHgEGDIUxFhKYLYINlhOBeguEbAKDNSE1FwECAQEBAQEBAgEBAhABARY6L4I1IoJiAwOBCSAxVwcSgyKCAqxrg34BhmCGTYJHgVg/g3aLAgKNcox5BwKBf41RCxWOLJMhgUIBNYFUTSODOYIlF41hVh8wjkEBAQ X-IronPort-AV: E=Sophos;i="5.53,245,1531785600"; d="scan'208";a="7618547" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 23:54:03 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga002-icc.fm.intel.com with ESMTP; 15 Aug 2018 16:53:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,245,1531810800"; d="scan'208";a="75694061" Received: from cschaufl-mobl.amr.corp.intel.com ([10.252.130.105]) by orsmga003.jf.intel.com with ESMTP; 15 Aug 2018 16:53:56 -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, SMACK-discuss@lists.01.org, casey.schaufler@intel.com, dave.hansen@intel.com, deneen.t.dock@intel.com, kristen@linux.intel.com, arjan@linux.intel.com Date: Wed, 15 Aug 2018 16:53:51 -0700 Message-Id: <20180815235355.14908-2-casey.schaufler@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180815235355.14908-1-casey.schaufler@intel.com> References: <20180815235355.14908-1-casey.schaufler@intel.com> X-Mailman-Approved-At: Thu, 16 Aug 2018 09:42:40 -0400 Subject: [PATCH RFC 1/5] LSM: Introduce a hook for side-channel danger X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: Casey Schaufler There may be cases where the data maintained for security controls is more sensitive than general process information and that may be subjected to side-channel attacks. An LSM hook is provided so that this can be check for where the system would take action should the current task have potential access to the passed task. Signed-off-by: Casey Schaufler --- include/linux/lsm_hooks.h | 7 +++++++ include/linux/security.h | 1 + security/security.c | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index a08bc2587b96..fd2a7e6beb01 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -698,6 +698,11 @@ * security attributes, e.g. for /proc/pid inodes. * @p contains the task_struct for the task. * @inode contains the inode structure for the inode. + * @task_safe_sidechannel: + * Check if a side channel attack is harmless for the current task and @p. + * The caller may have determined that no attack is possible, in which + * case this hook won't get called. + * @p contains the task_struct for the task. * * Security hooks for Netlink messaging. * @@ -1611,6 +1616,7 @@ union security_list_options { int (*task_prctl)(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5); void (*task_to_inode)(struct task_struct *p, struct inode *inode); + int (*task_safe_sidechannel)(struct task_struct *p); int (*ipc_permission)(struct kern_ipc_perm *ipcp, short flag); void (*ipc_getsecid)(struct kern_ipc_perm *ipcp, u32 *secid); @@ -1897,6 +1903,7 @@ struct security_hook_heads { struct hlist_head task_kill; struct hlist_head task_prctl; struct hlist_head task_to_inode; + struct hlist_head task_safe_sidechannel; struct hlist_head ipc_permission; struct hlist_head ipc_getsecid; struct hlist_head msg_msg_alloc_security; diff --git a/include/linux/security.h b/include/linux/security.h index 3410acfe139c..69a5526f789f 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -366,6 +366,7 @@ int security_task_kill(struct task_struct *p, struct siginfo *info, int security_task_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5); void security_task_to_inode(struct task_struct *p, struct inode *inode); +int security_task_safe_sidechannel(struct task_struct *p); int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag); void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid); int security_msg_msg_alloc(struct msg_msg *msg); diff --git a/security/security.c b/security/security.c index 4927e7cc7d96..353b711e635a 100644 --- a/security/security.c +++ b/security/security.c @@ -1165,6 +1165,11 @@ void security_task_to_inode(struct task_struct *p, struct inode *inode) call_void_hook(task_to_inode, p, inode); } +int security_task_safe_sidechannel(struct task_struct *p) +{ + return call_int_hook(task_safe_sidechannel, 0, p); +} + int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag) { return call_int_hook(ipc_permission, 0, ipcp, flag); From patchwork Wed Aug 15 23:53:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schaufler, Casey" X-Patchwork-Id: 10567509 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 AF15314BD for ; Thu, 16 Aug 2018 13:47:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C0F92B279 for ; Thu, 16 Aug 2018 13:47:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FAE22B291; Thu, 16 Aug 2018 13:47:49 +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 USFB19PA12.eemsg.mail.mil (uphb19pa09.eemsg.mail.mil [214.24.26.83]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B21BA2B279 for ; Thu, 16 Aug 2018 13:47:47 +0000 (UTC) Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by USFB19PA12.eemsg.mail.mil with ESMTP; 16 Aug 2018 13:47:45 +0000 X-IronPort-AV: E=Sophos;i="5.53,247,1531785600"; d="scan'208";a="14907597" IronPort-PHdr: 9a23:mT+ymhSWYalWkdKnJ+b5qRs7o9psv+yvbD5Q0YIujvd0So/mwa6/YhKBt8tkgFKBZ4jH8fUM07OQ7/i+HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba9zIRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7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ho.ncsc.mil (HELO tarius.infosec.tycho.ncsc.mil) ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 16 Aug 2018 13:47:40 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus.infosec.tycho.ncsc.mil [192.168.25.40]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7GDlZl0024161; Thu, 16 Aug 2018 09:47:36 -0400 Received: from tarius.infosec.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id w7FNsUl8004969 for ; Wed, 15 Aug 2018 19:54:30 -0400 Received: from goalie.tycho.ncsc.mil (goalie.infosec.tycho.ncsc.mil [144.51.242.250]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7FNsSho004257 for ; Wed, 15 Aug 2018 19:54:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1D7AQDsvHRbfSNjr8ZdHgEGDIUxFhKYLIINlhOBeguEbAKDNCE0GAECAQEBAQEBAhQBARY6hWcDAydiIDFXBxKDIoICrDgzg34BhmCJFIFYP4N2iwICjXKMeQcCgX+NUQsVjiyTIYFBN4FTTSODOYIlF41hVh8wjkEBAQ X-IPAS-Result: A1D7AQDsvHRbfSNjr8ZdHgEGDIUxFhKYLIINlhOBeguEbAKDNCE0GAECAQEBAQEBAhQBARY6hWcDAydiIDFXBxKDIoICrDgzg34BhmCJFIFYP4N2iwICjXKMeQcCgX+NUQsVjiyTIYFBN4FTTSODOYIlF41hVh8wjkEBAQ X-IronPort-AV: E=Sophos;i="5.53,245,1531800000"; d="scan'208";a="347544" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 15 Aug 2018 19:54:22 -0400 IronPort-PHdr: 9a23:K5NzeBUVoH+EcKV+q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tl2RGq49/TomE5mOCYbYWpvr2OXH2z20WtVdb3tLGxaXGnfhaouAVu0kaSSOL8snmTsBEfCtQpEskxGnshT3zZJmKPbZ/msTspennNR44eDek1cuszBzBMe10meRQmUylWQNA3c1xqFkvUF74lOC17Voxf1eCdFXofhOV0NyPITexupSD9H0RxKHf9GVRVLgSdKjUh8rSddk6NYVblc1IN6ihw3N2yewS+senqeGFdov+aLVwnb1KtxVynDa2a1nhF4jFJgcfVa6j7JyolCAT7XClF+Uwv6n X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0HwAQDsvHRbfSNjr8ZdHgEGDIUxFhKYLYINlhOBeguEbAKDNSE0GAECAQEBAQEBAgEBAhABARY6L4I1IoJiAwMnYiAxVwcSgyKCAqw4M4N+AYZgiRSBWD+DdosCAo1yjHkHAoF/jVELFY4skyGBQTeBVE0jgzmCJReNYVYfMI5BAQE X-IPAS-Result: A0HwAQDsvHRbfSNjr8ZdHgEGDIUxFhKYLYINlhOBeguEbAKDNSE0GAECAQEBAQEBAgEBAhABARY6L4I1IoJiAwMnYiAxVwcSgyKCAqw4M4N+AYZgiRSBWD+DdosCAo1yjHkHAoF/jVELFY4skyGBQTeBVE0jgzmCJReNYVYfMI5BAQE X-IronPort-AV: E=Sophos;i="5.53,245,1531785600"; d="scan'208";a="7618548" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 23:54:03 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga002-icc.fm.intel.com with ESMTP; 15 Aug 2018 16:53:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,245,1531810800"; d="scan'208";a="75694064" Received: from cschaufl-mobl.amr.corp.intel.com ([10.252.130.105]) by orsmga003.jf.intel.com with ESMTP; 15 Aug 2018 16:53:57 -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, SMACK-discuss@lists.01.org, casey.schaufler@intel.com, dave.hansen@intel.com, deneen.t.dock@intel.com, kristen@linux.intel.com, arjan@linux.intel.com Date: Wed, 15 Aug 2018 16:53:52 -0700 Message-Id: <20180815235355.14908-3-casey.schaufler@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180815235355.14908-1-casey.schaufler@intel.com> References: <20180815235355.14908-1-casey.schaufler@intel.com> X-Mailman-Approved-At: Thu, 16 Aug 2018 09:42:40 -0400 Subject: [PATCH RFC 2/5] X86: Support LSM determination of side-channel vulnerability X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: Casey Schaufler When switching between tasks it may be necessary to set an indirect branch prediction barrier if the tasks are potentially vulnerable to side-channel attacks. This adds a call to security_task_safe_sidechannel so that security modules can weigh in on the decision. Signed-off-by: Casey Schaufler --- arch/x86/mm/tlb.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 6eb1f34c3c85..8714d4af06aa 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -270,11 +271,14 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next, * threads. It will also not flush if we switch to idle * thread and back to the same process. It will flush if we * switch to a different non-dumpable process. + * If a security module thinks that the transition + * is unsafe do the flush. */ - if (tsk && tsk->mm && - tsk->mm->context.ctx_id != last_ctx_id && - get_dumpable(tsk->mm) != SUID_DUMP_USER) - indirect_branch_prediction_barrier(); + if (tsk && tsk->mm && tsk->mm->context.ctx_id != last_ctx_id) { + if (get_dumpable(tsk->mm) != SUID_DUMP_USER || + security_task_safe_sidechannel(tsk) != 0) + indirect_branch_prediction_barrier(); + } if (IS_ENABLED(CONFIG_VMAP_STACK)) { /* From patchwork Wed Aug 15 23:53:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schaufler, Casey" X-Patchwork-Id: 10567521 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 173C71390 for ; Thu, 16 Aug 2018 13:49:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 028142B17B for ; Thu, 16 Aug 2018 13:49:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA7C42B193; Thu, 16 Aug 2018 13:49:08 +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=unavailable version=3.3.1 Received: from UCOL19PA10.eemsg.mail.mil (ucol19pa10.eemsg.mail.mil [214.24.24.83]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE6712B17B for ; Thu, 16 Aug 2018 13:49:05 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.53,247,1531785600"; d="scan'208";a="576913815" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by UCOL19PA10.eemsg.mail.mil with ESMTP; 16 Aug 2018 13:49:03 +0000 X-IronPort-AV: E=Sophos;i="5.53,247,1531785600"; d="scan'208";a="17089360" IronPort-PHdr: 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x9Xw+5ZSblUq7AvyqhYqY3qX4nw5B1KbKAhAcm6KvWjZ6rP2w= X-IPAS-Result: A2BjBACFf3Vb/wHyM5BcHgEGDIMggX8SFhKMV41IeJUdFIFiDxgUiCM1FwECAQEBAQEBAgFsKII1JIJfAwMBAiQTFCAOAwkBAR8hCAgDAS0VEQcHCwUYBIMBggKqATODfgGGYoZRhB8/gRKCXQeEcQgBEgGFdwKNFC4wjHsHAoF/jVELFY4ukyGBQwE1YXFNI1CCaYIlF41hVk8McYsZgjoBAQ Received: from tarius.tycho.ncsc.mil (HELO tarius.infosec.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 16 Aug 2018 13:49:02 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus.infosec.tycho.ncsc.mil [192.168.25.40]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7GDmxHh024222; Thu, 16 Aug 2018 09:49:00 -0400 Received: from tarius.infosec.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id w7FNsUja004970 for ; Wed, 15 Aug 2018 19:54:30 -0400 Received: from goalie.tycho.ncsc.mil (goalie.infosec.tycho.ncsc.mil [144.51.242.250]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7FNsShp004257 for ; Wed, 15 Aug 2018 19:54:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AeBQDsvHRbfSNjr8Zdg1GCERYSmCyCDXiVGxSBZguEbAKDNCE1FwECAQEBAQEBAhQBARY6hWcDAydiIDFXBxKDIoICrDgzg34BhmCGTYJHgVg/gRKCXQeEcYYRAo0UXox5BwKBf41RCxWOLJMhgUMCM4FTTSODOYIlF41hVh8wDI41AQE X-IPAS-Result: A1AeBQDsvHRbfSNjr8Zdg1GCERYSmCyCDXiVGxSBZguEbAKDNCE1FwECAQEBAQEBAhQBARY6hWcDAydiIDFXBxKDIoICrDgzg34BhmCGTYJHgVg/gRKCXQeEcYYRAo0UXox5BwKBf41RCxWOLJMhgUMCM4FTTSODOYIlF41hVh8wDI41AQE X-IronPort-AV: E=Sophos;i="5.53,245,1531800000"; d="scan'208";a="347548" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 15 Aug 2018 19:54:22 -0400 IronPort-PHdr: 9a23:cBRFWxevujrgwJeEIwpw8Q9jlGMj4u6mDksu8pMizoh2WeGdxcWybB7h7PlgxGXEQZ/co6odzbaO7ea4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahYL5+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hycdLzM38H/ZhNF+gqxYpxyupRJ/zpXIbI2JLvdyYrnQcc8GSWdHQ81fVzZBAoS5b4YXEecOJ/1YoJf9plATsBWxGQmsC/nyyj9Ggn/5w7c62PkmHA7axgMgBMwBsXTOoNXuKKgSUfq6zLTGzTXHcfxWwyzw6InOchA9v/6MWah8ftbWyUkqDg7IiEibp4/9Pz6Ny+gAt2uW4/B9We+ti2MrsQV8rzy1ysoiioTEgJ8exEre+iVj2ok1IMW1SE5lbt6gF5tdry+aN45tQsMnTGFnojo2xqEYtZKifSgF1IgoywTRa/yCaYSI4xTjVPqPLjd8nn5qZLW/hxOq/UihzO3zSNW03U5XoidBkdTArG0B2h7T58SdTvZw+l2t1DiP2gzL7+FLO0E0la7VK547xb4wk4IevljZES/thkr3jLWadl449eio8evnf7vmppuCOI9ukQz+M6IumtChDuQ8KAQBQ2+b+eGk2L354UL5WKlKjuExkqTBq5DVO8Abpq+/Aw9I3Ycu8Aq/Dje639QYmnkLNlRFeAmdgITzNFHOJ+74Xr+DhAGvnS1tyvSDPrT7DpjLL37MuLPgZqpmrUlExQwsxNRboZlTD/VJJPP1R1+0t9HCCBI9GxK7zvyhC9hn0I4aH2WVDevRNKLUrE/N/e8kPvONeJ5QvTHxNvwoz+DhgGV/mlIHe6Stm5wNZzTwBfliIkOEcVLwk9wBFiEMpQN4Q+v0zBW5dBd4RDO+Xrk3+yogIIanFpvYANj0xrub02PzFZRNa3EAEVuMGGrmc4iec/YKdC+WZMRml3hMWbG/Rskh3Be1uQnSyrx7I+6S8Sod8drv2d546uuViVc+8jd3J8Wbz2yJCWpzmydARCU3x7xyp2R5y1Gewe55heBVEZpY4PYNGg4gN5fa5+h7Dc3iHAPHYtqNDl2hR4aIGzY0G/k42NIfK312G9y/gBTOxWL+CLYOmq3NH5c0+7/S23XrD8d713vCkqImig91EYN0KWS6i/snpEDoDInTnhDBmg== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0EBBQDsvHRbfSNjr8Zdg1GCERYSmC2CDXiVGxSBZguEbAKDNSE1FwECAQEBAQEBAgEBAhABARY6L4I1IoJiAwMnYiAxVwcSgyKCAqw4M4N+AYZghk2CR4FYP4ESgl0HhHGGEQKNFF6MeQcCgX+NUQsVjiyTIYFDAjOBVE0jgzmCJReNYVYfMAyONQEB X-IPAS-Result: A0EBBQDsvHRbfSNjr8Zdg1GCERYSmC2CDXiVGxSBZguEbAKDNSE1FwECAQEBAQEBAgEBAhABARY6L4I1IoJiAwMnYiAxVwcSgyKCAqw4M4N+AYZghk2CR4FYP4ESgl0HhHGGEQKNFF6MeQcCgX+NUQsVjiyTIYFDAjOBVE0jgzmCJReNYVYfMAyONQEB X-IronPort-AV: E=Sophos;i="5.53,245,1531785600"; d="scan'208";a="7618549" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 23:54:03 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga002-icc.fm.intel.com with ESMTP; 15 Aug 2018 16:53:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,245,1531810800"; d="scan'208";a="75694067" Received: from cschaufl-mobl.amr.corp.intel.com ([10.252.130.105]) by orsmga003.jf.intel.com with ESMTP; 15 Aug 2018 16:53:57 -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, SMACK-discuss@lists.01.org, casey.schaufler@intel.com, dave.hansen@intel.com, deneen.t.dock@intel.com, kristen@linux.intel.com, arjan@linux.intel.com Date: Wed, 15 Aug 2018 16:53:53 -0700 Message-Id: <20180815235355.14908-4-casey.schaufler@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180815235355.14908-1-casey.schaufler@intel.com> References: <20180815235355.14908-1-casey.schaufler@intel.com> X-Mailman-Approved-At: Thu, 16 Aug 2018 09:42:40 -0400 Subject: [PATCH RFC 3/5] LSM: Security module checking for side-channel dangers X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: Casey Schaufler The sidechannel LSM checks for cases where a side-channel attack may be dangerous based on security attributes of tasks. This includes: Effective UID of the tasks is different Capablity sets are different Tasks are in different namespaces An option is also provided to assert that task are never to be considered safe. This is high paranoia, and expensive as well. Signed-off-by: Casey Schaufler --- MAINTAINERS | 6 ++ include/linux/lsm_hooks.h | 5 + security/Kconfig | 1 + security/Makefile | 2 + security/security.c | 1 + security/sidechannel/Kconfig | 60 +++++++++++ security/sidechannel/Makefile | 1 + security/sidechannel/sidechannel.c | 156 +++++++++++++++++++++++++++++ 8 files changed, 232 insertions(+) create mode 100644 security/sidechannel/Kconfig create mode 100644 security/sidechannel/Makefile create mode 100644 security/sidechannel/sidechannel.c diff --git a/MAINTAINERS b/MAINTAINERS index 3119bba7971c..d078d6a5b471 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13066,6 +13066,12 @@ F: drivers/slimbus/ F: Documentation/devicetree/bindings/slimbus/ F: include/linux/slimbus.h +SIDECHANNEL SECURITY MODULE +M: Casey Schaufler +L: linux-security-module@vger.kernel.org +S: Maintained +F: security/sidechannel/ + SMACK SECURITY MODULE M: Casey Schaufler L: linux-security-module@vger.kernel.org diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index fd2a7e6beb01..d48e4a085fe2 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2088,5 +2088,10 @@ void __init loadpin_add_hooks(void); #else static inline void loadpin_add_hooks(void) { }; #endif +#ifdef CONFIG_SECURITY_SIDECHANNEL +void __init sidechannel_add_hooks(void); +#else +static inline void sidechannel_add_hooks(void) { }; +#endif #endif /* ! __LINUX_LSM_HOOKS_H */ diff --git a/security/Kconfig b/security/Kconfig index c4302067a3ad..28cb7b2939ee 100644 --- a/security/Kconfig +++ b/security/Kconfig @@ -237,6 +237,7 @@ source security/tomoyo/Kconfig source security/apparmor/Kconfig source security/loadpin/Kconfig source security/yama/Kconfig +source security/sidechannel/Kconfig source security/integrity/Kconfig diff --git a/security/Makefile b/security/Makefile index 4d2d3782ddef..d0c9e1b227f9 100644 --- a/security/Makefile +++ b/security/Makefile @@ -10,6 +10,7 @@ subdir-$(CONFIG_SECURITY_TOMOYO) += tomoyo subdir-$(CONFIG_SECURITY_APPARMOR) += apparmor subdir-$(CONFIG_SECURITY_YAMA) += yama subdir-$(CONFIG_SECURITY_LOADPIN) += loadpin +subdir-$(CONFIG_SECURITY_SIDECHANNEL) += sidechannel # always enable default capabilities obj-y += commoncap.o @@ -25,6 +26,7 @@ obj-$(CONFIG_SECURITY_TOMOYO) += tomoyo/ obj-$(CONFIG_SECURITY_APPARMOR) += apparmor/ obj-$(CONFIG_SECURITY_YAMA) += yama/ obj-$(CONFIG_SECURITY_LOADPIN) += loadpin/ +obj-$(CONFIG_SECURITY_SIDECHANNEL) += sidechannel/ obj-$(CONFIG_CGROUP_DEVICE) += device_cgroup.o # Object integrity file lists diff --git a/security/security.c b/security/security.c index 353b711e635a..777919349751 100644 --- a/security/security.c +++ b/security/security.c @@ -80,6 +80,7 @@ int __init security_init(void) capability_add_hooks(); yama_add_hooks(); loadpin_add_hooks(); + sidechannel_add_hooks(); /* * Load all the remaining security modules. diff --git a/security/sidechannel/Kconfig b/security/sidechannel/Kconfig new file mode 100644 index 000000000000..af9396534128 --- /dev/null +++ b/security/sidechannel/Kconfig @@ -0,0 +1,60 @@ +config SECURITY_SIDECHANNEL + bool "Sidechannel attack safety extra checks" + depends on SECURITY + default n + help + Look for a variety of cases where a side-channel attack + could potentially be exploited. Instruct the switching + code to use the indirect_branch_prediction_barrier in + cases where the passed task and the current task may be + at risk. + + If you are unsure how to answer this question, answer N. + +config SECURITY_SIDECHANNEL_UIDS + bool "Sidechannel check on UID" + depends on SECURITY_SIDECHANNEL + default n + help + Assume that tasks with different effective UIDs may be + subject to side-channel attacks. As most task switching + occurs between tasks with different effective UIDs this + can have a significant performance impact. + + If you are unsure how to answer this question, answer N. + + +config SECURITY_SIDECHANNEL_CAPABILITIES + bool "Sidechannel check on capability sets" + depends on SECURITY_SIDECHANNEL + default n + help + Assume that tasks with different sets of privilege may be + subject to side-channel attacks. Potential interactions + where the attacker lacks capabilities the attacked has + are blocked. + + If you are unsure how to answer this question, answer N. + +config SECURITY_SIDECHANNEL_NAMESPACES + bool "Sidechannel check on namespaces" + depends on SECURITY_SIDECHANNEL + depends on NAMESPACES + default n + help + Assume that tasks in different namespaces may be + subject to side-channel attacks. User, PID and cgroup + namespaces are checked. + + If you are unsure how to answer this question, answer N. + +config SECURITY_SIDECHANNEL_ALWAYS + bool "Sidechannel assumed to always be possible" + depends on SECURITY_SIDECHANNEL + default n + help + Assume that all tasks may be subject to side-channel attacks. + Always instruct the system to use countermeasures regardless + of the potential impact. + + If you are unsure how to answer this question, answer N. diff --git a/security/sidechannel/Makefile b/security/sidechannel/Makefile new file mode 100644 index 000000000000..f61d83f28035 --- /dev/null +++ b/security/sidechannel/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_SECURITY_SIDECHANNEL) += sidechannel.o diff --git a/security/sidechannel/sidechannel.c b/security/sidechannel/sidechannel.c new file mode 100644 index 000000000000..9dc875611bd8 --- /dev/null +++ b/security/sidechannel/sidechannel.c @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Side Channel Safety Security Module + * + * Copyright (C) 2018 Intel Corporation. + * + */ + +#define pr_fmt(fmt) "SideChannel: " fmt + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_SECURITY_SIDECHANNEL_ALWAYS +static int sidechannel_task_safe_sidechannel(struct task_struct *p) +{ + return -EACCES; +} +#else +/* + * safe_by_uid - Are task and current sidechannel safe? + * @p: task to check on + * + * Returns 0 if the tasks are sidechannel safe, -EACCES otherwise. + */ +#ifdef CONFIG_SECURITY_SIDECHANNEL_UIDS +static int safe_by_uid(struct task_struct *p) +{ + const struct cred *ccred = current->cred; + const struct cred *pcred = p->cred; + + /* + * Credential checks. Considered safe if: + * UIDs are the same + */ + if (ccred != pcred && ccred->euid.val != pcred->euid.val) + return -EACCES; + return 0; +} +#else +static inline int safe_by_uid(struct task_struct *p) +{ + return 0; +} +#endif + +/* + * safe_by_capability - Are task and current sidechannel safe? + * @p: task to check on + * + * Returns 0 if the tasks are sidechannel safe, -EACCES otherwise. + */ +#ifdef CONFIG_SECURITY_SIDECHANNEL_CAPABILITIES +static int safe_by_capability(struct task_struct *p) +{ + const struct cred *ccred = current->cred; + const struct cred *pcred = p->cred; + + /* + * Capabilities checks. Considered safe if: + * current has all the capabilities p does + */ + if (ccred != pcred && + !cap_issubset(pcred->cap_effective, ccred->cap_effective)) + return -EACCES; + return 0; +} +#else +static inline int safe_by_capability(struct task_struct *p) +{ + return 0; +} +#endif + +#ifdef CONFIG_SECURITY_SIDECHANNEL_NAMESPACES +/** + * safe_by_namespace - Are task and current sidechannel safe? + * @p: task to check on + * + * Returns 0 if the tasks are sidechannel safe, -EACCES otherwise. + */ +static int safe_by_namespace(struct task_struct *p) +{ + struct cgroup_namespace *ccgn = NULL; + struct cgroup_namespace *pcgn = NULL; + + /* + * Namespace checks. Considered safe if: + * cgroup namespace is the same + * User namespace is the same + * PID namespace is the same + */ + if (current->nsproxy) + ccgn = current->nsproxy->cgroup_ns; + if (p->nsproxy) + pcgn = p->nsproxy->cgroup_ns; + if (ccgn != pcgn) + return -EACCES; + if (current->cred->user_ns != p->cred->user_ns) + return -EACCES; + if (task_active_pid_ns(current) != task_active_pid_ns(p)) + return -EACCES; + return 0; +} +#else +static inline int safe_by_namespace(struct task_struct *p) +{ + return 0; +} +#endif + +/** + * sidechannel_task_safe_sidechannel - Are task and current sidechannel safe? + * @p: task to check on + * + * Returns 0 if the tasks are sidechannel safe, -EACCES otherwise. + */ +static int sidechannel_task_safe_sidechannel(struct task_struct *p) +{ + int rc; + + /* + * Easy optimizations + */ + if (p == current || p->pid == current->pid) + return 0; + + rc = safe_by_uid(p); + if (rc) + return rc; + rc = safe_by_capability(p); + if (rc) + return rc; + rc = safe_by_namespace(p); + if (rc) + return rc; + return 0; +} +#endif /* CONFIG_SECURITY_SIDECHANNEL_ALWAYS */ + +static struct security_hook_list sidechannel_hooks[] __lsm_ro_after_init = { + LSM_HOOK_INIT(task_safe_sidechannel, sidechannel_task_safe_sidechannel), +}; + +void __init sidechannel_add_hooks(void) +{ + pr_info("Extra sidechannel checks enabled\n"); + security_add_hooks(sidechannel_hooks, ARRAY_SIZE(sidechannel_hooks), + "sidechannel"); +} From patchwork Wed Aug 15 23:53:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schaufler, Casey" X-Patchwork-Id: 10567505 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 A73CA14BD for ; Thu, 16 Aug 2018 13:47:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 940352B277 for ; Thu, 16 Aug 2018 13:47:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87EE22B28A; Thu, 16 Aug 2018 13:47:10 +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 ucol19pa12.eemsg.mail.mil (ucol19pa12.eemsg.mail.mil [214.24.24.85]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4D1DF2B277 for ; Thu, 16 Aug 2018 13:47:09 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.53,247,1531785600"; d="scan'208";a="620466363" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by ucol19pa12.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 16 Aug 2018 13:47:07 +0000 X-IronPort-AV: E=Sophos;i="5.53,247,1531785600"; d="scan'208";a="17089157" IronPort-PHdr: 9a23:HyEn+BxJ0ZfBfj/XCy+O+j09IxM/srCxBDY+r6Qd1uwQLPad9pjvdHbS+e9qxAeQG9mDtb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EhYSjFeOQJUdFIFaFxgUiCM2FgECAQEBAQEBAgFsKII1JIJfAwMBAiQTFCAOAwkBAUAICAMBLRURBwcLBRgEgwGCAqoBM4N+AYZiinA/gRKCXYUAARIBhXcCjUIwjHsHAoF/jVELFYE6hySFUJMhgUgBMGFxTSNQgmmCJReNYVZPfYsZgjoBAQ Received: from tarius.tycho.ncsc.mil (HELO tarius.infosec.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 16 Aug 2018 13:47:06 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus.infosec.tycho.ncsc.mil [192.168.25.40]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7GDkuRK024145; Thu, 16 Aug 2018 09:47:01 -0400 Received: from tarius.infosec.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id w7FNsTJT004966 for ; Wed, 15 Aug 2018 19:54:29 -0400 Received: from goalie.tycho.ncsc.mil (goalie.infosec.tycho.ncsc.mil [144.51.242.250]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7FNsShl004257 for ; Wed, 15 Aug 2018 19:54:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AbBQDsvHRbfSNjr8ZdHgEGDIUxFhKYLIMFlRuBeguEbAKDNCE2FgECAQEBAQEBAhQBARY6hWcDAydiUVcHEoMiggKsODODfgGGYIkUgVg/gRKCXYsJAo1yjHkHAoF/jVELFYE6hySFTpMhgUcBMIFTTSODOYIlF41hVh8wjkEBAQ X-IPAS-Result: A1AbBQDsvHRbfSNjr8ZdHgEGDIUxFhKYLIMFlRuBeguEbAKDNCE2FgECAQEBAQEBAhQBARY6hWcDAydiUVcHEoMiggKsODODfgGGYIkUgVg/gRKCXYsJAo1yjHkHAoF/jVELFYE6hySFTpMhgUcBMIFTTSODOYIlF41hVh8wjkEBAQ X-IronPort-AV: E=Sophos;i="5.53,245,1531800000"; d="scan'208";a="347545" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 15 Aug 2018 19:54:22 -0400 IronPort-PHdr: 9a23:qrAv2xC2c1fPFZl4voOIUyQJP3N1i/DPJgcQr6AfoPdwSPXzr8bcNUDSrc9gkEXOFd2Cra4c1ayO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhTexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJNyA3/nzZhMJzi6xUohyhqgdjz4LIeoyZKOBzcr/Bcd4cWGFPXtxRVytEAo6kcYYAFfEBMvhYroLgulUBsRu+ChOxBOPhzj9HmGX21rA93us9Cw7GxxIvHtIUvHTPsNr1NL0dUf27zKnM0zrDdehb2Tb76IjUbB8hpeuAUq53ccrU0EQiER7OgFaIqYH9Ij+Y0ucAv3KG4+diVe+jkWoqpgVrrjWhxsohjJTCiJgPxVDe7yp5xZ44Jd2mR05/Zt6pCJVQtySBN4tzTcMtWX1ktDokxrEfuJ60YDQFxI4pxx7acfCHco6I4g79W+aVOzt3mHVleLenixaz90iv1PH8W9Gp3FtOrSdJiMTAu3IN2hDJ7sWKTuFx80mh1DqX0gDc8OBEIUQ6larBLJ4hx6Y9mYYJvkTYACD3mF/6jLSKeUUk4Oeo9urnYrH4qZ+GLIJ0iwf+Mrgwlcy7G+g3Lg8OX22D9eSmyLLj5VH5QKlNjvAuianWrpTaJcUdpq6kDA5YyZoj6hajADem19QUh38HLElfdx6dgIjpPE/Oc7jECqK8jk6qnTMux/ncMrDnA5PCBnzCi6v6O7Fl5khDwQ43i9tY4tYcDrAHPeK2WULrstHcJgE2PhbywOv9Dth5kIQEVibHBq6fLbOXqlKD+/guP/jJYYgZpTLwA+Yq6uSojnIjn1IZO66z0t9fc328H/J7M22FcHHshZEHCm5MsQ0gCKTRrXSpcntfZm25QrknzjU6E569S9+aAIe3j/jJ1y6gE4wQfWtGA02CFXryX4SCR/oILimVJ4spnjUaWP6hQok62BeGtQnmxr4hJe3RvmUUuJTu2d4z+6vfkhox3T1yE8mZlWqKSiU8nXkJXCM72oh7oEpg2hGC17R1h7pTEtkXr/pTUA48HZrdyfFqTdH0Rg/FONyOTQWIWNKjVBo4Vd8gi+QFY09gFdGvlFiX1COxDq5TjLeLDYE69q/G93n3O8t5jX3B0f9y3BEdXsJTODj+1eZE/A/JCtuRng== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0H/BADsvHRbfSNjr8ZdHgEGDIUxFhKYLYMFlRuBeguEbAKDNSE2FgECAQEBAQEBAgEBAhABARY6L4I1IoJiAwMnYlFXBxKDIoICrDgzg34BhmCJFIFYP4ESgl2LCQKNcox5BwKBf41RCxWBOockhU6TIYFHATCBVE0jgzmCJReNYVYfMI5BAQE X-IPAS-Result: A0H/BADsvHRbfSNjr8ZdHgEGDIUxFhKYLYMFlRuBeguEbAKDNSE2FgECAQEBAQEBAgEBAhABARY6L4I1IoJiAwMnYlFXBxKDIoICrDgzg34BhmCJFIFYP4ESgl2LCQKNcox5BwKBf41RCxWBOockhU6TIYFHATCBVE0jgzmCJReNYVYfMI5BAQE X-IronPort-AV: E=Sophos;i="5.53,245,1531785600"; d="scan'208";a="7618550" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 23:54:04 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga002-icc.fm.intel.com with ESMTP; 15 Aug 2018 16:53:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,245,1531810800"; d="scan'208";a="75694071" Received: from cschaufl-mobl.amr.corp.intel.com ([10.252.130.105]) by orsmga003.jf.intel.com with ESMTP; 15 Aug 2018 16:53:58 -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, SMACK-discuss@lists.01.org, casey.schaufler@intel.com, dave.hansen@intel.com, deneen.t.dock@intel.com, kristen@linux.intel.com, arjan@linux.intel.com Date: Wed, 15 Aug 2018 16:53:54 -0700 Message-Id: <20180815235355.14908-5-casey.schaufler@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180815235355.14908-1-casey.schaufler@intel.com> References: <20180815235355.14908-1-casey.schaufler@intel.com> X-Mailman-Approved-At: Thu, 16 Aug 2018 09:42:40 -0400 Subject: [PATCH RFC 4/5] Smack: Support determination of side-channel vulnerability X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP Smack considers its private task data safe if the current task has read access to the passed task. Signed-off-by: Casey Schaufler --- security/smack/smack_lsm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 91750205a5de..85dc053e610c 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -2299,6 +2299,23 @@ static void smack_task_to_inode(struct task_struct *p, struct inode *inode) isp->smk_inode = skp; } +/** + * smack_task_safe_sidechannel - Are the task and current sidechannel safe? + * @p: task to check on + * + * A crude value for sidechannel safety is that the current task is + * already allowed to read from the other. + * + * Returns 0 if the tasks are sidechannel safe, -EACCES otherwise. + */ +static int smack_task_safe_sidechannel(struct task_struct *p) +{ + struct smack_known *skp = smk_of_task_struct(p); + struct smack_known *ckp = smk_of_task_struct(current); + + return smk_access(ckp, skp, MAY_READ, NULL); +} + /* * Socket hooks. */ @@ -4718,6 +4735,7 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(task_movememory, smack_task_movememory), LSM_HOOK_INIT(task_kill, smack_task_kill), LSM_HOOK_INIT(task_to_inode, smack_task_to_inode), + LSM_HOOK_INIT(task_safe_sidechannel, smack_task_safe_sidechannel), LSM_HOOK_INIT(ipc_permission, smack_ipc_permission), LSM_HOOK_INIT(ipc_getsecid, smack_ipc_getsecid), From patchwork Wed Aug 15 23:53:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schaufler, Casey" X-Patchwork-Id: 10567515 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 B72595A4 for ; Thu, 16 Aug 2018 13:48:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A55BD2B177 for ; Thu, 16 Aug 2018 13:48:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98D2D2B17D; Thu, 16 Aug 2018 13:48:26 +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 USFB19PA11.eemsg.mail.mil (uphb19pa08.eemsg.mail.mil [214.24.26.82]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D38E2B177 for ; Thu, 16 Aug 2018 13:48:25 +0000 (UTC) Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by USFB19PA11.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 16 Aug 2018 13:48:23 +0000 X-IronPort-AV: E=Sophos;i="5.53,247,1531785600"; d="scan'208";a="17089285" IronPort-PHdr: 9a23:S+ZZ6BOPI7WuUkcOEuol6mtUPXoX/o7sNwtQ0KIMzox0L/r9ocbcNUDSrc9gkEXOFd2Cra4c1ayO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhTexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs7Vy6i76N2QxH2jikJOSMy/GXOhsBtkK5XpRSsrAF9zYHJeoGYLPpwcL3Tc90ZQmROXMhRWTFZAo6+cocCAeUOMvpXoYbjvFsDtge+CAu2Ce/z0DJEmmH60Ksn2OohCwHG2wkgEsoQvXvOt9X6KqcTWv2owqbUzTXMde5W2Tn56IfWaBAqvPaBUq5qfsrK10YuFxnJjk6MpozlJTyVy+oNs2yF4Op6Tu+vimgnqx1vrTir3Msjlo7JhocMx13C6C53w541KMWlREN0btOoCptduzyAO4doTc4uXXtktDsixrEbvZO2fzIGxIklyhPfcfCKd4yF7gjtWeuRJzpzmWhrd6ilhxmo9Eit0uj8Vs6p31lUtidFidzMtmwV1xzU98iHVuNx/ke/1jaL0ADe8v1ELloularaNp4h2aQ8lpsVsUTNGS/2g1v5g7OMekU4+umn9+TnYrL8qp+aK4B0kR3xPr4rmsy+BeQ0KgkOX26F9uSg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Y9fOq76XBOObh38PU0p5F7YYegjo/J4SOt8iR6aVReIfug4TQeAxSYcsJiHq/6F9MQ13fxT5ZbKoj82sreWOItNYrmHbqFI5KjzRvTUCzOC5SUpwaJXuz3n/Jp09QHRd6dFqARhOHY1TFsdGpA2iR9aXgqCgl9K300d7vfIa96v2Fv3Okt++2sE5VoJY7EqjODfXGbktg0J5g+D0ifDFgbfrDsa3UtofWfkzeWXFY6LIGoilYmaFM9nxaghd+L6Vzbx9Xw+5ZSblUq7AvyqhYqY3qX4nw5B1KbKAhAcm6KvWjZ6rP2w= X-IPAS-Result: A2AMBACFf3Vb/wHyM5BcHQEBBQELAYUfEhYSjFejXRSBWhcYFIgjNhYBAgEBAQEBAQIBbCiCNSSCXwMDAQIkExQgDgMJAQFACAgDAS0VEQcHCwUYBIMBggKqATODfgGGYopwP4NvhQABEgGFdwKNQjCMewcCgX+NUQsVji6TIYFIBSxhcU0jUIJpgiUXEY1QVk99ixmCOgEB Received: from tarius.tycho.ncsc.mil (HELO tarius.infosec.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 16 Aug 2018 13:48:21 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus.infosec.tycho.ncsc.mil [192.168.25.40]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7GDmEx0024196; Thu, 16 Aug 2018 09:48:18 -0400 Received: from tarius.infosec.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id w7FNsU9f004967 for ; Wed, 15 Aug 2018 19:54:30 -0400 Received: from goalie.tycho.ncsc.mil (goalie.infosec.tycho.ncsc.mil [144.51.242.250]) by tarius.infosec.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w7FNsShm004257 for ; Wed, 15 Aug 2018 19:54:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1D6AQDsvHRbfSNjr8ZdHgEGDIUxFhKYLJgggXoLhGwCgzQhNBgBAgEBAQEBAQIUAQEWOoVnAwMnYlFXBxKDIoICrDgzg34BhmCJFIFYP4NvB4sCAo1yjHkHAoF/jVELFY4skyGBQTeBU00jgzmCJRcRjVBWHzCOQQEB X-IPAS-Result: A1D6AQDsvHRbfSNjr8ZdHgEGDIUxFhKYLJgggXoLhGwCgzQhNBgBAgEBAQEBAQIUAQEWOoVnAwMnYlFXBxKDIoICrDgzg34BhmCJFIFYP4NvB4sCAo1yjHkHAoF/jVELFY4skyGBQTeBU00jgzmCJRcRjVBWHzCOQQEB X-IronPort-AV: E=Sophos;i="5.53,245,1531800000"; d="scan'208";a="347546" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 15 Aug 2018 19:54:22 -0400 IronPort-PHdr: 9a23:NW6iSxFs1PqIk9Rq2WtfG51GYnF86YWxBRYc798ds5kLTJ7yr8SwAkXT6L1XgUPTWs2DsrQY07SQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDuwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KOT4n/m/KhMJ+j6VVrxCvpxFk34LYfJuYOOZkc6/BYd8XQ3dKUMZLVyxGB4Oxd5UCAPAaPelGr4j2ukYAoge+BQa2GePvxDtIiWHs3aYn1OkuDRvJ3Bc+ENMOqnjUt8n6NKcIXuCowqnIySvMb+lN1Df87ojIbg4uofWWUb1sdsrRzFAiGgXYhVuTsYzoJy6Z2+AOvmS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ZgggXoLhGwCgzUhNBgBAgEBAQEBAQIBAQIQAQEWOi+CNSKCYgMDJ2JRVwcSgyKCAqw4M4N+AYZgiRSBWD+DbweLAgKNcox5BwKBf41RCxWOLJMhgUE3gVRNI4M5giUXEY1QVh8wjkEBAQ X-IronPort-AV: E=Sophos;i="5.53,245,1531785600"; d="scan'208";a="7618551" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 23:54:04 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga002-icc.fm.intel.com with ESMTP; 15 Aug 2018 16:53:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,245,1531810800"; d="scan'208";a="75694074" Received: from cschaufl-mobl.amr.corp.intel.com ([10.252.130.105]) by orsmga003.jf.intel.com with ESMTP; 15 Aug 2018 16:53:59 -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, SMACK-discuss@lists.01.org, casey.schaufler@intel.com, dave.hansen@intel.com, deneen.t.dock@intel.com, kristen@linux.intel.com, arjan@linux.intel.com Date: Wed, 15 Aug 2018 16:53:55 -0700 Message-Id: <20180815235355.14908-6-casey.schaufler@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180815235355.14908-1-casey.schaufler@intel.com> References: <20180815235355.14908-1-casey.schaufler@intel.com> X-Mailman-Approved-At: Thu, 16 Aug 2018 09:42:40 -0400 Subject: [PATCH RFC 5/5] SELinux: Support SELinux determination of side-channel vulnerability X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP SELinux considers tasks to be side-channel safe if they have PROCESS_SHARE access. Signed-off-by: Casey Schaufler --- security/selinux/hooks.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index a8bf324130f5..7fbd7d7ac1cb 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -4219,6 +4219,14 @@ static void selinux_task_to_inode(struct task_struct *p, spin_unlock(&isec->lock); } +static int selinux_task_safe_sidechannel(struct task_struct *p) +{ + struct av_decision avd; + + return avc_has_perm_noaudit(&selinux_state, current_sid(), task_sid(p), + SECCLASS_PROCESS, PROCESS__SHARE, 0, &avd); +} + /* Returns error only if unable to parse addresses */ static int selinux_parse_skb_ipv4(struct sk_buff *skb, struct common_audit_data *ad, u8 *proto) @@ -7002,6 +7010,7 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(task_movememory, selinux_task_movememory), LSM_HOOK_INIT(task_kill, selinux_task_kill), LSM_HOOK_INIT(task_to_inode, selinux_task_to_inode), + LSM_HOOK_INIT(task_safe_sidechannel, selinux_task_safe_sidechannel), LSM_HOOK_INIT(ipc_permission, selinux_ipc_permission), LSM_HOOK_INIT(ipc_getsecid, selinux_ipc_getsecid),