From patchwork Fri May 11 00:54:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10394425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F195360170 for ; Fri, 11 May 2018 14:40:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0B0628E9E for ; Fri, 11 May 2018 14:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D539228EA4; Fri, 11 May 2018 14:40:56 +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=-4.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,NO_RDNS_DOTCOM_HELO,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from ucol19pa09.eemsg.mail.mil (ucol19pa09.eemsg.mail.mil [214.24.24.82]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CCC728662 for ; Fri, 11 May 2018 14:40:55 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.49,389,1520899200"; d="scan'208";a="695327898" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by ucol19pa09.eemsg.mail.mil with ESMTP; 11 May 2018 14:40:54 +0000 X-IronPort-AV: E=Sophos;i="5.49,389,1520899200"; d="scan'208";a="13190339" IronPort-PHdr: =?us-ascii?q?9a23=3AI+aYrBIaiWQx2fAzWNmcpTZWNBhigK39O0sv0r?= =?us-ascii?q?FitYgQKv/9rarrMEGX3/hxlliBBdydt6ofzbKO+4nbGkU4qa6bt34DdJEeHz?= =?us-ascii?q?Qksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPER?= =?us-ascii?q?vjKwV1Ov71GonPhMiryuy+4ZLebxlGiTanfb9+MAi9oBnMuMURnYZsMLs6xA?= =?us-ascii?q?HTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKH?= =?us-ascii?q?w65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0vRz?= =?us-ascii?q?+s87lkRwPpiCcfNj427mfXitBrjKlGpB6tvgFzz5LIbI2QMvdxcLndfdcHTm?= =?us-ascii?q?RfWMhfWTFKDoelY4cSE+YNOOBVoI7/qFQUrRu+Ag6sCPr2xjJUiHL73LA23/?= =?us-ascii?q?09HQ3bwQcsG8wCvGjRoNjzKawcU/26zLPQwDvdYfNY2TTz5obGfR8uo/6DQb?= =?us-ascii?q?1+f9fJyUQtCg/IgEufqZf+MjOJ1OkAqXSX4/ZuWO+tjWMstgF/oiKoxscpko?= =?us-ascii?q?TEmJgaykva+iR53Y07OMG3SE5hbt65HptQsz+VN5FrSc4lX25noj06xaMGuJ?= =?us-ascii?q?OgZygF1JQnyATCa/yJd4iH/AjjWP+NLjhinn5qZLW/hxOr/EWm1+byVdG03U?= =?us-ascii?q?5XoidKndTArHAA2wHJ5sSZRfZx4F2t1SuX2w3S6OxIO104mKvfJpI7w7M9lo?= =?us-ascii?q?AfvVrdEiL5nkj9kbWYeV8++uey7uTqerDmppiBOIBqkgz+KaEumtCnAeQ/Lw?= =?us-ascii?q?gOQ3CX+eSi273n+k30WKlKgecskqnYrZDaPt4XprK5AgBJ0oYj7AyzDzG639?= =?us-ascii?q?QDgXYLNldFeBODj4TxOlHOJu73DeunjlixnzpmyOrKM738DpnXMHTOn6ntca?= =?us-ascii?q?xg50JEzQo819Ff55ZaCrEbJ/LzX1f8tMfGAR89Mgy0xfvnCdpk2owFXmKPH6?= =?us-ascii?q?mZP7/Mvl+T/e8vP+mNa5MVuDb6MfQl4eXugmUjlV8Seqmpw4MbaGqkEfR+P0?= =?us-ascii?q?WZfX3sj88DEWcNuAoxVvDqiF2YXj5VfHuyXaU85jc+CI28FofDWp6igKaa3C?= =?us-ascii?q?uhGZ1WfG9GAEiWEXj0b4WER+sMaCWKL89jkDwLT6SuS4w61RGpsg/6yqRnI/?= =?us-ascii?q?Ha+i0cqJLi28N65/DVlREu6Dx4FcOd03uCT2tshGMHWyc23LxjoUx60lqC36?= =?us-ascii?q?l4g/hdFdNN/fNESQk6OoDBwOx9EdD9QBrBfs2OSFakXNqpHS0xQsg2w98UbE?= =?us-ascii?q?Z3A8+igQzb3yq2H78VkKSGC4Eo/aLZ2HjxIdp9x2vd2ak/kVYmWMpPNGyhhq?= =?us-ascii?q?557QTTAZDGk1mBnaawaascxDLN9HuEzWeWoU5YTBR/Ub/eUH8DYUvWqMj26V?= =?us-ascii?q?nZT7+yE7gnNBVOydKaIKtQdtLplUlGROvkONnGfW2xg32/BQyJxrOXd4fqY3?= =?us-ascii?q?8S3D/cCEgfiwAT+WyJOhQgCSu7pGLeFjNuH0r1Y0zw6el+tG+7TkgswgCKbk?= =?us-ascii?q?xh0Ly19wUQhfyYUv8T37QEtD0nqzpuBla93NPWC8SeqAZ7eqVTf8896k9d1W?= =?us-ascii?q?3Frwx9IoCgL6d6i14QaQR4pUXu2Al2CoVbisUqqWsqzAtrJaKD3lJBbCmU3Z?= =?us-ascii?q?fqOr3YMmPy5gyga7bK2lHC19ab4qQP5+47q1XkoQGkDUki/G9k09lSznuQ/J?= =?us-ascii?q?LKDBAdUZjpSEY46wB6p63GYik6/47bz2BjMbO1sjDcwdIkH/EqxQqlf9tFN6?= =?us-ascii?q?OEDgDyGdUAB8eyMOwqh0SpbhUcMeBI6aE7Itird/SD2K+kJupgmiypjXhf6o?= =?us-ascii?q?Bnzk2M7zZ8SvLP35sd2PGY0BGHVzDnjFe9qc33goZEZTYcH2q60yfkApRdZq?= =?us-ascii?q?tscoYXEW2uOdG4x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XvyRwS7qVowJvo8y/zAl4c/UgjQoQvb1FJ?= =?us-ascii?q?G7/BWW29fgyiuVvPbREGwkYkhzheMGUwzjiBVDKWRRE9gOowmtWa+PYU9QyW?= =?us-ascii?q?gkwfxjwR4CeQl/EzVu33Rakez7G5hxWFcUi2ToS/oDYQ=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2B8BwDMqvVa/wHyM5BcGgEBAQEBAgEBAQEIAQEBAYNAA?= =?us-ascii?q?4FcKINyiGKMEYFYIXUagUCTYi4TAYUHgkMhOBQBAgEBAQEBAQIBaxwMgjUkg?= =?us-ascii?q?k8BAwMBAiAEGQEBOAIDCQEBGwMBAgMCIgQCAgMBQQoIBgEMBgIBAQGDHoFpA?= =?us-ascii?q?xUDoUeKGG2BaTOCbwEBBYECAQFegjQDgTWCQAgXcoR4giSCE4EPIwyCJ4IJh?= =?us-ascii?q?h+CVIcyCIReYzyKfAmOS2SHE4R4izWGSjMhgVJNIxU7gkOCFAwXg0WKHAFVT?= =?us-ascii?q?3oBAZAVAQE?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 11 May 2018 14:40:53 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w4BEeqqK003478; Fri, 11 May 2018 10:40:52 -0400 Received: from tarius.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 w4B0sT6q007153 for ; Thu, 10 May 2018 20:54:29 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w4B0sVT1001692 for ; Thu, 10 May 2018 20:54:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1B4AwCA6PRalywYGNZcHAEBAQQBAQoBA?= =?us-ascii?q?YNAgV8og3GIYIwQgVghdRqBQJNrhHcCRYI7ITgUAQIBAQEBAQECFAEBAQEBBhg?= =?us-ascii?q?GS4U0AQMDIwQZAQE4DxwDAQIDAiYCAkUKCAYBDAYCAQGDH4FpAxUDoGiKGG2Ba?= =?us-ascii?q?TOCbwEBBYECAQFegjoDgTWCQAgXcoR4giSCE4EPIwyCJ4IJhh+CVIcwCIReYzy?= =?us-ascii?q?KegmOSWSHEoR1giuJB4ZJM4FzTSMVO4JDghQMDgmDRYocAVVPkDsBAQ?= X-IPAS-Result: =?us-ascii?q?A1B4AwCA6PRalywYGNZcHAEBAQQBAQoBAYNAgV8og3GIYIw?= =?us-ascii?q?QgVghdRqBQJNrhHcCRYI7ITgUAQIBAQEBAQECFAEBAQEBBhgGS4U0AQMDIwQZA?= =?us-ascii?q?QE4DxwDAQIDAiYCAkUKCAYBDAYCAQGDH4FpAxUDoGiKGG2BaTOCbwEBBYECAQF?= =?us-ascii?q?egjoDgTWCQAgXcoR4giSCE4EPIwyCJ4IJhh+CVIcwCIReYzyKegmOSWSHEoR1g?= =?us-ascii?q?iuJB4ZJM4FzTSMVO4JDghQMDgmDRYocAVVPkDsBAQ?= X-IronPort-AV: E=Sophos;i="5.49,387,1520913600"; d="scan'208";a="274400" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.34]) by goalie.tycho.ncsc.mil with ESMTP; 10 May 2018 20:54:36 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3APWwCcx91j7wSMP9uRHKM819IXTAuvvDOBiVQ1K?= =?us-ascii?q?B+0esSIJqq85mqBkHD//Il1AaPAd2Araocw8Pt8InYEVQa5piAtH1QOLdtbD?= =?us-ascii?q?Qizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBB?= =?us-ascii?q?r/KRB1JuPoEYLOksi7ze+/94HdbglSmDaxfa55IQmrownWqsQYm5ZpJLwryh?= =?us-ascii?q?vOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3?= =?us-ascii?q?o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RS?= =?us-ascii?q?qt4LtqSB/wiScIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyaM/hxcbndfdMdQm?= =?us-ascii?q?pNR99dWjBPD469cocDFvYNMftFpIX5uVcCsR6yCA+xD+3t1zBInGf707Ak3e?= =?us-ascii?q?QvEQ/I3wIuENwBv3vWsNr7O7wfUfy3waTS0TnPc/1b1DX75YPVch4hu/aMXb?= =?us-ascii?q?dofMfP00YvDB3Kj1WNooL4IzyV1v4Cs3WV7+pkS+2vkXMspgZtrTe13ccjlI?= =?us-ascii?q?nIi5kOyl/Y9SV22ps1JdO8SEFle96oCYdfuDuAO4RqRcMiRnhltSAnwbMFoZ?= =?us-ascii?q?62ZDYGxIkoyhLFdfCKfJKE7gzsWeqLLjp1i2ppdbO9ihqo7ESty+nxWtO13V?= =?us-ascii?q?tKtCZJjMfAu38L2hfO8MaIUOF98V2k2TuX1wDc9OVEIUcsmKXVNZMv27g+m5?= =?us-ascii?q?QNvErZAiL6hET7gLWIeUo6/+io8Ovnbq/jppCGNo90jhvyMqEvmsy7Geg4Mw?= =?us-ascii?q?4OUHaH+emkyrHv4EL0TK9UgvA5iKXVrp/XKd4Uq6O2GwNV15ws6xe7Dzeoyt?= =?us-ascii?q?QYmnwHIUpZdx2dlIjmJVHPLevjDfijg1Sjiiprx/7CPrL/GJXBN2TMn637cb?= =?us-ascii?q?lh7E5czRI/zcpD6JJMFrEBPPXzV1fqtNPGCh85Mgq0w/voCdhmyoMfWX6AAq?= =?us-ascii?q?+eMK/It1+I/fggL/ODZI8SpjauY8QistrVqDdtnV4bYLnsxpYcdWq5AuUjJk?= =?us-ascii?q?KVfH7hqskOHH1MvQckSuHuzlqYXmgXL1KRe4d0sjU6Dp+2SITOXIaghJSf0y?= =?us-ascii?q?qhWJ5bfGZLDhaLC3i+M828UuoIIAeVJdVs2mgcXKWlY5coyBXrsQj90bchJe?= =?us-ascii?q?3RrGlQjo7uzNh44aXokBg28TFlR5CG33qlU3B/nmROQSQ/mq94vxo5gmyumY?= =?us-ascii?q?x5heFIXYhI6vdIVBoqHYLNxOx9TdbpU0TOecnfDB7sefCPKhJ0QtMqyMIVeG?= =?us-ascii?q?55Gs6+lVabhmytGbBf3+iwIbUf0efQ3mP6Ot1m43LHz7U6yQF/BMxVOjvizo?= =?us-ascii?q?x49w6bJYnJmkOCmqDiIaYb3CiL9mCDxGyVsUdwWwd2VqPEVnkbIEDRqIK9rm?= =?us-ascii?q?DPQqTmIrMgMUMVysOPMaBNbd7BhlVcQ/LiJdGYZHi+zSP4ORuU3a6LJKrjfW?= =?us-ascii?q?kUlHHFBU4LjgEVuHWLLw4zAg+g5mbZEjEoDlvsflnlt+9z7nGjGAt87QiPYl?= =?us-ascii?q?Yp8r2v4B8OzaieTvQJxLMfkCEorjh1WlGn0ISFJcCHol9Kdb5RcJsG61dOyG?= =?us-ascii?q?zduhY1apepNK1zrkUVcw1qsUfjzVB8A8NLls18/yBi9xZ7Na/NiAAJTDifx5?= =?us-ascii?q?2lf+2PcDOg9Q2za6PQxlDV2cqX/aFK8vkjtlH/p172RHcJ1FE8+OF8iiPa65?= =?us-ascii?q?jPFwVUVJvwVgAy9hwp773ZYyxo/4rPzjUsKqi7tDbexsgkTPUo0BeuftpTce?= =?us-ascii?q?uEGQb+HtdcBp2GOeUqnF/vZRUBMQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0A1AwD46PRalywYGNZcHAEBAQQBAQo?= =?us-ascii?q?BAYNAgV8og3GIYIwQgVghdRqBQJNrhHcCRYI7ITgUAQIBAQEBAQECARMBAQE?= =?us-ascii?q?BAQYYBksMgjUkgk8BAwMjBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWk?= =?us-ascii?q?DFQOgaIoYbYFpM4JvAQEFgQIBAV6COgOBNYJACBdyhHiCJIITgQ8jDIInggm?= =?us-ascii?q?GH4JUhzAIhF5jPIp6CY5JZIcShHWCK4kHhkkzgXNNIxU7gkOCFAwOCYNFihw?= =?us-ascii?q?BVU+QOwEB?= X-IPAS-Result: =?us-ascii?q?A0A1AwD46PRalywYGNZcHAEBAQQBAQoBAYNAgV8og3GIY?= =?us-ascii?q?IwQgVghdRqBQJNrhHcCRYI7ITgUAQIBAQEBAQECARMBAQEBAQYYBksMgjUkg?= =?us-ascii?q?k8BAwMjBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWkDFQOgaIoYbYFpM?= =?us-ascii?q?4JvAQEFgQIBAV6COgOBNYJACBdyhHiCJIITgQ8jDIInggmGH4JUhzAIhF5jP?= =?us-ascii?q?Ip6CY5JZIcShHWCK4kHhkkzgXNNIxU7gkOCFAwOCYNFihwBVU+QOwEB?= X-IronPort-AV: E=Sophos;i="5.49,387,1520899200"; d="scan'208";a="11679323" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from ucol3cpa06.eemsg.mail.mil ([214.24.24.44]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 11 May 2018 00:54:35 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;aef46ffc-3b38-45aa-acf2-801ee5b5a1b8 Authentication-Results: UCOL3CPA10.eemsg.mail.mil; dkim=pass (signature verified) header.i=@yahoo.com X-EEMSG-check-008: 30769372|UCOL3CPA10_EEMSG_MP25.csd.disa.mil X-EEMSG-SBRS: 3.5 X-EEMSG-ORIG-IP: 66.163.189.90 X-EEMSG-check-002: true X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CmAgAv5vRah1q9o0JcHQEBBQELAYUfKINxiGCNaCF1GoFAk2uEdwJFgjshOBQBAgEBAQEBAQIUAQEBCgsJCCgjDIUoAQMDIwQZAQE4DxwDAQIDAiYCAkUKCAYBDAYCAQGDH4FpAxWgb4oYbYFpM4JvAQEFgQIBAV6COgOBNYJACBdyhHiEN4EPIwyCJ4IJhh+CVIcwCIReYzyKegmOSWSHEoR1izKGSTOBc00jFTuCQ4IUDA4Jg0WKHAFVHzCQOwEB X-IPAS-Result: A0CmAgAv5vRah1q9o0JcHQEBBQELAYUfKINxiGCNaCF1GoFAk2uEdwJFgjshOBQBAgEBAQEBAQIUAQEBCgsJCCgjDIUoAQMDIwQZAQE4DxwDAQIDAiYCAkUKCAYBDAYCAQGDH4FpAxWgb4oYbYFpM4JvAQEFgQIBAV6COgOBNYJACBdyhHiEN4EPIwyCJ4IJhh+CVIcwCIReYzyKegmOSWSHEoR1izKGSTOBc00jFTuCQ4IUDA4Jg0WKHAFVHzCQOwEB Received: from sonic306-28.consmr.mail.ne1.yahoo.com ([66.163.189.90]) by UCOL3CPA10.eemsg.mail.mil with ESMTP; 11 May 2018 00:54:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1526000073; bh=TJWfrZsKoDwBiYkRApuCd1mlPv1aB8WueIMsKLghglM=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=IjSpPssgyxJx25gQxbxaCbgfBaKVg9Qp3ugbHtAwsEptbIiALeMhCcRMG1ROmBcAZi22f1iRswXbXWEEX5UKtr6zAHRLeD6DpNJHs+JZ9dZO4yIGg+8ZU+sem0fbYzQLG0xVawkIYqalTAUnI2ykttp4pQ8cKUtQRQJbzpGo3ltqmHP69XoH4TcjQ3ev8fu0x3P4KQSN6Pq0p0hWnXVgJbXNvTcDDOmMpE1rpNlOgvrV2gaffRY3ogJjBrN/S8MYwMHBjGtjLPiFplRGJswA+peDyYypC6UmeuKwqm4xaS8+poQVrW9WZc1pLhK3Z04mpCtWC91IFPqXyrXjdO2mmg== X-YMail-OSG: 3ATL4OkVM1m6fr0EfqabnHkPQrmKL_3fgBF01nWh0mhQXTi3PfGB4Is4OpSEhcz VgTaU5z1QkyPTjKt8vZ7Ejn4mtnLy2aOpSDI.6JPo3vtE71hqsNjWTi9rKpK1DaJoTJaPHhYSUxg xntDKO7oghYRhlul2LyDKK0NRiasggp.u.hdHsVPrxW3yu3Ma9w47eVR23XoNa.4LUFyr_0m4aAk Qyd0fjURwErrOItigr4Lp.rj6u7O5xuQhLii2jbl3WJFR4IvyyW_XZJUR5g9tXYaOKtUNt1Xt5iG gf2vi2RY1._tjJ08NPTYeKRbriNC1UhXGUhoFZdBk1Zzvo1oLfRzLSpltSVcDKFJv56DnZhRTUAU vvWnqBCUr1pJvFJ46rCCkxt8wV7TJDvg7aczQoZAnYN.Ekl9R7bV5wyN59JxrWVmhljP6h0Gy68l v6zy4tDEtIxRDb9Y87qM1p4g2Kc6zVAatPJkN_Ss95.eNIRleCwV6fqPhGKPKPTc9nNlLQIRVNA7 n_jwFMgiwCR868UkKBhVcz6Il3z_jVgbYOwyxHEnz1fXx09zNJ.5h5EPTRrVIybfyQxKvshCEr0o 67A060HJCcnfWODFdugOGPRX11Ahbkm4y_iClm5E6fSc9tM0RnLgJNLuJechcQs5ynawX1RfkGcR nFzc- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Fri, 11 May 2018 00:54:33 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.105]) ([67.169.65.224]) by smtp414.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 108ee866a35ab2cacdf4a717b5199176; Fri, 11 May 2018 00:54:30 +0000 (UTC) To: LSM , LKLM , Paul Moore , Stephen Smalley , SE Linux , "SMACK-discuss@lists.01.org" , John Johansen , Kees Cook , Tetsuo Handa , James Morris References: <7e8702ce-2598-e0a3-31a2-bc29157fb73d@schaufler-ca.com> X-EEMSG-check-009: 444-444 From: Casey Schaufler Message-ID: <162937ea-c98d-c226-6328-012cc74e1538@schaufler-ca.com> Date: Thu, 10 May 2018 17:54:17 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <7e8702ce-2598-e0a3-31a2-bc29157fb73d@schaufler-ca.com> Content-Language: en-US X-Mailman-Approved-At: Fri, 11 May 2018 10:37:08 -0400 Subject: [PATCH 11/23] LSM: Infrastructure management of the superblock 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: Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: Casey Schaufler Date: Thu, 10 May 2018 14:25:23 -0700 Subject: [PATCH 11/23] LSM: Infrastructure management of the superblock security blob Move management of the superblock->sb_security blob out of the individual security modules and into the security infrastructure. Instead of allocating the blobs from within the modules the modules tell the infrastructure how much space is required, and the space is allocated there. Signed-off-by: Casey Schaufler --- include/linux/lsm_hooks.h | 1 + security/security.c | 34 +++++++++++++++++++++++- security/selinux/hooks.c | 56 +++++++++++++++------------------------ security/selinux/include/objsec.h | 6 +++++ security/selinux/ss/services.c | 3 ++- security/smack/smack.h | 6 +++++ security/smack/smack_lsm.c | 35 +++++++----------------- 7 files changed, 78 insertions(+), 63 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index a935ab92906d..643e2fac8639 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2018,6 +2018,7 @@ struct lsm_blob_sizes { int lbs_cred; int lbs_file; int lbs_inode; + int lbs_superblock; int lbs_task; }; diff --git a/security/security.c b/security/security.c index 02df9b608b7e..32d1ffe213ce 100644 --- a/security/security.c +++ b/security/security.c @@ -114,6 +114,7 @@ int __init security_init(void) pr_info("LSM: cred blob size = %d\n", blob_sizes.lbs_cred); pr_info("LSM: file blob size = %d\n", blob_sizes.lbs_file); pr_info("LSM: inode blob size = %d\n", blob_sizes.lbs_inode); + pr_info("LSM: superblock blob size = %d\n", blob_sizes.lbs_superblock); pr_info("LSM: task blob size = %d\n", blob_sizes.lbs_task); #endif /* CONFIG_SECURITY_LSM_DEBUG */ @@ -290,6 +291,7 @@ void __init security_add_blobs(struct lsm_blob_sizes *needed) { lsm_set_size(&needed->lbs_cred, &blob_sizes.lbs_cred); lsm_set_size(&needed->lbs_file, &blob_sizes.lbs_file); + lsm_set_size(&needed->lbs_superblock, &blob_sizes.lbs_superblock); lsm_set_size(&needed->lbs_task, &blob_sizes.lbs_task); /* * The inode blob gets an rcu_head in addition to @@ -401,6 +403,27 @@ void lsm_early_inode(struct inode *inode) panic("%s: Early inode alloc failed.\n", __func__); } +/** + * lsm_superblock_alloc - allocate a composite superblock blob + * @sb: the superblock that needs a blob + * + * Allocate the superblock blob for all the modules + * + * Returns 0, or -ENOMEM if memory can't be allocated. + */ +int lsm_superblock_alloc(struct super_block *sb) +{ + if (blob_sizes.lbs_superblock == 0) { + sb->s_security = NULL; + return 0; + } + + sb->s_security = kzalloc(blob_sizes.lbs_superblock, GFP_KERNEL); + if (sb->s_security == NULL) + return -ENOMEM; + return 0; +} + /* * Hook list operation macros. * @@ -568,12 +591,21 @@ void security_bprm_committed_creds(struct linux_binprm *bprm) int security_sb_alloc(struct super_block *sb) { - return call_int_hook(sb_alloc_security, 0, sb); + int rc = lsm_superblock_alloc(sb); + + if (unlikely(rc)) + return rc; + rc = call_int_hook(sb_alloc_security, 0, sb); + if (unlikely(rc)) + security_sb_free(sb); + return rc; } void security_sb_free(struct super_block *sb) { call_void_hook(sb_free_security, sb); + kfree(sb->s_security); + sb->s_security = NULL; } int security_sb_copy_data(char *orig, char *copy) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 493328a1c789..5f7818d3fb16 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -334,7 +334,8 @@ static struct inode_security_struct *backing_inode_security(struct dentry *dentr static void inode_free_security(struct inode *inode) { struct inode_security_struct *isec = selinux_inode(inode); - struct superblock_security_struct *sbsec = inode->i_sb->s_security; + struct superblock_security_struct *sbsec = + selinux_superblock(inode->i_sb); /* * As not all inode security structures are in a list, we check for @@ -366,11 +367,7 @@ static int file_alloc_security(struct file *file) static int superblock_alloc_security(struct super_block *sb) { - struct superblock_security_struct *sbsec; - - sbsec = kzalloc(sizeof(struct superblock_security_struct), GFP_KERNEL); - if (!sbsec) - return -ENOMEM; + struct superblock_security_struct *sbsec = selinux_superblock(sb); mutex_init(&sbsec->lock); INIT_LIST_HEAD(&sbsec->isec_head); @@ -379,18 +376,10 @@ static int superblock_alloc_security(struct super_block *sb) sbsec->sid = SECINITSID_UNLABELED; sbsec->def_sid = SECINITSID_FILE; sbsec->mntpoint_sid = SECINITSID_UNLABELED; - sb->s_security = sbsec; return 0; } -static void superblock_free_security(struct super_block *sb) -{ - struct superblock_security_struct *sbsec = sb->s_security; - sb->s_security = NULL; - kfree(sbsec); -} - static inline int inode_doinit(struct inode *inode) { return inode_doinit_with_dentry(inode, NULL); @@ -458,7 +447,7 @@ static int may_context_mount_inode_relabel(u32 sid, static int selinux_is_sblabel_mnt(struct super_block *sb) { - struct superblock_security_struct *sbsec = sb->s_security; + struct superblock_security_struct *sbsec = selinux_superblock(sb); return sbsec->behavior == SECURITY_FS_USE_XATTR || sbsec->behavior == SECURITY_FS_USE_TRANS || @@ -477,7 +466,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb) static int sb_finish_set_opts(struct super_block *sb) { - struct superblock_security_struct *sbsec = sb->s_security; + struct superblock_security_struct *sbsec = selinux_superblock(sb); struct dentry *root = sb->s_root; struct inode *root_inode = d_backing_inode(root); int rc = 0; @@ -560,7 +549,7 @@ static int selinux_get_mnt_opts(const struct super_block *sb, struct security_mnt_opts *opts) { int rc = 0, i; - struct superblock_security_struct *sbsec = sb->s_security; + struct superblock_security_struct *sbsec = selinux_superblock(sb); char *context = NULL; u32 len; char tmp; @@ -681,7 +670,7 @@ static int selinux_set_mnt_opts(struct super_block *sb, { const struct cred *cred = current_cred(); int rc = 0, i; - struct superblock_security_struct *sbsec = sb->s_security; + struct superblock_security_struct *sbsec = selinux_superblock(sb); const char *name = sb->s_type->name; struct dentry *root = sbsec->sb->s_root; struct inode_security_struct *root_isec; @@ -936,8 +925,8 @@ static int selinux_set_mnt_opts(struct super_block *sb, static int selinux_cmp_sb_context(const struct super_block *oldsb, const struct super_block *newsb) { - struct superblock_security_struct *old = oldsb->s_security; - struct superblock_security_struct *new = newsb->s_security; + struct superblock_security_struct *old = selinux_superblock(oldsb); + struct superblock_security_struct *new = selinux_superblock(newsb); char oldflags = old->flags & SE_MNTMASK; char newflags = new->flags & SE_MNTMASK; @@ -969,8 +958,9 @@ static int selinux_sb_clone_mnt_opts(const struct super_block *oldsb, unsigned long *set_kern_flags) { int rc = 0; - const struct superblock_security_struct *oldsbsec = oldsb->s_security; - struct superblock_security_struct *newsbsec = newsb->s_security; + const struct superblock_security_struct *oldsbsec = + selinux_superblock(oldsb); + struct superblock_security_struct *newsbsec = selinux_superblock(newsb); int set_fscontext = (oldsbsec->flags & FSCONTEXT_MNT); int set_context = (oldsbsec->flags & CONTEXT_MNT); @@ -1494,7 +1484,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent if (isec->sclass == SECCLASS_FILE) isec->sclass = inode_mode_to_security_class(inode->i_mode); - sbsec = inode->i_sb->s_security; + sbsec = selinux_superblock(inode->i_sb); if (!(sbsec->flags & SE_SBINITIALIZED)) { /* Defer initialization until selinux_complete_init, after the initial policy is loaded and the security @@ -1873,7 +1863,8 @@ selinux_determine_inode_label(const struct task_security_struct *tsec, const struct qstr *name, u16 tclass, u32 *_new_isid) { - const struct superblock_security_struct *sbsec = dir->i_sb->s_security; + const struct superblock_security_struct *sbsec = + selinux_superblock(dir->i_sb); if ((sbsec->flags & SE_SBINITIALIZED) && (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) { @@ -1904,7 +1895,7 @@ static int may_create(struct inode *dir, int rc; dsec = inode_security(dir); - sbsec = dir->i_sb->s_security; + sbsec = selinux_superblock(dir->i_sb); sid = tsec->sid; @@ -2053,7 +2044,7 @@ static int superblock_has_perm(const struct cred *cred, struct superblock_security_struct *sbsec; u32 sid = cred_sid(cred); - sbsec = sb->s_security; + sbsec = selinux_superblock(sb); return avc_has_perm(&selinux_state, sid, sbsec->sid, SECCLASS_FILESYSTEM, perms, ad); } @@ -2684,11 +2675,6 @@ static int selinux_sb_alloc_security(struct super_block *sb) return superblock_alloc_security(sb); } -static void selinux_sb_free_security(struct super_block *sb) -{ - superblock_free_security(sb); -} - static inline int match_prefix(char *prefix, int plen, char *option, int olen) { if (plen > olen) @@ -2785,7 +2771,7 @@ static int selinux_sb_remount(struct super_block *sb, void *data) int rc, i, *flags; struct security_mnt_opts opts; char *secdata, **mount_options; - struct superblock_security_struct *sbsec = sb->s_security; + struct superblock_security_struct *sbsec = selinux_superblock(sb); if (!(sbsec->flags & SE_SBINITIALIZED)) return 0; @@ -2979,7 +2965,7 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir, int rc; char *context; - sbsec = dir->i_sb->s_security; + sbsec = selinux_superblock(dir->i_sb); newsid = tsec->create_sid; @@ -3216,7 +3202,7 @@ static int selinux_inode_setxattr(struct dentry *dentry, const char *name, return dentry_has_perm(current_cred(), dentry, FILE__SETATTR); } - sbsec = inode->i_sb->s_security; + sbsec = selinux_superblock(inode->i_sb); if (!(sbsec->flags & SBLABEL_MNT)) return -EOPNOTSUPP; @@ -6769,6 +6755,7 @@ struct lsm_blob_sizes selinux_blob_sizes = { .lbs_cred = sizeof(struct task_security_struct), .lbs_file = sizeof(struct file_security_struct), .lbs_inode = sizeof(struct inode_security_struct), + .lbs_superblock = sizeof(struct superblock_security_struct), }; static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { @@ -6794,7 +6781,6 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(bprm_committed_creds, selinux_bprm_committed_creds), LSM_HOOK_INIT(sb_alloc_security, selinux_sb_alloc_security), - LSM_HOOK_INIT(sb_free_security, selinux_sb_free_security), LSM_HOOK_INIT(sb_copy_data, selinux_sb_copy_data), LSM_HOOK_INIT(sb_remount, selinux_sb_remount), LSM_HOOK_INIT(sb_kern_mount, selinux_sb_kern_mount), diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h index 60d109caaeef..8104bac642b1 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h @@ -174,4 +174,10 @@ static inline struct inode_security_struct *selinux_inode(const struct inode *in return inode->i_security; } +static inline struct superblock_security_struct *selinux_superblock( + const struct super_block *superblock) +{ + return superblock->s_security; +} + #endif /* _SELINUX_OBJSEC_H_ */ diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 8057e19dc15f..41ab13319153 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include "flask.h" @@ -2766,7 +2767,7 @@ int security_fs_use(struct selinux_state *state, struct super_block *sb) struct sidtab *sidtab; int rc = 0; struct ocontext *c; - struct superblock_security_struct *sbsec = sb->s_security; + struct superblock_security_struct *sbsec = selinux_superblock(sb); const char *fstype = sb->s_type->name; read_lock(&state->ss->policy_rwlock); diff --git a/security/smack/smack.h b/security/smack/smack.h index 5da5bd1b9b47..d73e9def586c 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h @@ -372,6 +372,12 @@ static inline struct inode_smack *smack_inode(const struct inode *inode) return inode->i_security; } +static inline struct superblock_smack *smack_superblock( + const struct super_block *superblock) +{ + return superblock->s_security; +} + /* * Is the directory transmuting? */ diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index cfabb9f5cc9b..889283b553c8 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -519,12 +519,7 @@ static int smack_syslog(int typefrom_file) */ static int smack_sb_alloc_security(struct super_block *sb) { - struct superblock_smack *sbsp; - - sbsp = kzalloc(sizeof(struct superblock_smack), GFP_KERNEL); - - if (sbsp == NULL) - return -ENOMEM; + struct superblock_smack *sbsp = smack_superblock(sb); sbsp->smk_root = &smack_known_floor; sbsp->smk_default = &smack_known_floor; @@ -533,22 +528,10 @@ static int smack_sb_alloc_security(struct super_block *sb) /* * SMK_SB_INITIALIZED will be zero from kzalloc. */ - sb->s_security = sbsp; return 0; } -/** - * smack_sb_free_security - free a superblock blob - * @sb: the superblock getting the blob - * - */ -static void smack_sb_free_security(struct super_block *sb) -{ - kfree(sb->s_security); - sb->s_security = NULL; -} - /** * smack_sb_copy_data - copy mount options data for processing * @orig: where to start @@ -739,7 +722,7 @@ static int smack_set_mnt_opts(struct super_block *sb, { struct dentry *root = sb->s_root; struct inode *inode = d_backing_inode(root); - struct superblock_smack *sp = sb->s_security; + struct superblock_smack *sp = smack_superblock(sb); struct inode_smack *isp; struct smack_known *skp; int i; @@ -868,7 +851,7 @@ static int smack_sb_kern_mount(struct super_block *sb, int flags, void *data) */ static int smack_sb_statfs(struct dentry *dentry) { - struct superblock_smack *sbp = dentry->d_sb->s_security; + struct superblock_smack *sbp = smack_superblock(dentry->d_sb); int rc; struct smk_audit_info ad; @@ -905,7 +888,7 @@ static int smack_bprm_set_creds(struct linux_binprm *bprm) if (isp->smk_task == NULL || isp->smk_task == bsp->smk_task) return 0; - sbsp = inode->i_sb->s_security; + sbsp = smack_superblock(inode->i_sb); if ((sbsp->smk_flags & SMK_SB_UNTRUSTED) && isp->smk_task != sbsp->smk_root) return 0; @@ -1156,7 +1139,7 @@ static int smack_inode_rename(struct inode *old_inode, */ static int smack_inode_permission(struct inode *inode, int mask) { - struct superblock_smack *sbsp = inode->i_sb->s_security; + struct superblock_smack *sbsp = smack_superblock(inode->i_sb); struct smk_audit_info ad; int no_block = mask & MAY_NOT_BLOCK; int rc; @@ -1398,7 +1381,7 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name) */ if (strcmp(name, XATTR_NAME_SMACK) == 0) { struct super_block *sbp = dentry->d_sb; - struct superblock_smack *sbsp = sbp->s_security; + struct superblock_smack *sbsp = smack_superblock(sbp); isp->smk_inode = sbsp->smk_default; } else if (strcmp(name, XATTR_NAME_SMACKEXEC) == 0) @@ -1668,7 +1651,7 @@ static int smack_mmap_file(struct file *file, isp = smack_inode(file_inode(file)); if (isp->smk_mmap == NULL) return 0; - sbsp = file_inode(file)->i_sb->s_security; + sbsp = smack_superblock(file_inode(file)->i_sb); if (sbsp->smk_flags & SMK_SB_UNTRUSTED && isp->smk_mmap != sbsp->smk_root) return -EACCES; @@ -3267,7 +3250,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) goto unlockandout; sbp = inode->i_sb; - sbsp = sbp->s_security; + sbsp = smack_superblock(sbp); /* * We're going to use the superblock default label * if there's no label on the file. @@ -4542,6 +4525,7 @@ struct lsm_blob_sizes smack_blob_sizes = { .lbs_cred = sizeof(struct task_smack), .lbs_file = sizeof(struct smack_known *), .lbs_inode = sizeof(struct inode_smack), + .lbs_superblock = sizeof(struct superblock_smack), }; static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { @@ -4550,7 +4534,6 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(syslog, smack_syslog), LSM_HOOK_INIT(sb_alloc_security, smack_sb_alloc_security), - LSM_HOOK_INIT(sb_free_security, smack_sb_free_security), LSM_HOOK_INIT(sb_copy_data, smack_sb_copy_data), LSM_HOOK_INIT(sb_kern_mount, smack_sb_kern_mount), LSM_HOOK_INIT(sb_statfs, smack_sb_statfs),