From patchwork Mon Jul 2 03:01:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Moore X-Patchwork-Id: 10500371 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 0899760532 for ; Mon, 2 Jul 2018 03:02:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E73E328779 for ; Mon, 2 Jul 2018 03:02:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D84F4287B6; Mon, 2 Jul 2018 03:02:16 +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 upbd19pa10.eemsg.mail.mil (upbd19pa10.eemsg.mail.mil [214.24.27.85]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B7F528779 for ; Mon, 2 Jul 2018 03:02:13 +0000 (UTC) Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by upbd19pa10.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 02 Jul 2018 03:02:10 +0000 X-IronPort-AV: E=Sophos;i="5.51,297,1526342400"; d="scan'208";a="13390958" IronPort-PHdr: =?us-ascii?q?9a23=3A8dgDvRNPfEqBjdT1W2Il6mtUPXoX/o7sNwtQ0K?= =?us-ascii?q?IMzox0L/j+o8bcNUDSrc9gkEXOFd2Cra4c1ayO6+jJYi8p2d65qncMcZhBBV?= =?us-ascii?q?cuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx?= =?us-ascii?q?7xKRR6JvjvGo7Vks+7y/2+94fcbglUhTexe69+IAmrpgjNq8cahpdvJLwswR?= =?us-ascii?q?XTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3?= =?us-ascii?q?sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Qi?= =?us-ascii?q?qp4bt1RxD0iScHLz85/3/Risxsl6JQvRatqwViz4LIfI2ZMfxzca3HfdMeWG?= =?us-ascii?q?FPQMBfWSJcCY+4docDEvYNMeNeooLgpVUBsAG+CBGsCu3xxDFGhXH50qIn3e?= =?us-ascii?q?Q5EwzKwQItEM4BvnvKt9X4L7sSXOKvwaXU0TnOde1a1DHg44bIaBAhpvSMUK?= =?us-ascii?q?pqf8XL1EkvEx7OgFKXqYziJTOayPkGvm+D7+plUuKvjHQnpB9qrzi12Mgjl4?= =?us-ascii?q?nJiZgJylze6Sp5x4M1KMS+RUVmYtCkCINduzyVOoZ5WM8vQ3xktDwkxrAJp5?= =?us-ascii?q?K3ZjUGxIwmyhPecfCLbouF7xD5WOqPLzp1imhpdbCxihu07EOu0PfzVtOu31?= =?us-ascii?q?ZPtidFl97MuW0T2BHL8ciHT+d9/l+m2TaSywDf8uFELl4wlarcM5Mh3qQ/lo?= =?us-ascii?q?ASsUTeBS/6gkT2jKmYdkUj4ein9fjobq/6pp6cK4B0igb+Pr4omsOjGuQ3Lh?= =?us-ascii?q?ICX22a+eS4zLHj/Ev5T6tWjvAuj6XUv5/XKd4bq6KkGQNZzIku5wilAzu7yN?= =?us-ascii?q?gYmGMILFNBeBKJlYjpPFTOLejjDfihh1SskTFrx+3JP7H4GZrNKWXDkLH9cr?= =?us-ascii?q?lj8E5R0xYzzNBD6JJUDbENOvTzWlTru9DCAR85NBK0z/79CNphzoMeRX6PAq?= =?us-ascii?q?iBPaPQtl+I4PggI/WMZIAPvjbwMPol5/nojX88g1AdZrWp0oUNaHCjBPhmJF?= =?us-ascii?q?+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00QXoGComT?= =?us-ascii?q?CiwzxyjT4psrKV3DbSzOT6aBoHJmlLSXF4jVfrJYi0i84VXFK0YAgumhqo/l?= =?us-ascii?q?36x7VHq6RkNWXTRl1IfyfuJWF4TqSwrqaCY9JI6J4wsiVYTuK8YUuBR77+vR?= =?us-ascii?q?Qa1TjjH21AyzAnbT2qvY/5nxNigmKHMHlztGbZed13xRrH/NzTX+NR3j4YSy?= =?us-ascii?q?lgkzbXAES8MMez/diPipfDqf6xV3i6VpFJainryp6AtDGn6mJ0Dx2/mOqzmt?= =?us-ascii?q?L5HgQg1y/0ycVqXz3SrBngeonry7i6MeV/c0l2Al/z9tF3Gp94koQthJEcw3?= =?us-ascii?q?4aiYuJ/XAfi2f8Lc1b2b7ibHoKXTML28Ta4BXh2EB4Mn2Jxp75V3WEzstvfd?= =?us-ascii?q?a6ZHka2iUn78BFEK2U9qBLnTNpolqkqgLcefZ9kS0byfsy734ahvoEuAQzwS?= =?us-ascii?q?qABbASB1NXPTT2lxSP7dCxsrlYZHq1fbi3zkp+ksirDKuerQFERHb5ZpAiED?= =?us-ascii?q?d17splNFLM1GP86p34eNbKd90erRuUnAncj+hONJ0+jOIKijR9NWL7o3Il1/?= =?us-ascii?q?YxjQZy0pGioIiHN2Jt8bq3Ah5CKDL6etgT9SvrjaZCmcaWxJuiEY99FTUORp?= =?us-ascii?q?foSuioED0Kv/T9KwmOCCE8qmucGbfHBQ+Q9lxpoGzJE5CqK3GXI2IUzdR8Sx?= =?us-ascii?q?aDOkNTmgcUXC81npQhDACl2NThcFtl5jAW/lP3sQBDxuVsNxn+SWffuByoZi?= =?us-ascii?q?0vSJeBMBVa9BpC6FnRMcyf6OJzAi5Z84a9ow2NMGybeh9IAXsHW0OeG1DjJb?= =?us-ascii?q?6u5d/a/+ifHOq+IOPEYa+SpuxGS/eI2ZWv35N98DaNOcWPOX9iAuYm1UVdRn?= =?us-ascii?q?95Gt7WmzMVRywQjSLNYNaRpA2g9S1vssC/7PPrVRr16ouAEbRSL8tg9guxga?= =?us-ascii?q?ebKeGQgiN5JixZ1pMI3nDIz7ce0EQViyF0eDmnCa4AujLVTKLMhq9XCAYWaz?= =?us-ascii?q?90NMtN9a48xA5NOM/FhdPzzbF4lPk1BElGVVH6hs6pYskKLH2nO1PcGEaHLr?= =?us-ascii?q?KGKiPXw8vve6OzVaVQjPlItx23oTubEU/jPzSblznuUxCvMP1Mgz+AMRxbuY?= =?us-ascii?q?G9bgxtBnb5QNLhcB27P8d9jScqzr0smnPKKWkcPCB/c0JNqr2f8zhVgvB4G2?= =?us-ascii?q?xP4HpqM/WEmzqZ7+nfL5YZr+FnAiJqmOJG+H460ada7DlYRPxpnyvftsBho0?= =?us-ascii?q?m8nemVyzpnSwFDqi5Ri4KRvEViIr3Z9p1aVnnY4h0B92KQCw4Fp9F9EN3gp7?= =?us-ascii?q?hQysTTlKL0MDpC9czb8tEYB8XPK8KHN2EhMQbzFz7SFwsFTj+rOXvZh0NDjP?= =?us-ascii?q?GY7meVoYQiqpjwhJoOTadWVEYrGfMBFEtqBsYCL4t3Xj4/irGbjdQI6me5rB?= =?us-ascii?q?nfXMVapI7IV/KIDfXpNjmZkaFOZwEUzrPgMYQTKor71lR/ZVl9moTKHVffUs?= =?us-ascii?q?5Joi1gdQI7ultC8GJ5TmEp3ELlcAyt6mcJFfGohh42lhd+YeM1+Tjx+Vg3OF?= =?us-ascii?q?vKqzYrkEQqg9rlmyqRcDn/LaerQ45ZFzf0t1IwMpPnQwd5dwuyklJ4ND3cXb?= =?us-ascii?q?Jek6NgdXx3iA/boZZPHflcTbdabx8WxPCXYO4l0VtaqiW630NH4vHFCZR6ng?= =?us-ascii?q?swbZGst25A2x5kbNMtPqzfOq5JzllWhqKTsS6lzfw+wAgbJ0kR6mySYzIItF?= =?us-ascii?q?YONrY4Oyqi5vZs5hCamztfZGgMUOInou5r9kM4POSA0yLg0r5YJ0+sNuyeL7?= =?us-ascii?q?mWtHPamc6OXFwwylsCl1NZ8rhuzccjb02UWlg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q+YEbx+yQkx5h1H7m/Tc2k3FglomoaSyqoDtZMBf?= =?us-ascii?q?prv07QWD1gf5+kso7lO4lITm9W5pKdt09TkF9xPC6h1ZpcN8ZN7yYWXDdRvD?= =?us-ascii?q?qdvMG9SNFY1M9yCJ8MPMlwt2nhF6NDJZeevWc6urrxxX/F4zo8qku1xC2vG6?= =?us-ascii?q?+kSOJU53UeGh41J2uEt0YvE/Ah8nzV8lDQqFB74/lUBr6TjUVrujl9GopCBj?= =?us-ascii?q?FT1XCqN15zVmVJs/1GKKTJdMxRW+UyZQWxNBMgCPErxFGJ/UVonXfjeSNyqA?= =?us-ascii?q?pa+yfZXwYqSSkZmLDtmScRqsu/Iz8VV4pIbSk9byfCMw+bmzpYvAxYa0FxX5?= =?us-ascii?q?AWGMhF9qoe3YtJ+srCVUesJj0EXBN4MAI4yuBTlUlZsEWXYSrdFxande7Tsh?= =?us-ascii?q?1resectMypI+7//AdJkIPnt/03+LsYSn26gwKtR8ver4jmut2MqESOaL/yM/?= =?us-ascii?q?egbn/ZUDjMkRewiK8iD5nO5CXTMQxbK5xgxXolZ5jhB3TLMg5dJ6IHPUpbSL?= =?us-ascii?q?x1aclbouBAecBoYqEJ+bViBhifXBPgBJSvrOVaLlbUXTneKSSB/fC4oYLX97?= =?us-ascii?q?PdUvLsZs2Lx3bAWKJ3JYx36Tz0Frbly4Ne/VD22vh1/ENgVVfGKzyBrMjmJg?= =?us-ascii?q?4T+MatbE/isYMyHTPKAJZwl2HgxlpceMoWXSKq9ogYyJJD53rqT+J3zFTzuv?= =?us-ascii?q?VI97Z48Yk3/6xpycCsKKfWMvRatE9qDwOaBgp065otB3J/SHpJYu8LL/fRf7?= =?us-ascii?q?oWgtzyq+ztEKwX8hKV8fRDadTbP0HBhtW/CjaERBxGnQcBrCUXLg6C2P+Fha?= =?us-ascii?q?B0U8elpe722k435VixMAIGxqh35YiY4qqIuPPXbxzJwLgFW6nlXNn8oag3tk?= =?us-ascii?q?OJ+/IkiKABdXBvb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JXS28CPJ0KChq?= =?us-ascii?q?3uLM3Y96DLS8bUyF4nLyQDC+JDO1H8+pk6M9glWrbaAbpeu1EGCLMnRIA6bT?= =?us-ascii?q?+rprx0LQcqIxbYPe/yj8Tvve3NY5JVoznT71ZjSUWUtx4Cz6mySgp2J9Cvim?= =?us-ascii?q?7pKZ89DjRGs5V2CxRgEYcOU8MNpgaqGdiVzae8jdLiniEyoPcE5Iz3DP2Cz9?= =?us-ascii?q?Glx8NpRZEP/UmMOyzcLLNmjkRskqK5hfKTmoLpB5bacMgfHPN+XnaDb7bHGo?= =?us-ascii?q?ulLTfbIsf7fFRL26SR3LJwTlOaYyWqOsjOrzWqYc1t+l5z0YlkZKzTwTgquq?= =?us-ascii?q?ncw8f3bnpHqz2LqG7QcoFS4FzDGarVWBdZ?= X-IPAS-Result: =?us-ascii?q?A2BfBAAUlTlb/wHyM5BcHAEBAQQBAQoBAYMbK2ggShIoi?= =?us-ascii?q?31fjUGBF4tuhAyENRSBYg8YFIQ7A4NHNBgBAgEBAQEBAQIBbChCDgGBZCQBg?= =?us-ascii?q?mQCJBMUIAsDAwkCHyEICAMBLRUfCwUYBIR/A6kVM4hHgS6KQz+BDzOCJ4R8A?= =?us-ascii?q?RIBhXUCh2CFKYw9CZcgD4VCASuRXIFBOGFxMxoIGxU7gmmCJBeOM1N8FIZih?= =?us-ascii?q?xuCOQEB?= Received: from tarius.tycho.ncsc.mil (HELO tarius.infosec.tycho.ncsc.mil) ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 02 Jul 2018 03:02:09 +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 w62319QZ027184; Sun, 1 Jul 2018 23:01:25 -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 w62310KR007154 for ; Sun, 1 Jul 2018 23:01:00 -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 w62318Hh027181 for ; Sun, 1 Jul 2018 23:01:08 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1CCBABglDlbly0VGNZcHgEGDIMbK2hqE?= =?us-ascii?q?iiDeYhji1yBZYEXi26EDIQ1gXoLLIRAgyQhNBgBAgEBAQEBAQIUAQEBAQEGGAa?= =?us-ascii?q?BGg4BhQ8EUjAFAiYCSSmDIIIAA6cugWkziEeBLoELh2KBVj+BDzOCJ4gwglUCh?= =?us-ascii?q?2CFKYw9CZcgD4VDK5FcgUGCCjMaCBsVgySCJA4JEY4iU4EQhmKJVAEB?= X-IPAS-Result: =?us-ascii?q?A1CCBABglDlbly0VGNZcHgEGDIMbK2hqEiiDeYhji1yBZYE?= =?us-ascii?q?Xi26EDIQ1gXoLLIRAgyQhNBgBAgEBAQEBAQIUAQEBAQEGGAaBGg4BhQ8EUjAFA?= =?us-ascii?q?iYCSSmDIIIAA6cugWkziEeBLoELh2KBVj+BDzOCJ4gwglUCh2CFKYw9CZcgD4V?= =?us-ascii?q?DK5FcgUGCCjMaCBsVgySCJA4JEY4iU4EQhmKJVAEB?= X-IronPort-AV: E=Sophos;i="5.51,297,1526356800"; d="scan'208";a="314395" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.35]) by goalie.tycho.ncsc.mil with ESMTP; 01 Jul 2018 23:01:08 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AwHVjMBF4QxMy7HpdCvlsRZ1GYnF86YWxBRYc79?= =?us-ascii?q?8ds5kLTJ78o86wAkXT6L1XgUPTWs2DsrQY07SQ6/iocFdDyK7JiGoFfp1IWk?= =?us-ascii?q?1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk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UPKPbrRmD4ed5cLrEX5McpDuoc6tt3PXpl3Js3AZFJfPzj5IKdHC1GOhnKE?= =?us-ascii?q?yFYH3qx80MCnoOohFnHbK4lV2DVWcCf3/rBOQx6zQgB8SjBIbHAIWshO/J0C?= =?us-ascii?q?S6G8hQYWZLQhCJHGzzfoqJE/ELdGqJI8BnnzBFHbisQoMsz1ev4Qn9zbc0Zv?= =?us-ascii?q?HM9Hg+spTunMNw+/WVjQs7oCRxCMOH3kmXQm10l39OTDgzj+hkuUIo8l6Yyu?= =?us-ascii?q?BjhuBAU9la5vdHSAA/YIbZyOtgBvjoVw7Bd8vPQ1GjEZ29GT9kdtsq2JcVZl?= =?us-ascii?q?plXdWviheWxy2xH7ocjKCGHrQx4vuaxXX9J89hjX3B0aQ=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CQAwDYlDlbly0VGNZcHgEGDIMbK2h?= =?us-ascii?q?qEiiDeYhji1yBZYEXi26EDIQ1gXoLLIRAgyQhNBgBAgEBAQEBAQIBEwEBAQE?= =?us-ascii?q?BBhgGWEIOAYFkJAGDBgRSMAUCJgJJKYMgggADpyyBaTOIR4EugQuHYoFWP4E?= =?us-ascii?q?PM4IniDCCVQKHYIUpjD0JlyAPhUMrkVyBQYIKMxoIGxWDJIIkDgkRjiJTgRC?= =?us-ascii?q?GYolUAQE?= X-IPAS-Result: =?us-ascii?q?A0CQAwDYlDlbly0VGNZcHgEGDIMbK2hqEiiDeYhji1yBZ?= =?us-ascii?q?YEXi26EDIQ1gXoLLIRAgyQhNBgBAgEBAQEBAQIBEwEBAQEBBhgGWEIOAYFkJ?= =?us-ascii?q?AGDBgRSMAUCJgJJKYMgggADpyyBaTOIR4EugQuHYoFWP4EPM4IniDCCVQKHY?= =?us-ascii?q?IUpjD0JlyAPhUMrkVyBQYIKMxoIGxWDJIIkDgkRjiJTgRCGYolUAQE?= X-IronPort-AV: E=Sophos;i="5.51,297,1526342400"; d="scan'208";a="15248714" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from uhil3cpa06.eemsg.mail.mil ([214.24.21.45]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 02 Jul 2018 03:01:07 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;80f9f775-e865-40d7-8245-1bdb83b74f9c Authentication-Results: uhil19pa13.eemsg.mail.mil; dkim=none (message not signed) header.i=none; spf=None smtp.pra=pmoore@redhat.com; spf=Pass smtp.mailfrom=pmoore@redhat.com; spf=Pass smtp.helo=postmaster@mx1.redhat.com X-EEMSG-check-008: 305801871|UHIL19PA13_EEMSG_MP11.csd.disa.mil X-EEMSG-SBRS: 5.2 X-EEMSG-ORIG-IP: 66.187.233.73 X-EEMSG-check-002: true IronPort-PHdr: =?us-ascii?q?9a23=3A4OJ9EhNffGTH/Aizwygl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0K/T6rarrMEGX3/hxlliBBdydsK0UzbeN+Pm9EUU7or+/81k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i76xXcoFx7+LQt4?= =?us-ascii?q?IPjuUs6X1pzvlrP6x5qGZQhUiDejSa19IQ/wrgjLsMQSx4x4JfUf0BzM90NBZu?= =?us-ascii?q?Ae4GRvP1/byw754cCq8bZ5/ihQsu5n/MlFB/apN58kRKBVWWx1e1s+49fm4Fya?= =?us-ascii?q?FVPWtyksF14Omx8NODDrqRTzX5P/qCz/77AvwiSWPcTqC7szXGb7tvs5eFrTkC?= =?us-ascii?q?4CcgUB3iTPkMUp1vBBrR6hrgA5yInRMtnMaahOO5jFdNZfflJvG8ZcUysYXNG5?= =?us-ascii?q?f9JJFecNPe9E6YL6oglXoA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AaAgCjlDlbmEnpu0JcHgEGDIMbgRNqE?= =?us-ascii?q?iiDeYhjjUGBF4tuhAyENYF6CysBhECDPgYBBDAYAQIBAQEBAQEBAQETAQEBAQE?= =?us-ascii?q?ICwsGKS9CDgGBZAUBHgEFgwEEUjAFAiYCSSmDIIIApzGBaTOIR4EugQuJOD+BD?= =?us-ascii?q?zOCJ4gwglUCh2CFKYw9CZcgD4VCASuRXIFBggozGggbFYMkgiQOCY4zIzCBDgE?= =?us-ascii?q?BhmKHeoFaAQE?= X-IPAS-Result: =?us-ascii?q?A0AaAgCjlDlbmEnpu0JcHgEGDIMbgRNqEiiDeYhjjUGBF4t?= =?us-ascii?q?uhAyENYF6CysBhECDPgYBBDAYAQIBAQEBAQEBAQETAQEBAQEICwsGKS9CDgGBZ?= =?us-ascii?q?AUBHgEFgwEEUjAFAiYCSSmDIIIApzGBaTOIR4EugQuJOD+BDzOCJ4gwglUCh2C?= =?us-ascii?q?FKYw9CZcgD4VCASuRXIFBggozGggbFYMkgiQOCY4zIzCBDgEBhmKHeoFaAQE?= Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) ([66.187.233.73]) by uhil19pa13.eemsg.mail.mil with ESMTP; 02 Jul 2018 03:01:04 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D13E77C6A9; Mon, 2 Jul 2018 03:01:02 +0000 (UTC) Received: from [192.168.3.60] (ovpn-120-124.rdu2.redhat.com [10.10.120.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 684DD2026D66; Mon, 2 Jul 2018 03:01:02 +0000 (UTC) X-EEMSG-check-009: 444-444 From: Paul Moore To: netdev@vger.kernel.org Date: Sun, 01 Jul 2018 23:01:02 -0400 Message-ID: <153050046203.740.13741366203375982437.stgit@chester> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Jul 2018 03:01:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Jul 2018 03:01:02 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pmoore@redhat.com' RCPT:'' Subject: [RFC PATCH] ipv6: make ipv6_renew_options() interrupt/kernel safe 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: Cc: linux-security-module@vger.kernel.org, Al Viro , selinux@tycho.nsa.gov Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: Paul Moore At present the ipv6_renew_options_kern() function ends up calling into access_ok() which is problematic if done from inside an interrupt as access_ok() calls WARN_ON_IN_IRQ() on some (all?) architectures (x86-64 is affected). Example warning/backtrace is shown below: WARNING: CPU: 1 PID: 3144 at lib/usercopy.c:11 _copy_from_user+0x85/0x90 ... Call Trace: ipv6_renew_option+0xb2/0xf0 ipv6_renew_options+0x26a/0x340 ipv6_renew_options_kern+0x2c/0x40 calipso_req_setattr+0x72/0xe0 netlbl_req_setattr+0x126/0x1b0 selinux_netlbl_inet_conn_request+0x80/0x100 selinux_inet_conn_request+0x6d/0xb0 security_inet_conn_request+0x32/0x50 tcp_conn_request+0x35f/0xe00 ? __lock_acquire+0x250/0x16c0 ? selinux_socket_sock_rcv_skb+0x1ae/0x210 ? tcp_rcv_state_process+0x289/0x106b tcp_rcv_state_process+0x289/0x106b ? tcp_v6_do_rcv+0x1a7/0x3c0 tcp_v6_do_rcv+0x1a7/0x3c0 tcp_v6_rcv+0xc82/0xcf0 ip6_input_finish+0x10d/0x690 ip6_input+0x45/0x1e0 ? ip6_rcv_finish+0x1d0/0x1d0 ipv6_rcv+0x32b/0x880 ? ip6_make_skb+0x1e0/0x1e0 __netif_receive_skb_core+0x6f2/0xdf0 ? process_backlog+0x85/0x250 ? process_backlog+0x85/0x250 ? process_backlog+0xec/0x250 process_backlog+0xec/0x250 net_rx_action+0x153/0x480 __do_softirq+0xd9/0x4f7 do_softirq_own_stack+0x2a/0x40 ... While not present in the backtrace, ipv6_renew_option() ends up calling access_ok() via the following chain: access_ok() _copy_from_user() copy_from_user() ipv6_renew_option() The fix presented in this patch is to perform the userspace copy earlier in the call chain such that it is only called when the option data is actually coming from userspace; that place is do_ipv6_setsockopt(). Not only does this solve the problem seen in the backtrace above, it also allows us to simplify the code quite a bit by removing ipv6_renew_options_kern() completely. We also take this opportunity to cleanup ipv6_renew_options()/ipv6_renew_option() a small amount as well. This patch is heavily based on a rough patch by Al Viro. I've taken his original patch, converted a kmemdup() call in do_ipv6_setsockopt() to a memdup_user() call, made better use of the e_inval jump target in the same function, and cleaned up the use ipv6_renew_option() by ipv6_renew_options(). CC: Al Viro Signed-off-by: Paul Moore --- include/net/ipv6.h | 9 ---- net/ipv6/calipso.c | 9 +--- net/ipv6/exthdrs.c | 108 ++++++++++++---------------------------------- net/ipv6/ipv6_sockglue.c | 27 ++++++++---- 4 files changed, 50 insertions(+), 103 deletions(-) diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 16475c269749..d02881e4ad1f 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -355,14 +355,7 @@ struct ipv6_txoptions *ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, int newtype, - struct ipv6_opt_hdr __user *newopt, - int newoptlen); -struct ipv6_txoptions * -ipv6_renew_options_kern(struct sock *sk, - struct ipv6_txoptions *opt, - int newtype, - struct ipv6_opt_hdr *newopt, - int newoptlen); + struct ipv6_opt_hdr *newopt); struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, struct ipv6_txoptions *opt); diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c index 1323b9679cf7..1c0bb9fb76e6 100644 --- a/net/ipv6/calipso.c +++ b/net/ipv6/calipso.c @@ -799,8 +799,7 @@ static int calipso_opt_update(struct sock *sk, struct ipv6_opt_hdr *hop) { struct ipv6_txoptions *old = txopt_get(inet6_sk(sk)), *txopts; - txopts = ipv6_renew_options_kern(sk, old, IPV6_HOPOPTS, - hop, hop ? ipv6_optlen(hop) : 0); + txopts = ipv6_renew_options(sk, old, IPV6_HOPOPTS, hop); txopt_put(old); if (IS_ERR(txopts)) return PTR_ERR(txopts); @@ -1222,8 +1221,7 @@ static int calipso_req_setattr(struct request_sock *req, if (IS_ERR(new)) return PTR_ERR(new); - txopts = ipv6_renew_options_kern(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, - new, new ? ipv6_optlen(new) : 0); + txopts = ipv6_renew_options(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, new); kfree(new); @@ -1260,8 +1258,7 @@ static void calipso_req_delattr(struct request_sock *req) if (calipso_opt_del(req_inet->ipv6_opt->hopopt, &new)) return; /* Nothing to do */ - txopts = ipv6_renew_options_kern(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, - new, new ? ipv6_optlen(new) : 0); + txopts = ipv6_renew_options(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, new); if (!IS_ERR(txopts)) { txopts = xchg(&req_inet->ipv6_opt, txopts); diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 5bc2bf3733ab..1e1d9bc2fd3d 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -1015,29 +1015,21 @@ ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt) } EXPORT_SYMBOL_GPL(ipv6_dup_options); -static int ipv6_renew_option(void *ohdr, - struct ipv6_opt_hdr __user *newopt, int newoptlen, - int inherit, - struct ipv6_opt_hdr **hdr, - char **p) +static void ipv6_renew_option(int renewtype, + struct ipv6_opt_hdr **dest, + struct ipv6_opt_hdr *old, + struct ipv6_opt_hdr *new, + int newtype, char **p) { - if (inherit) { - if (ohdr) { - memcpy(*p, ohdr, ipv6_optlen((struct ipv6_opt_hdr *)ohdr)); - *hdr = (struct ipv6_opt_hdr *)*p; - *p += CMSG_ALIGN(ipv6_optlen(*hdr)); - } - } else { - if (newopt) { - if (copy_from_user(*p, newopt, newoptlen)) - return -EFAULT; - *hdr = (struct ipv6_opt_hdr *)*p; - if (ipv6_optlen(*hdr) > newoptlen) - return -EINVAL; - *p += CMSG_ALIGN(newoptlen); - } - } - return 0; + struct ipv6_opt_hdr *src; + + src = (renewtype == newtype ? new : old); + if (!src) + return; + + memcpy(*p, src, ipv6_optlen(src)); + *dest = (struct ipv6_opt_hdr *)*p; + p += CMSG_ALIGN(ipv6_optlen(*dest)); } /** @@ -1063,13 +1055,11 @@ static int ipv6_renew_option(void *ohdr, */ struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, - int newtype, - struct ipv6_opt_hdr __user *newopt, int newoptlen) + int newtype, struct ipv6_opt_hdr *newopt) { int tot_len = 0; char *p; struct ipv6_txoptions *opt2; - int err; if (opt) { if (newtype != IPV6_HOPOPTS && opt->hopopt) @@ -1082,8 +1072,8 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, tot_len += CMSG_ALIGN(ipv6_optlen(opt->dst1opt)); } - if (newopt && newoptlen) - tot_len += CMSG_ALIGN(newoptlen); + if (newopt) + tot_len += CMSG_ALIGN(ipv6_optlen(newopt)); if (!tot_len) return NULL; @@ -1098,29 +1088,16 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, opt2->tot_len = tot_len; p = (char *)(opt2 + 1); - err = ipv6_renew_option(opt ? opt->hopopt : NULL, newopt, newoptlen, - newtype != IPV6_HOPOPTS, - &opt2->hopopt, &p); - if (err) - goto out; - - err = ipv6_renew_option(opt ? opt->dst0opt : NULL, newopt, newoptlen, - newtype != IPV6_RTHDRDSTOPTS, - &opt2->dst0opt, &p); - if (err) - goto out; - - err = ipv6_renew_option(opt ? opt->srcrt : NULL, newopt, newoptlen, - newtype != IPV6_RTHDR, - (struct ipv6_opt_hdr **)&opt2->srcrt, &p); - if (err) - goto out; - - err = ipv6_renew_option(opt ? opt->dst1opt : NULL, newopt, newoptlen, - newtype != IPV6_DSTOPTS, - &opt2->dst1opt, &p); - if (err) - goto out; + ipv6_renew_option(IPV6_HOPOPTS, &opt2->hopopt, opt->hopopt, + newopt, newtype, &p); + ipv6_renew_option(IPV6_RTHDRDSTOPTS, &opt2->dst0opt, opt->dst0opt, + newopt, newtype, &p); + ipv6_renew_option(IPV6_RTHDR, + (struct ipv6_opt_hdr **)&opt2->srcrt, + (struct ipv6_opt_hdr *)opt->srcrt, + newopt, newtype, &p); + ipv6_renew_option(IPV6_DSTOPTS, &opt2->dst1opt, opt->dst1opt, + newopt, newtype, &p); opt2->opt_nflen = (opt2->hopopt ? ipv6_optlen(opt2->hopopt) : 0) + (opt2->dst0opt ? ipv6_optlen(opt2->dst0opt) : 0) + @@ -1128,37 +1105,6 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, opt2->opt_flen = (opt2->dst1opt ? ipv6_optlen(opt2->dst1opt) : 0); return opt2; -out: - sock_kfree_s(sk, opt2, opt2->tot_len); - return ERR_PTR(err); -} - -/** - * ipv6_renew_options_kern - replace a specific ext hdr with a new one. - * - * @sk: sock from which to allocate memory - * @opt: original options - * @newtype: option type to replace in @opt - * @newopt: new option of type @newtype to replace (kernel-mem) - * @newoptlen: length of @newopt - * - * See ipv6_renew_options(). The difference is that @newopt is - * kernel memory, rather than user memory. - */ -struct ipv6_txoptions * -ipv6_renew_options_kern(struct sock *sk, struct ipv6_txoptions *opt, - int newtype, struct ipv6_opt_hdr *newopt, - int newoptlen) -{ - struct ipv6_txoptions *ret_val; - const mm_segment_t old_fs = get_fs(); - - set_fs(KERNEL_DS); - ret_val = ipv6_renew_options(sk, opt, newtype, - (struct ipv6_opt_hdr __user *)newopt, - newoptlen); - set_fs(old_fs); - return ret_val; } struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 4d780c7f0130..c95c3486d904 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -398,6 +398,12 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, case IPV6_DSTOPTS: { struct ipv6_txoptions *opt; + struct ipv6_opt_hdr *new = NULL; + + /* hop-by-hop / destination options are privileged option */ + retv = -EPERM; + if (optname != IPV6_RTHDR && !ns_capable(net->user_ns, CAP_NET_RAW)) + break; /* remove any sticky options header with a zero option * length, per RFC3542. @@ -409,17 +415,22 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, else if (optlen < sizeof(struct ipv6_opt_hdr) || optlen & 0x7 || optlen > 8 * 255) goto e_inval; - - /* hop-by-hop / destination options are privileged option */ - retv = -EPERM; - if (optname != IPV6_RTHDR && !ns_capable(net->user_ns, CAP_NET_RAW)) - break; + else { + new = memdup_user(optval, optlen); + if (IS_ERR(new)) { + retv = PTR_ERR(new); + break; + } + if (unlikely(ipv6_optlen(new) > optlen)) { + kfree(new); + goto e_inval; + } + } opt = rcu_dereference_protected(np->opt, lockdep_sock_is_held(sk)); - opt = ipv6_renew_options(sk, opt, optname, - (struct ipv6_opt_hdr __user *)optval, - optlen); + opt = ipv6_renew_options(sk, opt, optname, new); + kfree(new); if (IS_ERR(opt)) { retv = PTR_ERR(opt); break;