From patchwork Thu Oct 26 08:40:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jann Horn via Selinux X-Patchwork-Id: 10028013 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 A87EB60567 for ; Thu, 26 Oct 2017 11:59:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9998A28D22 for ; Thu, 26 Oct 2017 11:59:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E09028D79; Thu, 26 Oct 2017 11:59:38 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from uhil19pa12.eemsg.mail.mil (uhil19pa12.eemsg.mail.mil [214.24.21.85]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C06828D22 for ; Thu, 26 Oct 2017 11:59:36 +0000 (UTC) Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by uhil19pa12.eemsg.mail.mil with ESMTP; 26 Oct 2017 11:59:36 +0000 X-IronPort-AV: E=Sophos;i="5.43,434,1503360000"; d="scan'208";a="5155007" IronPort-PHdr: =?us-ascii?q?9a23=3AMXojuxYvgGhnzKf0riYT4IX/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZosW4YB7h7PlgxGXEQZ/co6odzbaO6+a7AydcuN6oizMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVr?= =?us-ascii?q?O+/7BpDdj9it1+C15pbffxhEiCCybL9uMBm6twvcutcZjYZtN6o61wfErGZPd+?= =?us-ascii?q?lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLe?= =?us-ascii?q?TQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgz?= =?us-ascii?q?ocOjUn7G/YlNB/jKNDoBKguRN/xZLUYJqIP/Z6Z6/RYM8WSXZEUstXWSNBGIe8?= =?us-ascii?q?ZJYRAeQHM+hTso3xq0IToReiAAWhAv7kxD1ViX/sxaA13OovHgPF0gwuGNwArm?= =?us-ascii?q?jbosjtNKoQTOy4wqnGzS/dYPNNwjr99JTEfwo9rfyWQb59c8zcwlQvGQPfiVWQ?= =?us-ascii?q?rJToMTSP2eQRr2ib7/RvVOyygGAmsQ5xuCKvydkwionVm4kV1FHE+j9ky4goO9?= =?us-ascii?q?K4TE97Ydi5EJpfqiqXMJB2Td0mQ2FpviY617IHtIWnfCkK1JsnxxnfZ+aBc4iT?= =?us-ascii?q?+B3vTumRITBmhH98fr+0mhW88VC4x+HhWcS530xGoypYntXWqHwA2ALf5tKaRv?= =?us-ascii?q?dl4EutxTKC2xrQ5+xEO0w4i7fXJp87zrIuipYfr0LOFTLslkrslq+ZbEAk9/Ct?= =?us-ascii?q?6+Tgf7rpuIeRN5RxigHiKqQundG/AfggPggOQWeb/eO82aX//ULjWrVKj+A2kr?= =?us-ascii?q?LDvJDGJcUUuq65AwhP3oYl9xm/FCup3M4dnXkGKFJJYBOHj473NFHSOP30EPiy?= =?us-ascii?q?jlu2nDpr2vzKJKPtD5rTInTZjbvtZbN95FRdyAo3w9Bf/ZVUCrQZLfLoREDxsN?= =?us-ascii?q?3YDhkkMw272uroE9J91p4YWW2THKCZK7jfsUOI5+0zI+mMY5UZuDDmK/c//fLu?= =?us-ascii?q?gng5mUEFcamzwZQXcGy4HuhhI0iBY3rshdEBHn0Wvgo+VuPqjkaPUTxUZ3a0Wq?= =?us-ascii?q?Iz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GZilUvsIZSzj90CR0ioYRIplBy+5Ubm3KVb?= =?us-ascii?q?v6J/L27dQEdNZSf2KXtuUq2uubqee8RP8o8nsT1LUOSgZlCXUrD8rAEe0yP/AW?= =?us-ascii?q?Re3is7eiq0uprnhRx1k3+dLHNpoHreY8Fwyg/V5MbASv5JwjoGWC54hCHLBleh?= =?us-ascii?q?Itap/M+bl5PYv++iUGKhU4FcfjPwzYOcrie743NlAQGnlfCphtLnCRQ60TP819?= =?us-ascii?q?RySyXIrQrzYpXs16SgK+5oYkloBFj668p1AYx+loowhJcK1ngAgZWZ530HkX38?= =?us-ascii?q?Md9Dw6LxcGINRSIXw97S+AXl3ExjLmmVx47gTXWS3M9hZ9i8YmML1SMw9NtKCL?= =?us-ascii?q?+V7LxCnCt6vkG4oRjXYfdjgjcX0eEu52ICg+EVpAotyT2QAqoVHUlcOSzjiQ6I?= =?us-ascii?q?4My5rKRZf2uvaqWw21Zlndy7C7GCuA5cUm7jepg+BS9w8tl/MFXU3X3w9I7kfs?= =?us-ascii?q?LQYMkQthKKlRfAlO5VJ4wtlvYQgipnI239t2U/y+EnlRxuwY26vI+fJmV15q25?= =?us-ascii?q?HxpYOSPtZ8wJ/DHtkbhRntyN0oCyBZVuBC8LXIDyQfKzFzISqO7nOBqQHz0yrX?= =?us-ascii?q?ebA7XfEhGF5EdgsX3PD4ihN2uLK3kB0dViWB6dKVRBgAASQTo3hYA5Fga3y8zh?= =?us-ascii?q?akt54C4e5kLgoBtW1u1oLwX/UnvYpAqwcjc7UoWfLB5N4w5e5kfVLcyf4vt9Hy?= =?us-ascii?q?5C+J2ttguNKnaUZw5QF2EGRlSEB0z/Prmp/dTA8OiZBu6gIPbVZLWOruJeV/mW?= =?us-ascii?q?ypKzzotm/zGMNsCRMXV4Cf00xFZDV2hjG8vFgzUPVzAXlyXVYs6Vvhi8/DF3rs?= =?us-ascii?q?e68PnwVgLg+5aAC7xIMdp14xC2m6CDN+yOiyllNTZUzJQMxWXHyLIHxl4dlzlu?= =?us-ascii?q?dyWxEbQHrSPNVrjcm6FNAx4ecSxzMMxI7qIn0wZXJcHbj8n51rlijv46E11FT0?= =?us-ascii?q?Dumtm1ZcwWJGGwLF3HBFyVO7ubPj3E2cf3Yb+7Sb1Ll+hbrQG/uTOBH0/kJDSD?= =?us-ascii?q?mCHjVwqzPuFUkCGbIBtetZm7chZ3E2fjVMrmZwa1MN92lz022qE0hn3LNW4aKz?= =?us-ascii?q?d8dV9CrryK4iNcmPl/HHZB7nV9J+mehymZ9/XYKooRsfZzGSt7jOVW4HA7y7tO?= =?us-ascii?q?8CFEX+Z5mDDModFyuV2mifeAyj5mUBpItzZKi5mGslliOKXD65lAQmzI/RwX4m?= =?us-ascii?q?WMEBQKoN1lBsfou6BKxdjFjLjzJyta89LI4cscANDZKMSGMHolNRrmBiXUARAf?= =?us-ascii?q?QjG1L2HfgFZRkPaI9n2atpI6sITjmIISSr9HU1w4DugVCkVqHNwFJpd6RS4rnq?= =?us-ascii?q?CAg84J/3W+qgPdRMJAvpDITviSG+ngKC6FjblYYBsF2an3LYsJOY3lxUNvcV56?= =?us-ascii?q?nJzUFErWWNBCuCxhbgsvr0VK/3lyVGoz21jqagm1+n8cCea0ngIqigt5eekt6D?= =?us-ascii?q?Ds41ItKlrQoysxkVc+mdP+jjCLdz7+MqSwUJpKBCrzskg+Lon0Qx1pbQGom0xr?= =?us-ascii?q?KivETapLj7R8bWBrlBPcuZxXFP5aU6JLehsQyOqUZ/UvylRctj+oxUlc5evGCJ?= =?us-ascii?q?tujg0qfoCwr3hYwQJscMY1JbDMJKpO1lVQnLyBvjS22e8r2g8RO0YN/XiJdy4J?= =?us-ascii?q?okwHK74mJySw/ux29wODmyFPeG4SWPo2uvhq7F8yO/yczyL81L5OMl2+OPaBL6?= =?us-ascii?q?OYpmfAjtWFTUkq1kMSkElE86N23tk/fEqJTUAvzaeRFhQTOcrENw5Vc9JY9GLP?= =?us-ascii?q?ciaWreXN3ZV1Mp25FuDvV++BqqAUg0OjH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/4mtC2SEZzACX/?= =?us-ascii?q?ecfUdgchueeNyecM5v9xN03gaoMBJRIE0b3642JPTgRyUL72okqZXeUJadtkT/?= =?us-ascii?q?PErnZV5Zh8JK8POFiduYHlrzZJqFAwGw8pa74woydEdknPgg1aQaL0t6MBigcG?= =?us-ascii?q?V952p1NME3qqOG0i/zrHSbhVjK6JBfwU7DWcVKoOXl5sMiNjXhy12ZJue6Czkf?= =?us-ascii?q?BAqGNGkTt3oOI23Dx+WBu8pSrsqroP2T0+9rG4ujEBtGdLT+qElSfHF0lDwO4M?= =?us-ascii?q?jagCF3bo8Ua8b2UbbIvu/LlnItzt9YYl43Q4bxQsYSkGXeC7BiHriKOIBI2Pv8?= =?us-ascii?q?5GiB6LpsrOcae5LTIOObQl1RLjW3993xDcnBZo8GoLWjKg7NslJIWhJ8ko3S+o?= =?us-ascii?q?GWnHdFYW/KxFqszxtUQETOEuc1Nu3H1j0tSbRi0KXMHPB2c1jg0/ZGVYcZJM9R?= =?us-ascii?q?waGLcsgjqSuKlJ4B0Uai/OEou54onQgdvI2X4lQNdvx2LWpa6FhpQx3X1ngdx0?= =?us-ascii?q?7SmOuHIMeOzeScNsBGb81ptHw+zke/qtqvwHSJdhyLm5S/ANLM+j+Xet1ZVxXk?= =?us-ascii?q?+lwageH0anMOAd27jXSSClSXeXWe6TaWiDgy45MlLu5RmvNlA3ZtlFr0s8Muva?= =?us-ascii?q?mJFRjAzgUbJxRiWVu1Db1mgjPv0AewIxooendBQATPQNaOiEOegu3Po+BUMCbn?= =?us-ascii?q?/RByt2CvO5vkC2kYh+OnVg/V/6bvr3/gDhKtuSFQEOEZTGoZ5p5fy6WmWBNGdn?= =?us-ascii?q?zB12IkZ57P/fF1Arue9Hb5aRnMTfh8hh0eEbafhhKys9tcAPmoh784mbzN+KcQ?= =?us-ascii?q?3Nzpb1PdzVpvmYA/vCz0UlY21aVrsZYRjp54UhJdM5WqfcHb1evRgGAqg6WpMh?= =?us-ascii?q?PX/r9K5oNANzbh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B?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 26 Oct 2017 11:59: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 v9QBxUAY031930; Thu, 26 Oct 2017 07:59:30 -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 v9Q8f53O033498 for ; Thu, 26 Oct 2017 04:41:05 -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 v9Q8f5ex005977 for ; Thu, 26 Oct 2017 04:41:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1D0AAADn/FZf3QYGNZbHAEBBAEBCgEBg?= =?us-ascii?q?1yBVSeDeoofjwtDAQEGgiuHUoUyiECBMgN5hSQChHo/GAECAQEBAQEBARMBAQs?= =?us-ascii?q?WhXsGIwQZAQE3AQ8lAiYCAiETAQUBHBmKCAMIDQOcT0CLIWuBbTqDCAEBBYQnD?= =?us-ascii?q?YEfghABCx4IEn2CH4IHgQmCMIJ1gxOFO4JhAYExAQGROY5VMggBAYVyig6EbA2?= =?us-ascii?q?CFYNejTeKKYJqiGE4gRUfgQeBGTQhJV6BEYFTgk0PHBmBblcBiSosghYBAQE?= X-IPAS-Result: =?us-ascii?q?A1D0AAADn/FZf3QYGNZbHAEBBAEBCgEBg1yBVSeDeoofjwt?= =?us-ascii?q?DAQEGgiuHUoUyiECBMgN5hSQChHo/GAECAQEBAQEBARMBAQsWhXsGIwQZAQE3A?= =?us-ascii?q?Q8lAiYCAiETAQUBHBmKCAMIDQOcT0CLIWuBbTqDCAEBBYQnDYEfghABCx4IEn2?= =?us-ascii?q?CH4IHgQmCMIJ1gxOFO4JhAYExAQGROY5VMggBAYVyig6EbA2CFYNejTeKKYJqi?= =?us-ascii?q?GE4gRUfgQeBGTQhJV6BEYFTgk0PHBmBblcBiSosghYBAQE?= X-IronPort-AV: E=Sophos;i="5.43,434,1503374400"; d="scan'208";a="96998" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.34]) by goalie.tycho.ncsc.mil with ESMTP; 26 Oct 2017 04:41:05 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AKvrU2xeQlzJhhtXoZCHZ9KbTlGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxcW4ZB7h7PlgxGXEQZ/co6odzbaO6+a7AydYuN6oizMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVr?= =?us-ascii?q?O+/7BpDdj9it1+C15pbffxhEiCCybL9uMBm6twvcutcZjYd+N6o61wfErGZPd+?= =?us-ascii?q?lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLe?= =?us-ascii?q?TQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgz?= =?us-ascii?q?ocOjUn7G/YlNB/jKNDoBKguRN/xZLUYJqIP/Z6Z6/RYM8WSXZEUstXSidPAJ6z?= =?us-ascii?q?b5EXAuQcMulWoYvyqVgArRW5BQeiGv/gxyRUhnPqx6A2z/4sHR3E0QEmAtkAsG?= =?us-ascii?q?7UrNLwNKoKVu661rXIzSnDb/xI1zb29YnGfQo7ofGWQ71wbdbRwlQoGgPAjFWQ?= =?us-ascii?q?pozoMjeO2+QCtGib6OVgVeaxhGI9tw5xpT2vy94qh4LUhYwV0kjJ+TtkzIs6P9?= =?us-ascii?q?G0VkF2bcS6HJZfrS2WKpZ6T8I6T212pCo3zqcKtJ27cSQQ1pgr2h/SZ+aZf4SU?= =?us-ascii?q?/B7uUvuaLy1ii3J/Yr2/gg6/8Ui+xe34Ucm5yEtKoTZCktnIq3wA0wTT5dKaRv?= =?us-ascii?q?Zy5EuuxyiA1wXI6uFLO0w0kLDUK58lwrIqk5oTsEDDEjf3mEXwkqCWal0p9va1?= =?us-ascii?q?5+noeLnquJCRO5VqhgzxKKgih9GzDOUgPggLRWeb+OC81LP5/U3+RbVHlvM7kq?= =?us-ascii?q?/av5/CKsUUprW3DAFQ3Is+5Ru/ADam0NoEknUaLF9KZBGHj4v1NFHOOv/0F/Ww?= =?us-ascii?q?g1etkDds3f/GPqPuApfULnjfiLfhYLRy5FNfyAYpz9Bf4JJbBqsdL/LwQE/8r9?= =?us-ascii?q?LYDhsnPA272urrEdB92ZkCWWKTAq+WLq3TsVCS6eI1OemDepMVuCrnJ/c+4P7u?= =?us-ascii?q?kHk5lkMDcqmyx5cXZ3e4HvNpI0Wdf3XgmMsOEWAPvgYmVuzllEWCUSJPZ3a1R6?= =?us-ascii?q?88/S80CIanDYfFW4Csj6eM3Du7H5JKZmBGDUqAEXHzd4qeQfsMZyWSItEy2gAD?= =?us-ascii?q?ALygTZIxkBCoqAL10bt7P8LK9SAC85Huzt5446vUjx5h2yZzCpG42n2RT2xr1k?= =?us-ascii?q?wBXSU7wLw39Ul/xQrS+ad/hPNcGJpY4PYfAVRyDoLV0+EvU4O6YQnGZNrcDQ/+?= =?us-ascii?q?Gtg=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DAAAADn/FZf3QYGNZbHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgzGBVSeDeoofjwtDAQEGgiuHUoUyiECBMgN5hSQChHo/GAEBAQE?= =?us-ascii?q?BAQEBAQEBEgEBCxZdgjgkAYJBBiMEGQEBNwEPJQImAgIhEwEFARwZiggDCA0Dn?= =?us-ascii?q?E9AiyFrgW06gwgBAQWEJw2BH4IQAQseCBJ9gh+CB4EJgjCCdYMThTuCYYEyAQG?= =?us-ascii?q?ROY5VMggBAYVyig6EbA2CFYNejTeKKYJqiGE4gRUfgQeBGTQhJV6BEYFTgk0PH?= =?us-ascii?q?BmBblcBiSosghYBAQE?= X-IPAS-Result: =?us-ascii?q?A0DAAAADn/FZf3QYGNZbHAEBBAEBCgEBFwEBBAEBCgEBgzG?= =?us-ascii?q?BVSeDeoofjwtDAQEGgiuHUoUyiECBMgN5hSQChHo/GAEBAQEBAQEBAQEBEgEBC?= =?us-ascii?q?xZdgjgkAYJBBiMEGQEBNwEPJQImAgIhEwEFARwZiggDCA0DnE9AiyFrgW06gwg?= =?us-ascii?q?BAQWEJw2BH4IQAQseCBJ9gh+CB4EJgjCCdYMThTuCYYEyAQGROY5VMggBAYVyi?= =?us-ascii?q?g6EbA2CFYNejTeKKYJqiGE4gRUfgQeBGTQhJV6BEYFTgk0PHBmBblcBiSosghY?= =?us-ascii?q?BAQE?= X-IronPort-AV: E=Sophos;i="5.43,434,1503360000"; d="scan'208";a="5150528" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from ucol19pa14.eemsg.mail.mil ([214.24.24.116]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 26 Oct 2017 08:41:03 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;0994af0a-8600-4d5b-ae0e-7a67f2aaff90 X-EEMSG-check-008: 106994648|UCOL3CPA06_EEMSG_MP21.csd.disa.mil X-EEMSG-SBRS: 3.4 X-EEMSG-ORIG-IP: 209.85.216.202 X-EEMSG-check-002: true X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BJAAADn/FZhsrYVdFbHAEBBAEBCgEBhTEng3qKH48LQwEBBoIrh1KFMohAgTIDeYUkAoR6PxgBAgEBAQEBAQETAQEBCgkLCCgvhR4GIwQZAQE3AQ8lAiYCAiETAQUBHBmKCAMIDZxSQIsha4FtOoMIAQEFhCcNgR+CECoIEn2CH4IHgQmCMIJ1gxOFO4JhgTIBAZE5jlUyCAEBhXKKDoRsDYIVg16NN4opgmqIYTiBFR+BB4EZNCElXoERgVOCTQ8cggchNgGJKiyCFgEBAQ X-IPAS-Result: A0BJAAADn/FZhsrYVdFbHAEBBAEBCgEBhTEng3qKH48LQwEBBoIrh1KFMohAgTIDeYUkAoR6PxgBAgEBAQEBAQETAQEBCgkLCCgvhR4GIwQZAQE3AQ8lAiYCAiETAQUBHBmKCAMIDZxSQIsha4FtOoMIAQEFhCcNgR+CECoIEn2CH4IHgQmCMIJ1gxOFO4JhgTIBAZE5jlUyCAEBhXKKDoRsDYIVg16NN4opgmqIYTiBFR+BB4EZNCElXoERgVOCTQ8cggchNgGJKiyCFgEBAQ Received: from mail-qt0-f202.google.com ([209.85.216.202]) by UCOL3CPA06.eemsg.mail.mil with ESMTP; 26 Oct 2017 08:41:03 +0000 Received: by mail-qt0-f202.google.com with SMTP id 8so1847401qtv.11 for ; Thu, 26 Oct 2017 01:41:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=HS3jrDTDvex2Bw091VJSVNagutbdLm4F57dl1FReNMI=; b=ifF/w5RhW+1uUR6AvOPsSjdc+ntImSLUPUVRcCRS9LsHsBzgzGJEuTNfC2OaaXjZ+B t3nIKLgB51/vJNYcCCcHbD2gkd/DYF6mzu+XVTDhtey+/5KE5A/bhOYdUPbCOz1SSMAw qvZItQm8SGIThozEJeuZ5eqU7481Dm2CJWKNC3ydJ4pfrhUxR18PMbkpqD59JLjj5UWp cgDt3dwzvaS83ahAL5WAVIP3tj4A+Fk8YeQ1bXk+NDXwJjWu7UZBXuvFqhgwMSEUdiL0 FP76EnN2LRyuVQWJtrR7P0LVcT4INIl4Q7EVt/N2jg9TEz2O0jCqxVyWznR4oJ6nSgUD haRA== X-Gm-Message-State: AMCzsaVR428ZgmBpa5sM980cTUCttuc1rDkvc4WtgqhsiUcdQuMRsVPC TjzvD9VyOxZ6FoEn98zLSox6VqqgK+oWEouJ7WTbJg== X-Google-Smtp-Source: ABhQp+QFBSqnAbnLi5b5QuXuSuVEeap9bMXZ7ZoUt1zgova1VBg0/50i6+4+efSVBmBYcjtYUzaMf9/KlZfHYbwR0Oeiiw== MIME-Version: 1.0 X-Received: by 10.55.163.197 with SMTP id m188mr3852395qke.9.1509007261420; Thu, 26 Oct 2017 01:41:01 -0700 (PDT) Date: Thu, 26 Oct 2017 01:40:55 -0700 In-Reply-To: <20171026084055.25482-1-mjg59@google.com> Message-Id: <20171026084055.25482-2-mjg59@google.com> References: <20171026084055.25482-1-mjg59@google.com> X-Mailer: git-send-email 2.15.0.rc2.357.g7e34df9404-goog X-EEMSG-check-009: 444-444 To: linux-integrity@vger.kernel.org X-Mailman-Approved-At: Thu, 26 Oct 2017 07:57:03 -0400 Subject: [PATCH V3 2/2] IMA: Support using new creds in appraisal policy 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: From: Matthew Garrett via Selinux Reply-To: Matthew Garrett Cc: Matthew Garrett , linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, Dmitry Kasatkin , Stephen Smalley Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP The existing BPRM_CHECK functionality in IMA validates against the credentials of the existing process, not any new credentials that the child process may transition to. Add an additional CREDS_CHECK target and refactor IMA to pass the appropriate creds structure. In ima_bprm_check(), check with both the existing process credentials and the credentials that will be committed when the new process is started. This will not change behaviour unless the system policy is extended to include CREDS_CHECK targets - BPRM_CHECK will continue to check the same credentials that it did previously. Signed-off-by: Matthew Garrett Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Cc: selinux@tycho.nsa.gov Cc: Casey Schaufler Cc: linux-security-module@vger.kernel.org Cc: Mimi Zohar Cc: Dmitry Kasatkin Cc: linux-integrity@vger.kernel.org Reviewed-by: James Morris --- V3: Update description to make it clear that this doesn't alter the behaviour of existing policies Documentation/ABI/testing/ima_policy | 2 +- security/integrity/iint.c | 1 + security/integrity/ima/ima.h | 7 ++++--- security/integrity/ima/ima_api.c | 8 +++++--- security/integrity/ima/ima_appraise.c | 10 +++++++++- security/integrity/ima/ima_main.c | 26 +++++++++++++++++--------- security/integrity/ima/ima_policy.c | 19 ++++++++++++------- security/integrity/integrity.h | 9 +++++++-- 8 files changed, 56 insertions(+), 26 deletions(-) diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/ABI/testing/ima_policy index e76432b9954d..5dc9eed035fb 100644 --- a/Documentation/ABI/testing/ima_policy +++ b/Documentation/ABI/testing/ima_policy @@ -25,7 +25,7 @@ Description: [obj_user=] [obj_role=] [obj_type=]] option: [[appraise_type=]] [permit_directio] - base: func:= [BPRM_CHECK][MMAP_CHECK][FILE_CHECK][MODULE_CHECK] + base: func:= [BPRM_CHECK][MMAP_CHECK][CREDS_CHECK][FILE_CHECK][MODULE_CHECK] [FIRMWARE_CHECK] [KEXEC_KERNEL_CHECK] [KEXEC_INITRAMFS_CHECK] mask:= [[^]MAY_READ] [[^]MAY_WRITE] [[^]MAY_APPEND] diff --git a/security/integrity/iint.c b/security/integrity/iint.c index 6fc888ca468e..ad30094a58b4 100644 --- a/security/integrity/iint.c +++ b/security/integrity/iint.c @@ -78,6 +78,7 @@ static void iint_free(struct integrity_iint_cache *iint) iint->ima_mmap_status = INTEGRITY_UNKNOWN; iint->ima_bprm_status = INTEGRITY_UNKNOWN; iint->ima_read_status = INTEGRITY_UNKNOWN; + iint->ima_creds_status = INTEGRITY_UNKNOWN; iint->evm_status = INTEGRITY_UNKNOWN; iint->measured_pcrs = 0; kmem_cache_free(iint_cache, iint); diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h index d52b487ad259..0703a96072b5 100644 --- a/security/integrity/ima/ima.h +++ b/security/integrity/ima/ima.h @@ -177,6 +177,7 @@ static inline unsigned long ima_hash_key(u8 *digest) hook(FILE_CHECK) \ hook(MMAP_CHECK) \ hook(BPRM_CHECK) \ + hook(CREDS_CHECK) \ hook(POST_SETATTR) \ hook(MODULE_CHECK) \ hook(FIRMWARE_CHECK) \ @@ -191,7 +192,7 @@ enum ima_hooks { }; /* LIM API function definitions */ -int ima_get_action(struct inode *inode, int mask, +int ima_get_action(struct inode *inode, const struct cred *cred, int mask, enum ima_hooks func, int *pcr); int ima_must_measure(struct inode *inode, int mask, enum ima_hooks func); int ima_collect_measurement(struct integrity_iint_cache *iint, @@ -212,8 +213,8 @@ void ima_free_template_entry(struct ima_template_entry *entry); const char *ima_d_path(const struct path *path, char **pathbuf, char *filename); /* IMA policy related functions */ -int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask, - int flags, int *pcr); +int ima_match_policy(struct inode *inode, const struct cred *cred, + enum ima_hooks func, int mask, int flags, int *pcr); void ima_init_policy(void); void ima_update_policy(void); void ima_update_policy_flag(void); diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c index c2edba8de35e..ff33b7e65a07 100644 --- a/security/integrity/ima/ima_api.c +++ b/security/integrity/ima/ima_api.c @@ -157,6 +157,7 @@ void ima_add_violation(struct file *file, const unsigned char *filename, /** * ima_get_action - appraise & measure decision based on policy. * @inode: pointer to inode to measure + * @cred: pointer to credentials structure to validate * @mask: contains the permission mask (MAY_READ, MAY_WRITE, MAY_EXEC, * MAY_APPEND) * @func: caller identifier @@ -165,20 +166,21 @@ void ima_add_violation(struct file *file, const unsigned char *filename, * The policy is defined in terms of keypairs: * subj=, obj=, type=, func=, mask=, fsmagic= * subj,obj, and type: are LSM specific. - * func: FILE_CHECK | BPRM_CHECK | MMAP_CHECK | MODULE_CHECK + * func: FILE_CHECK | BPRM_CHECK | CREDS_CHECK | MMAP_CHECK | MODULE_CHECK * mask: contains the permission mask * fsmagic: hex value * * Returns IMA_MEASURE, IMA_APPRAISE mask. * */ -int ima_get_action(struct inode *inode, int mask, enum ima_hooks func, int *pcr) +int ima_get_action(struct inode *inode, const struct cred *cred, int mask, + enum ima_hooks func, int *pcr) { int flags = IMA_MEASURE | IMA_AUDIT | IMA_APPRAISE; flags &= ima_policy_flag; - return ima_match_policy(inode, func, mask, flags, pcr); + return ima_match_policy(inode, cred, func, mask, flags, pcr); } /* diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index 809ba70fbbbf..137b8d1708c6 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c @@ -53,7 +53,8 @@ int ima_must_appraise(struct inode *inode, int mask, enum ima_hooks func) if (!ima_appraise) return 0; - return ima_match_policy(inode, func, mask, IMA_APPRAISE, NULL); + return ima_match_policy(inode, current_cred(), func, mask, + IMA_APPRAISE, NULL); } static int ima_fix_xattr(struct dentry *dentry, @@ -86,6 +87,8 @@ enum integrity_status ima_get_cache_status(struct integrity_iint_cache *iint, return iint->ima_mmap_status; case BPRM_CHECK: return iint->ima_bprm_status; + case CREDS_CHECK: + return iint->ima_creds_status; case FILE_CHECK: case POST_SETATTR: return iint->ima_file_status; @@ -106,6 +109,8 @@ static void ima_set_cache_status(struct integrity_iint_cache *iint, case BPRM_CHECK: iint->ima_bprm_status = status; break; + case CREDS_CHECK: + iint->ima_creds_status = status; case FILE_CHECK: case POST_SETATTR: iint->ima_file_status = status; @@ -127,6 +132,9 @@ static void ima_cache_flags(struct integrity_iint_cache *iint, case BPRM_CHECK: iint->flags |= (IMA_BPRM_APPRAISED | IMA_APPRAISED); break; + case CREDS_CHECK: + iint->flags |= (IMA_CREDS_APPRAISED | IMA_APPRAISED); + break; case FILE_CHECK: case POST_SETATTR: iint->flags |= (IMA_FILE_APPRAISED | IMA_APPRAISED); diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 2aebb7984437..f41aa427792b 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -155,8 +155,9 @@ void ima_file_free(struct file *file) ima_check_last_writer(iint, inode, file); } -static int process_measurement(struct file *file, char *buf, loff_t size, - int mask, enum ima_hooks func, int opened) +static int process_measurement(struct file *file, const struct cred *cred, + char *buf, loff_t size, int mask, + enum ima_hooks func, int opened) { struct inode *inode = file_inode(file); struct integrity_iint_cache *iint = NULL; @@ -178,7 +179,7 @@ static int process_measurement(struct file *file, char *buf, loff_t size, * bitmask based on the appraise/audit/measurement policy. * Included is the appraise submask. */ - action = ima_get_action(inode, mask, func, &pcr); + action = ima_get_action(inode, cred, mask, func, &pcr); violation_check = ((func == FILE_CHECK || func == MMAP_CHECK) && (ima_policy_flag & IMA_MEASURE)); if (!action && !violation_check) @@ -282,8 +283,8 @@ static int process_measurement(struct file *file, char *buf, loff_t size, int ima_file_mmap(struct file *file, unsigned long prot) { if (file && (prot & PROT_EXEC)) - return process_measurement(file, NULL, 0, MAY_EXEC, - MMAP_CHECK, 0); + return process_measurement(file, current_cred(), NULL, 0, + MAY_EXEC, MMAP_CHECK, 0); return 0; } @@ -302,8 +303,14 @@ int ima_file_mmap(struct file *file, unsigned long prot) */ int ima_bprm_check(struct linux_binprm *bprm) { - return process_measurement(bprm->file, NULL, 0, MAY_EXEC, - BPRM_CHECK, 0); + int ret; + + ret = process_measurement(bprm->file, current_cred(), NULL, 0, + MAY_EXEC, BPRM_CHECK, 0); + if (ret) + return ret; + return process_measurement(bprm->file, bprm->cred, NULL, 0, + MAY_EXEC, CREDS_CHECK, 0); } /** @@ -318,7 +325,7 @@ int ima_bprm_check(struct linux_binprm *bprm) */ int ima_file_check(struct file *file, int mask, int opened) { - return process_measurement(file, NULL, 0, + return process_measurement(file, current_cred(), NULL, 0, mask & (MAY_READ | MAY_WRITE | MAY_EXEC | MAY_APPEND), FILE_CHECK, opened); } @@ -413,7 +420,8 @@ int ima_post_read_file(struct file *file, void *buf, loff_t size, } func = read_idmap[read_id] ?: FILE_CHECK; - return process_measurement(file, buf, size, MAY_READ, func, 0); + return process_measurement(file, current_cred(), buf, size, MAY_READ, + func, 0); } static int __init init_ima(void) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 95209a5f8595..c9d5735711eb 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -247,10 +247,9 @@ static void ima_lsm_update_rules(void) * Returns true on rule match, false on failure. */ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, - enum ima_hooks func, int mask) + const struct cred *cred, enum ima_hooks func, + int mask) { - struct task_struct *tsk = current; - const struct cred *cred = current_cred(); int i; if ((rule->flags & IMA_FUNC) && @@ -305,7 +304,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, case LSM_SUBJ_USER: case LSM_SUBJ_ROLE: case LSM_SUBJ_TYPE: - security_task_getsecid(tsk, &sid); + security_cred_getsecid(cred, &sid); rc = security_filter_rule_match(sid, rule->lsm[i].type, Audit_equal, @@ -339,6 +338,8 @@ static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func) return IMA_MMAP_APPRAISE; case BPRM_CHECK: return IMA_BPRM_APPRAISE; + case CREDS_CHECK: + return IMA_CREDS_APPRAISE; case FILE_CHECK: case POST_SETATTR: return IMA_FILE_APPRAISE; @@ -351,6 +352,8 @@ static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func) /** * ima_match_policy - decision based on LSM and other conditions * @inode: pointer to an inode for which the policy decision is being made + * @cred: pointer to a credentials structure for which the policy decision is + * being made * @func: IMA hook identifier * @mask: requested action (MAY_READ | MAY_WRITE | MAY_APPEND | MAY_EXEC) * @pcr: set the pcr to extend @@ -362,8 +365,8 @@ static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func) * list when walking it. Reads are many orders of magnitude more numerous * than writes so ima_match_policy() is classical RCU candidate. */ -int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask, - int flags, int *pcr) +int ima_match_policy(struct inode *inode, const struct cred *cred, + enum ima_hooks func, int mask, int flags, int *pcr) { struct ima_rule_entry *entry; int action = 0, actmask = flags | (flags << 1); @@ -374,7 +377,7 @@ int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask, if (!(entry->action & actmask)) continue; - if (!ima_match_rules(entry, inode, func, mask)) + if (!ima_match_rules(entry, inode, cred, func, mask)) continue; action |= entry->flags & IMA_ACTION_FLAGS; @@ -691,6 +694,8 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) entry->func = MMAP_CHECK; else if (strcmp(args[0].from, "BPRM_CHECK") == 0) entry->func = BPRM_CHECK; + else if (strcmp(args[0].from, "CREDS_CHECK") == 0) + entry->func = CREDS_CHECK; else if (strcmp(args[0].from, "KEXEC_KERNEL_CHECK") == 0) entry->func = KEXEC_KERNEL_CHECK; diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h index a53e7e4ab06c..45ba0e4501d6 100644 --- a/security/integrity/integrity.h +++ b/security/integrity/integrity.h @@ -48,10 +48,14 @@ #define IMA_BPRM_APPRAISED 0x00002000 #define IMA_READ_APPRAISE 0x00004000 #define IMA_READ_APPRAISED 0x00008000 +#define IMA_CREDS_APPRAISE 0x00010000 +#define IMA_CREDS_APPRAISED 0x00020000 #define IMA_APPRAISE_SUBMASK (IMA_FILE_APPRAISE | IMA_MMAP_APPRAISE | \ - IMA_BPRM_APPRAISE | IMA_READ_APPRAISE) + IMA_BPRM_APPRAISE | IMA_READ_APPRAISE | \ + IMA_CREDS_APPRAISE) #define IMA_APPRAISED_SUBMASK (IMA_FILE_APPRAISED | IMA_MMAP_APPRAISED | \ - IMA_BPRM_APPRAISED | IMA_READ_APPRAISED) + IMA_BPRM_APPRAISED | IMA_READ_APPRAISED | \ + IMA_CREDS_APPRAISED) enum evm_ima_xattr_type { IMA_XATTR_DIGEST = 0x01, @@ -108,6 +112,7 @@ struct integrity_iint_cache { enum integrity_status ima_mmap_status:4; enum integrity_status ima_bprm_status:4; enum integrity_status ima_read_status:4; + enum integrity_status ima_creds_status:4; enum integrity_status evm_status:4; struct ima_digest_data *ima_hash; };