From patchwork Fri May 11 00:53:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10394413 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 D72D460170 for ; Fri, 11 May 2018 14:40:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C853F28EA6 for ; Fri, 11 May 2018 14:40:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCE5B28EBA; Fri, 11 May 2018 14:40:39 +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 ucol19pa12.eemsg.mail.mil (ucol19pa12.eemsg.mail.mil [214.24.24.85]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA9DF28EA6 for ; Fri, 11 May 2018 14:40:37 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.49,389,1520899200"; d="scan'208";a="558723450" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by ucol19pa12.eemsg.mail.mil with ESMTP; 11 May 2018 14:40:36 +0000 X-IronPort-AV: E=Sophos;i="5.49,389,1520899200"; d="scan'208";a="11697038" IronPort-PHdr: =?us-ascii?q?9a23=3AWft2Yx/TeB8wVP9uRHKM819IXTAuvvDOBiVQ1K?= =?us-ascii?q?B50+kQIJqq85mqBkHD//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+tqwBjz4LRZoyaOuB+fqfAdt0EQ2?= =?us-ascii?q?RPUNtaWyhYDo+hc4cDCuwMMuFaoIbnp1sOqhy+CRC1CO7zxDJFh2L60bQm3+?= =?us-ascii?q?g8DArK2BIsE84LvHnSsd77NrodUfqtwafWwzXNb/BY1znz54fHcB8uvf6CU6?= =?us-ascii?q?9occfT1EUiGR3Kjk6LpIz5PT6YzPgBv3SV4udiU++klm4pqxt2ojiq3sohlJ?= =?us-ascii?q?PGhpkLxVHE6C533Zo6Jd2iR05mb96kFIVftzuHPIZxXswtWXpotzg6y7Adop?= =?us-ascii?q?60YCgKx446xx7Rb/yIbZKI7gv/W+mLOzt3mHVleLemihu07EOuyfX8W9Gp3F?= =?us-ascii?q?tFoSdJiNnBum0X2xDN5cWLVOFx8lq51TuO1Q3f8PxILEEwmKbBKpMswqQ8mo?= =?us-ascii?q?QNvUnMGCL9hV/4g7WMdko+/+il8+HnYrL7qZCCL4J0kQT+Mrg2msy4HOQ4Lh?= =?us-ascii?q?ACX2iF9uS4073u5VH5T69Qjv03j6nZq4rWJdgbp6GlAw9V1Zwv6xCjADe9zN?= =?us-ascii?q?sUh3wHLFNBeB6fjojpPU/BIOzgAPuijFmhny1nyvDbMrH7HJnAIWbPnK38cb?= =?us-ascii?q?pl7k5T0gszzdRR55JODbEBJer+WlTvu9zcDx85NRG0wun+BNpm0YMeRGSPDb?= =?us-ascii?q?OHP6PJqlKI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ascii?q?11ZosLEnuhI8ypydV4m57tWmRX+ESlB1wYxM+jYQCSYEDl3Q1MyUQXpmSqmT?= =?us-ascii?q?GlwDNpiDwpoa+f3SPUz+TkahUHJnZBRHN+glf0PYi0k9caUVCzbwgnjhul4l?= =?us-ascii?q?36x7RAqaRkKWnTRklJfy3sIGFkSKewsKSNY9JX4pMyrSpXSPi8YUydSrPlrR?= =?us-ascii?q?oVySfjH3dAyzAhbDGnoYv5kAJgiG2GMXZzqWDVecZqxRfQ/NbcX+Je3iIaRC?= =?us-ascii?q?lkjjnaHka8P9i18tWIkJfDqPqyWH6hVp1UdynrwpiNtC+65W1sGxK/hfezls?= =?us-ascii?q?fgEQgg3i/xz8NqWjnQrBbgfonr0Ly3MeZmfklzGF/w8tF6FZ96kosxgpEQxH?= =?us-ascii?q?cbi46O/XofkGfzN9Rb1r7lbHYXQz4E3cLV6hD/2EJ/NnKJ2575VnKFz8t7YN?= =?us-ascii?q?m6ZmcW1Twn789WD6eV4qdJnTBoolWktgLde/99ni0SyfE28n4Vn/kJuBYxzi?= =?us-ascii?q?WaGr0SHldXPSr3lxmT7NCxsqNXZH2pcbeuyEpyh9ehDKuNogtEQnb2Zo8iHT?= =?us-ascii?q?Ns7sV4KF/MyGf86pzgeNbOddIcrBuUkwvegOhPM58xi+EKijR9OWLmp3El0O?= =?us-ascii?q?k7jQF03Z6mooeHJWJt/Li2AhFGLDH1Yd0c+i31h6ZEgsmWx5yvHolmGjgTQp?= =?us-ascii?q?voS++nHSkMtfThKgmOECcwqnGFFrrDBQWf8ltpr2rTE5C3MHGaPGEZws9/RB?= =?us-ascii?q?mZP0FQnAEUXCk6n5IgGACl3srhfF1+5jAL6V7ysgFMxf5wNxnjTmffox+laj?= =?us-ascii?q?Q0SZibMhVb9QRC50DbMcyQ8O1zAz1Y/p2mrAyINGOXfQJIAn8VWkacHVDsIq?= =?us-ascii?q?Gu5cXc8+ifHue+IeHBYbOSqexZUveF3pyv3ZV78DaLLMWAJGFiD+c82kp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KlqvLn2k825li+MxoGzKxs5YiY+6qHvunXbwDLwbgDQKjqSdv5rq4wtE?= =?us-ascii?q?OK+f0kiLkOd3R3YwK9FugdWNQdxmD9wq801i8sD9nMH7T7+P5ETX45mCzvm4?= =?us-ascii?q?xlFVUMBvwUBaaL/ZhZnmoglOzZK9wWcqRGmmmREB6pCaINxmCw5CuWOmZlhA?= =?us-ascii?q?vC0xbqQWO89FX2tzN3QTPQz9f/lUpYTru3BUZXXyeyPE93rjOOMxTytNr2v6?= =?us-ascii?q?Q141s6Mmr6u9KRjGGhIq9YH9XjJNyAJik5vFQXjJkqS9yu34AbHMCxINYX8H?= =?us-ascii?q?FwdPvR8XirkzNbo6dam4Xe/tyV+u/JEnW6iK2asbqNzihCynckpVE/9sygNv?= =?us-ascii?q?bW6t2PRPSo0XoRTyhhtAbaWh61q6bUr1YKNkyX3kbLn5YKPtJC3XUi0EHp+v?= =?us-ascii?q?QjSsop9ApCDobAe+8CpTfrNTvw2lafZtI6WzKQ0zRJA131FkN4F7Ik2GLqu8?= =?us-ascii?q?LJl2nf9EE0RoVqcEznnxN3BZ0iKU0x8FgX3jYDEQ8VZBCaDbCnH17qIpcfWE?= =?us-ascii?q?gYdxuHwKa1dbst0U102LOv6/fZbfZgCKoVKvZdkgmOkUBAFZIXqq0fTqhze1?= =?us-ascii?q?1c9K7LvgjtEZXnX/z9mHUsMv26X95V/toEt3s45Qa/XQCv5Y1E77YBh5CCbr?= =?us-ascii?q?REboTUvMBg80dn4iYCdjRXjxhjkxy5Ue4dpOf54tjYqZao8fihVKIsR+UR6h?= =?us-ascii?q?g1CH9zj4Pqj1A/vd7X1+ldSorPiYT86gxNIGCFuJzc0xZiLeoCMYWrfKxv93?= =?us-ascii?q?8fPSgRO2oOPcaKa/k7+yJtPy/c50ZcDcMQZdMVJ87NmQFIikL3WLFc7NfbGk?= =?us-ascii?q?SCB4d1ac8o83L9yCop/pskTubg9Di2KIjQ715TOfNDkCJslNXFqOgO3/XSDC?= =?us-asc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5oTcs5smPz31KKIriZu?= =?us-ascii?q?enjmb+tIO1iT2X/+jXV21rZk0x04dgSGWCwRwVMGgfEJlVo0DiRKecelxBnG?= =?us-ascii?q?wkk+Ng2hIAOUxzX3Ri32cQnaOVC8RZTllSh2SrTQ=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2DKCQD6qvVa/wHyM5BcGwEBAQEDAQEBCQEBAYNAA4FcK?= =?us-ascii?q?INyiGKMEYF5dRqBQJNpJxMBhQeCQyE4FAECAQEBAQEBAgFrHAyCNSSCTwEDA?= =?us-ascii?q?wECIAQZAQE4AgMJAQEbAwECAwIiBAICAwFBCggGAQwGAgEBAYMegWkDFQOhS?= =?us-ascii?q?IoYbYFpM4JvAQEFgQIBAV6CNAOBNYJACBdyhHiCJIITgQ8jgjOCCYYfgjQgh?= =?us-ascii?q?zqFQYs4CY5LZIcThHiLNYJfg2szIYFSTSMVO4JDghQMF4NFihwBVU96AQGQF?= =?us-ascii?q?QEB?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 11 May 2018 14:40:34 +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 w4BEeX4G003369; Fri, 11 May 2018 10:40:34 -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 w4B0rBDx007117 for ; Thu, 10 May 2018 20:53:11 -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 w4B0rIQB001585 for ; Thu, 10 May 2018 20:53:18 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1AGBACA6PRalykaGNZcHQIFDINBgV8og?= =?us-ascii?q?3GIYIwQgXl1GoFAk2uEdwJFgjshNxUBAgEBAQEBAQIUAQEBAQEGGAZLhTQBAwM?= =?us-ascii?q?jBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWkDFQOgaIoYbYFpM4JvAQEFg?= =?us-ascii?q?QIBAV6COgOBNYJACBdyhHiCJIITgQ8jgjOCCYYfgjQghziFQYs2CY5JZIcShHW?= =?us-ascii?q?CK4kHgl6DazKBdE0jFTuCQ4IgDgkRgzSKHAFVT5A7AQE?= X-IPAS-Result: =?us-ascii?q?A1AGBACA6PRalykaGNZcHQIFDINBgV8og3GIYIwQgXl1GoF?= =?us-ascii?q?Ak2uEdwJFgjshNxUBAgEBAQEBAQIUAQEBAQEGGAZLhTQBAwMjBBkBATgPHAMBA?= =?us-ascii?q?gMCJgICRQoIBgEMBgIBAYMfgWkDFQOgaIoYbYFpM4JvAQEFgQIBAV6COgOBNYJ?= =?us-ascii?q?ACBdyhHiCJIITgQ8jgjOCCYYfgjQghziFQYs2CY5JZIcShHWCK4kHgl6DazKBd?= =?us-ascii?q?E0jFTuCQ4IgDgkRgzSKHAFVT5A7AQE?= X-IronPort-AV: E=Sophos;i="5.49,387,1520913600"; d="scan'208";a="274385" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.34]) by goalie.tycho.ncsc.mil with ESMTP; 10 May 2018 20:53:17 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AdZQ+XRBjwKl0ggO6pN7sUyQJP3N1i/DPJgcQr6?= =?us-ascii?q?AfoPdwSP35psiwAkXT6L1XgUPTWs2DsrQY07GQ6/iocFdDyK7JiGoFfp1IWk?= =?us-ascii?q?1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBA?= =?us-ascii?q?j0OxZrKeTpAI7SiNm82/yv95HJbAhEmDSwbaluIBmqsA7cqtQYjYx+J6gr1x?= =?us-ascii?q?DHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9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DT7XpH5coyBWGrAbnz/9iKe?= =?us-ascii?q?3O92sTspe1kJBO++DLlRw0vQdxBsCZ3nDFG3p4hUsUVjQ22+Z5ukU7xVCdh+?= =?us-ascii?q?wwuNEQMd1V+uMBBhw3MZ/a0vxSF8H5WgWHeMyADlmhXIPiSXsKa/sa4JoCYl?= =?us-ascii?q?12Bs65phTCxDaxRedM0buRC9Z8ppn59lPSYsp80H3bz7IJi1g9XtAJbTTggb?= =?us-ascii?q?RwoUybJYnJlQ27kKajc78R2maZ9mCDyyyMu0FRVhV9V43OVHYYYErdpNC/7U?= =?us-ascii?q?THGfvmKrkqKUNqzsmBYv9JZ9DyhlJBR9/oOM7ZZmOsniG3HxnegvuwYZbxZm?= =?us-ascii?q?JV/CzbBEFMxxge+3mbNA57BSq7pW/aJD0rEVXxbgX3+Opjsnr9SEJyzRncKw?= =?us-ascii?q?VD3r+44VYwguaGSuhbirABvz07qi5cGl+40tOQDMCP8VlPZqJZNPg0+1pWnV?= =?us-ascii?q?nStwVgMJitNeg2jVcFfhVfpEju3gh5Doha1MMj6ngtyVwheuqjzFpdembAjt?= =?us-ascii?q?jLMbrNJzy3rEj1Mfzfx03e3dCK+6wG9PU/rRD5sRq0ElY5rCo17uJ7+SLN3r?= =?us-ascii?q?ySXEwfXJfqXQAy/hl+4bTbZnp164DV0Ch0OLKv+n/Z2t0vDfc40BvoYdpFMa?= =?us-ascii?q?2FGQOzW80XDsSjMqorznC4ZxIDO6ZZ86s5?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DsAQD46PRalykaGNZcHQIFDINBgV8?= =?us-ascii?q?og3GIYI4JdRqBQJNrhHcCRYJcNxUBAgEBAQEBAQIBEwEBAQEBBhgGSwyCNSS?= =?us-ascii?q?CTwEDAyMEGQEBOA8cAwECAwImAgJFCggGAQwGAgEBgx+BaQMVA6BoihhtgWk?= =?us-ascii?q?zgm8BAQWBAgEBXoI6A4E1gkAIF3KEeIQ3gQ8jgjOCCYYfgjQghziFQYs2CY5?= =?us-ascii?q?JZIcShHWCK4kHgl6DazKBdE0jFTuCQ4IgDgkRgzSKHAFVT5A7AQE?= X-IPAS-Result: =?us-ascii?q?A0DsAQD46PRalykaGNZcHQIFDINBgV8og3GIYI4JdRqBQ?= =?us-ascii?q?JNrhHcCRYJcNxUBAgEBAQEBAQIBEwEBAQEBBhgGSwyCNSSCTwEDAyMEGQEBO?= =?us-ascii?q?A8cAwECAwImAgJFCggGAQwGAgEBgx+BaQMVA6BoihhtgWkzgm8BAQWBAgEBX?= =?us-ascii?q?oI6A4E1gkAIF3KEeIQ3gQ8jgjOCCYYfgjQghziFQYs2CY5JZIcShHWCK4kHg?= =?us-ascii?q?l6DazKBdE0jFTuCQ4IgDgkRgzSKHAFVT5A7AQE?= X-IronPort-AV: E=Sophos;i="5.49,387,1520899200"; d="scan'208";a="11679295" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from uphb3cpa02.eemsg.mail.mil (HELO USFB19PA02.eemsg.mail.mil) ([214.24.26.41]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 11 May 2018 00:53:16 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;cd94cbe5-aad2-416c-aab6-8a1a4d15ec97 Received: from localhost.localdomain (localhost [127.0.0.1]) by USFBF3ID01.oob.disa.mil (Postfix) with SMTP id 40hs5k5qmCz3tZXj for ; Fri, 11 May 2018 00:53:14 +0000 (UTC) Received: from USFB19PA08.eemsg.mil (unknown [192.168.16.5]) by USFBF3ID01.oob.disa.mil (Postfix) with ESMTP id 40hs5k2pjyz3tZXh for ; Fri, 11 May 2018 00:53:14 +0000 (UTC) Authentication-Results: USFB19PA08.eemsg.mail.mil; dkim=pass (signature verified) header.i=@yahoo.com X-EEMSG-check-008: 262921174|USFB19PA08_EEMSG_MP4.csd.disa.mil X-EEMSG-SBRS: 3.5 X-EEMSG-ORIG-IP: 66.163.185.40 X-EEMSG-check-002: true X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CgAgAH6PRahyi5o0JcHQIFDIUgKINxiGCOCXUagUCTa4R3AkWCOyE3FQECAQEBAQEBAhQBAQEKCwkIKCMMhSgBAwMjBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWkDFaBxihhtgWkzgm8BAQWBAgEBXoI6A4E1gkAIF3KEeIQ3gQ8jgjMHggKGH4I0IIc4hUGLNgmOSWSHEoR1izKCXoNrMoF0TSMVO4JDgiAOCYNFihwBVR8wkDsBAQ X-IPAS-Result: A0CgAgAH6PRahyi5o0JcHQIFDIUgKINxiGCOCXUagUCTa4R3AkWCOyE3FQECAQEBAQEBAhQBAQEKCwkIKCMMhSgBAwMjBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWkDFaBxihhtgWkzgm8BAQWBAgEBXoI6A4E1gkAIF3KEeIQ3gQ8jgjMHggKGH4I0IIc4hUGLNgmOSWSHEoR1izKCXoNrMoF0TSMVO4JDgiAOCYNFihwBVR8wkDsBAQ Received: from sonic313-17.consmr.mail.ne1.yahoo.com ([66.163.185.40]) by USFB19PA08.eemsg.mail.mil with ESMTP; 11 May 2018 00:53:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1525999992; bh=VXNu6rFZs/CyItL3czqkhOXRDwOhMXyulca41A3WSTU=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=h1/rRLiNCK+rc3bHJCiEdxss1Waq08OD5N71h1ZrehgzUmvcKoUzcgghTX0owbhYL40+iTLmuzzSO9GzvDByYFs+jTGpfvKQTcAbQbqMVqSJ8UG77SeGLL6PcRzgOUZrcOOC0GreM5MtIz3BX89lW9j+wumweaCRVvn6IW0stp+rxnBe/pMHFLcyIau/arrQCii9UEOElEPlkiEMOj+zKHjWpCtOk8g3opoFWgE2X5YTXW/YxZN0n4Mky+d473RIpdWnb+JtA9rpwVw2KW0nmm81gAFXapP0K3TtmnxTUOxDNJ1tqcT7eba3rDRGBXGCbfnR9aI94h8PWF30MAMCdQ== X-YMail-OSG: 3c5YeEcVM1nKlOBslzpz6I.Idy06CjmBwacqk0kRF4Wauew.V4pXhyN5BS9LhVQ 9lCsQ2hlJMxqfRfyg0fw3Ojq3hpTkH2AHCw0bgLgz4rRasL5muVxnzm3SfzZ4eeG8tx.UpgNoQfU .l7nGp0vNj4Ri.hbjoVUZeBsaLoPzGRSb2OtgvQ8MnOFfbEY2ElHwxHMqHLl1DFJlqoDhLR17zEb 7XiAPA4U1iNxJk.rGJ8lfhSLiaCZnSD4gvPm_zfrMz0dyQvq4jPc8VbRyznlErU5q63eLVZ6MXUx p2dhnRcv7C1Ulc_ZujlnYO_t2LVHwwgMXGOnZrnWCXkWDmMDJw9NUqRdJM7_3NjXiKpgmvvF4dDi 9lrCDkS1nFHTyary4orEa92k4_oTNbHdtl3OdCqaDnNZVgHsbJ6F26csIsGUhHP3v3GVuNn4HF08 70mRJ9AVTMifkKqzqRVWwr2VHityopiSSn.ODuDi2jZltiVqzw9pCCzIEyPIWk2y_nUKLe2xY8lw 38mJt0jKu_btTUJJxaMlEJ7vRl_eaB4YCyvrUtYwM2xRjO1YkAl3IvrJLt7kVB1QJrKpo_hoTr1G yiOdBHKhJUGJGXguFphMXNiI2_u_uz.wwxuRJKK.3Wd7YmxJ7RmJn29iPFeBMrjk9F6y6LpQ7pGS 2sm4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Fri, 11 May 2018 00:53:12 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.105]) ([67.169.65.224]) by smtp430.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6a1fcf8ebbdc778fd65d40ca25c44b8f; Fri, 11 May 2018 00:53:10 +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: <02e30ff5-3cd8-b013-35e8-fb1040fffe6d@schaufler-ca.com> Date: Thu, 10 May 2018 17:53:07 -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 06/23] LSM: Infrastructure management of the file security 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:04:35 -0700 Subject: [PATCH 06/23] LSM: Infrastructure management of the file security blob Move management of the file->f_security blob out of the individual security modules and into the infrastructure. The modules no longer allocate or free the data, instead they tell the infrastructure how much space they require. Signed-off-by: Casey Schaufler --- include/linux/lsm_hooks.h | 1 + security/apparmor/lsm.c | 19 ++++++++-------- security/security.c | 54 +++++++++++++++++++++++++++++++++++++++++++--- security/selinux/hooks.c | 25 ++------------------- security/smack/smack.h | 5 +++++ security/smack/smack_lsm.c | 26 ++++++++-------------- 6 files changed, 78 insertions(+), 52 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index ee22b2b9b458..2268e43709d4 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2016,6 +2016,7 @@ struct security_hook_list { */ struct lsm_blob_sizes { int lbs_cred; + int lbs_file; }; /* diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index a35ef9473b71..e986a0eed01e 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -429,21 +429,21 @@ static int apparmor_file_open(struct file *file, const struct cred *cred) static int apparmor_file_alloc_security(struct file *file) { - int error = 0; - - /* freed by apparmor_file_free_security */ + struct aa_file_ctx *ctx = file_ctx(file); struct aa_label *label = begin_current_label_crit_section(); - file->f_security = aa_alloc_file_ctx(label, GFP_KERNEL); - if (!file_ctx(file)) - error = -ENOMEM; - end_current_label_crit_section(label); - return error; + spin_lock_init(&ctx->lock); + rcu_assign_pointer(ctx->label, aa_get_label(label)); + end_current_label_crit_section(label); + return 0; } static void apparmor_file_free_security(struct file *file) { - aa_free_file_ctx(file_ctx(file)); + struct aa_file_ctx *ctx = file_ctx(file); + + if (ctx) + aa_put_label(rcu_access_pointer(ctx->label)); } static int common_file_perm(const char *op, struct file *file, u32 mask) @@ -1122,6 +1122,7 @@ static void apparmor_sock_graft(struct sock *sk, struct socket *parent) */ struct lsm_blob_sizes apparmor_blob_sizes = { .lbs_cred = sizeof(struct aa_task_ctx *), + .lbs_file = sizeof(struct aa_file_ctx), }; static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = { diff --git a/security/security.c b/security/security.c index 16e8fb077412..ee77af08086b 100644 --- a/security/security.c +++ b/security/security.c @@ -40,6 +40,8 @@ struct security_hook_heads security_hook_heads __lsm_ro_after_init; static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain); +static struct kmem_cache *lsm_file_cache; + char *lsm_names; static struct lsm_blob_sizes blob_sizes; @@ -89,6 +91,13 @@ int __init security_init(void) */ do_security_initcalls(); + /* + * Create any kmem_caches needed for blobs + */ + if (blob_sizes.lbs_file) + lsm_file_cache = kmem_cache_create("lsm_file_cache", + blob_sizes.lbs_file, 0, + SLAB_PANIC, NULL); /* * The second call to a module specific init function * adds hooks to the hook lists and does any other early @@ -98,6 +107,7 @@ int __init security_init(void) #ifdef CONFIG_SECURITY_LSM_DEBUG pr_info("LSM: cred blob size = %d\n", blob_sizes.lbs_cred); + pr_info("LSM: file blob size = %d\n", blob_sizes.lbs_file); #endif return 0; @@ -272,6 +282,28 @@ static void __init lsm_set_size(int *need, int *lbs) 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_file_alloc - allocate a composite file blob + * @file: the file that needs a blob + * + * Allocate the file blob for all the modules + * + * Returns 0, or -ENOMEM if memory can't be allocated. + */ +int lsm_file_alloc(struct file *file) +{ + if (!lsm_file_cache) { + file->f_security = NULL; + return 0; + } + + file->f_security = kmem_cache_zalloc(lsm_file_cache, GFP_KERNEL); + if (file->f_security == NULL) + return -ENOMEM; + return 0; } /* @@ -957,12 +989,28 @@ int security_file_permission(struct file *file, int mask) int security_file_alloc(struct file *file) { - return call_int_hook(file_alloc_security, 0, file); + int rc = lsm_file_alloc(file); + + if (rc) + return rc; + rc = call_int_hook(file_alloc_security, 0, file); + if (unlikely(rc)) + security_file_free(file); + return rc; } void security_file_free(struct file *file) { + void *blob; + + if (!lsm_file_cache) + return; + call_void_hook(file_free_security, file); + + blob = file->f_security; + file->f_security = NULL; + kmem_cache_free(lsm_file_cache, blob); } int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) @@ -1080,7 +1128,7 @@ int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) return rc; rc = call_int_hook(cred_alloc_blank, 0, cred, gfp); - if (rc) + if (unlikely(rc)) security_cred_free(cred); return rc; } @@ -1101,7 +1149,7 @@ int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp) return rc; rc = call_int_hook(cred_prepare, 0, new, old, gfp); - if (rc) + if (unlikely(rc)) security_cred_free(new); return rc; } diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 1d0a4a9fa08b..334f47305551 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -149,7 +149,6 @@ static int __init checkreqprot_setup(char *str) __setup("checkreqprot=", checkreqprot_setup); static struct kmem_cache *sel_inode_cache; -static struct kmem_cache *file_security_cache; /** * selinux_secmark_enabled - Check to see if SECMARK is currently enabled @@ -382,27 +381,15 @@ static void inode_free_security(struct inode *inode) static int file_alloc_security(struct file *file) { - struct file_security_struct *fsec; + struct file_security_struct *fsec = selinux_file(file); u32 sid = current_sid(); - fsec = kmem_cache_zalloc(file_security_cache, GFP_KERNEL); - if (!fsec) - return -ENOMEM; - fsec->sid = sid; fsec->fown_sid = sid; - file->f_security = fsec; return 0; } -static void file_free_security(struct file *file) -{ - struct file_security_struct *fsec = selinux_file(file); - file->f_security = NULL; - kmem_cache_free(file_security_cache, fsec); -} - static int superblock_alloc_security(struct super_block *sb) { struct superblock_security_struct *sbsec; @@ -3546,11 +3533,6 @@ static int selinux_file_alloc_security(struct file *file) return file_alloc_security(file); } -static void selinux_file_free_security(struct file *file) -{ - file_free_security(file); -} - /* * Check whether a task has the ioctl permission and cmd * operation to an inode. @@ -6811,6 +6793,7 @@ static void selinux_bpf_prog_free(struct bpf_prog_aux *aux) struct lsm_blob_sizes selinux_blob_sizes = { .lbs_cred = sizeof(struct task_security_struct), + .lbs_file = sizeof(struct file_security_struct), }; static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { @@ -6881,7 +6864,6 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(file_permission, selinux_file_permission), LSM_HOOK_INIT(file_alloc_security, selinux_file_alloc_security), - LSM_HOOK_INIT(file_free_security, selinux_file_free_security), LSM_HOOK_INIT(file_ioctl, selinux_file_ioctl), LSM_HOOK_INIT(mmap_file, selinux_mmap_file), LSM_HOOK_INIT(mmap_addr, selinux_mmap_addr), @@ -7082,9 +7064,6 @@ static __init int selinux_init(void) sel_inode_cache = kmem_cache_create("selinux_inode_security", sizeof(struct inode_security_struct), 0, SLAB_PANIC, NULL); - file_security_cache = kmem_cache_create("selinux_file_security", - sizeof(struct file_security_struct), - 0, SLAB_PANIC, NULL); avc_init(); avtab_cache_init(); diff --git a/security/smack/smack.h b/security/smack/smack.h index 0c6dce446825..043525a52e94 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h @@ -362,6 +362,11 @@ static inline struct task_smack *smack_cred(const struct cred *cred) return cred->security; } +static inline struct smack_known **smack_file(const struct file *file) +{ + return file->f_security; +} + /* * Is the directory transmuting? */ diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index bcba72d760f4..da22e31312b9 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -1570,24 +1570,12 @@ static void smack_inode_getsecid(struct inode *inode, u32 *secid) */ static int smack_file_alloc_security(struct file *file) { - struct smack_known *skp = smk_of_current(); + struct smack_known **blob = smack_file(file); - file->f_security = skp; + *blob = smk_of_current(); return 0; } -/** - * smack_file_free_security - clear a file security blob - * @file: the object - * - * The security blob for a file is a pointer to the master - * label list, so no memory is freed. - */ -static void smack_file_free_security(struct file *file) -{ - file->f_security = NULL; -} - /** * smack_file_ioctl - Smack check on ioctls * @file: the object @@ -1812,7 +1800,9 @@ static int smack_mmap_file(struct file *file, */ static void smack_file_set_fowner(struct file *file) { - file->f_security = smk_of_current(); + struct smack_known **blob = smack_file(file); + + *blob = smk_of_current(); } /** @@ -1829,6 +1819,7 @@ static void smack_file_set_fowner(struct file *file) static int smack_file_send_sigiotask(struct task_struct *tsk, struct fown_struct *fown, int signum) { + struct smack_known **blob; struct smack_known *skp; struct smack_known *tkp = smk_of_task(smack_cred(tsk->cred)); struct file *file; @@ -1841,7 +1832,8 @@ static int smack_file_send_sigiotask(struct task_struct *tsk, file = container_of(fown, struct file, f_owner); /* we don't log here as rc can be overriden */ - skp = file->f_security; + blob = smack_file(file); + skp = *blob; rc = smk_access(skp, tkp, MAY_DELIVER, NULL); rc = smk_bu_note("sigiotask", skp, tkp, MAY_DELIVER, rc); if (rc != 0 && has_capability(tsk, CAP_MAC_OVERRIDE)) @@ -4596,6 +4588,7 @@ static int smack_dentry_create_files_as(struct dentry *dentry, int mode, struct lsm_blob_sizes smack_blob_sizes = { .lbs_cred = sizeof(struct task_smack), + .lbs_file = sizeof(struct smack_known *), }; static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { @@ -4633,7 +4626,6 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(inode_getsecid, smack_inode_getsecid), LSM_HOOK_INIT(file_alloc_security, smack_file_alloc_security), - LSM_HOOK_INIT(file_free_security, smack_file_free_security), LSM_HOOK_INIT(file_ioctl, smack_file_ioctl), LSM_HOOK_INIT(file_lock, smack_file_lock), LSM_HOOK_INIT(file_fcntl, smack_file_fcntl),