From patchwork Wed May 23 01:18:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 10421021 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 32B7160327 for ; Wed, 23 May 2018 12:06:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 205E028DDC for ; Wed, 23 May 2018 12:06:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1416028F2C; Wed, 23 May 2018 12:06:34 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from UPBD19PA09.eemsg.mail.mil (upbd19pa09.eemsg.mail.mil [214.24.27.84]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6023F28DDC for ; Wed, 23 May 2018 12:06:29 +0000 (UTC) Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by UPBD19PA09.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 23 May 2018 12:06:26 +0000 X-IronPort-AV: E=Sophos;i="5.49,432,1520899200"; d="scan'208";a="13655968" IronPort-PHdr: =?us-ascii?q?9a23=3ASA/CUhzR7nhx3uXXCy+O+j09IxM/srCxBDY+r6?= =?us-ascii?q?Qd1uIWKfad9pjvdHbS+e9qxAeQG9mDsLQc06L/iOPJYSQ4+5GPsXQPItRndi?= =?us-ascii?q?QuroEopTEmG9OPEkbhLfTnPGQQFcV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1I+mXfoMVvyz9K/c97f70kXA5gUMdfbWu3ZYPanC4HO5pLF?= =?us-ascii?q?maYXr3hdcBF2YKvhQlQezkjF2CTDFSaG2vX6I6+jE7FZiqDYDZRoCimLaBxj?= =?us-ascii?q?u0HoVKZmBaDVCBCXnpd4SAW/cJdi2SONRskjIaWre8TI8hzwuhtBfgy7pgLO?= =?us-ascii?q?rb5DEXtY752Nhy/e3Tmgk49SZoAMSFz2GNU2Z0k3sVSDAq2aB/pkp9ykue3a?= =?us-ascii?q?VjnfxXC8ZT5/JIUwc9M57Q1ep6BM7uWgjZZNeGVE6mQsm6ATE2Vt8+3sMObF?= =?us-ascii?q?xnG9i5kh/D2C+qDKMPmLyQGJw46KTc0GbtJ8xl0XbJyLEhj0U6QstILWCpmL?= =?us-ascii?q?Z/+BLJB47IiEWUjL6qer4G3C7M72eD1W6Os1tEXwFuS6nFWmofZkTOp9Tj+k?= =?us-ascii?q?zCV6OuCaggMgZZx86CMLFFatv1glVHX/fuI9HeY3qwm2upHhaJyKiMYJDte2?= =?us-ascii?q?UH0yXXEFIEnBwL/XaaKQg+AT+so2HEAzxtElLvfljh8epkp3O4SU800huGb0?= =?us-ascii?q?p717q64hQVn+CTS+sP3rIYvycssy97E0un39LXFdWAvRFsc79AbtM4+ltH0n?= =?us-ascii?q?jZtwNlNJy6M69inkIecxhwv072zRV4F5hPnNMlrHMvwwt+M6SY301ddzmAx5?= =?us-ascii?q?D/JqXXKnXu/BCoc6PWwV/e0MyR+qcU9PQ1sE7jvAeuFkss9nVoyd9V32Ga5p?= =?us-ascii?q?rUEAoYSYjxXVov9xhmu7HaZTEw5o3O2n1oLam7rCXC28kyCes71BmgZcxQML?= =?us-ascii?q?6BFAPoFM0aHceuIvQwm1e1dhIEIPxS9KksMsOgdvuG3KqrM/h7nD+9l2tI/p?= =?us-ascii?q?p90kWW+yp7UO7I0I4Pw+uE0QufSzf8kFChv9jpmYBFeT4SAm2/yTL+CIFNZq?= =?us-ascii?q?1yeoALCWi1Ls2zx9V+gYTiW2Rf9FK5AFMGwsCpcwKIb1PhxQ1QyVgXoXu/lC?= =?us-ascii?q?u8zjx0iC0porOE3CPQx+TidRwHOnNERWR5llfsOYm0j9YbXEe0dAgljh2l6l?= =?us-ascii?q?jmx6JDvqRwM3HTQVtUfyjxN2xiSKywtr6GY8FR8pMnrSJXUeqnbFCBV77yvw?= =?us-ascii?q?Aa3znkH2tEyzAxbyuqtYnhnxxmlGKdK25+rHnHdsF23hfS/9/cSuBX3jodQi?= =?us-ascii?q?l3lyXXCkK7P9mz8tWej43DvfymV2K9Sp1TdjHmzZuauyum4W1lHwW/kOq1mt?= =?us-ascii?q?37Dwc6yzT218RxVSrWthb8eZPn17+9MeJ6ZElnGEHz68R9GoFknYs/mosc2X?= =?us-ascii?q?4EiZWJ5XAHi3v8Mc1H2aLia3oAXSALw9jI7wX+xk1jKG+Gx4LjWnWb3MRhe8?= =?us-ascii?q?GwYnkK1SIl88BKFKCU4aRcnSRvv1q4qRncbuR8njcByfoi8XAajPsPuAY3yS?= =?us-ascii?q?WdGL8SF1FCPSPwjxSI88y+rKJPaWaha7ew0lZ+ndekDLyZrAFTRmv2epA4HS?= =?us-ascii?q?Bq9sV/KlXM0H/t5Y74ZNncd9UTtgebkx3YlehaNIoxluYWhSpgIW/9uGcqy+?= =?us-ascii?q?o/jRNwwZG6oJKIJH928aK/HBFYKib1aN8J9TH1k6lShMCW0J6zHp95ADUEQI?= =?us-ascii?q?PoTe60EDIVrfnnORyOHyMhpXeAA7XfGxOf6EB9r3/UCZ+kK3SXKGMezdV4Sx?= =?us-ascii?q?mXPFZfjxwMXDUmgp45ERinxMr7cEhj/jAR/kX1qhVNyuJyLBn/TmnfpAauaj?= =?us-ascii?q?guTpiQMBtW4RtG50vPNsye9O1zFTlC/pK9tAyNNnCbZwNQAGERREOLHE7sPr?= =?us-ascii?q?+v5dnc9OiVHeu+IOXQbrqQs+BeUO2IxZ232It84zmMLtmPPmVlD/AjwUVMRn?= =?us-ascii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Bx4oeJ4q6IpPTSbxbR1rUEVLblSd70rrQ2oU?= =?us-ascii?q?yS/ecklLkMemNrfwKnDPIRVskHxmfv1aoq1z4jE9vfH7L8//5OT3A5njPlm5?= =?us-ascii?q?1mGlUZBPMVEqSR/YRfmGc4lPbVNtsIfaBegmyPDwKrEqceyX637CuaOGhlgx?= =?us-ascii?q?DU3B7qXWy+90T2ojFkQSTS09jviE1VVqO4BU1KRSqmJVd4sC+TPArvrNf4oq?= =?us-ascii?q?U17Fo4M2P+ttKNlXehOKtNEM3iINyROjU7pFUKg5IvXNOvxJobGd2nINgL6n?= =?us-ascii?q?1+aeHe62yzmS9bv6hHn5be4t2S+vjPBXmvlbGapKmNxDFWzXg4p1I/5sm7Nv?= =?us-ascii?q?7Q492KQvKo13seTipkowvORQK1paDbr1EaPkyLykTLlJYJPt5Hx3k40F/p5O?= =?us-ascii?q?w5TNI07gVeGZ7KZ+keqjDrJDv03VGfbso4ViaEyTtYAE71EVljFag42WLwoN?= =?us-ascii?q?zGlXfK9F01XYl8bUrnigJrD48gM0Ii9EAXwjYfEQgKcR2bA6+nBUL5LYsDUk?= =?us-ascii?q?gPbg+H06a+eqc2201z37yu6fTXbeNiHaoMNuxSghSInFdFBpIcqbceT65ke1?= =?us-ascii?q?9B6K7XoRDvBJTlX/f8iXU9LuG6Qsde8cAdtnst/By/Rwa+5phf77YXkpeIdr?= =?us-ascii?q?RLYZLUpsBz819n5SITdixKmBV/ihS5UeYApODs/NfWq5+o6ue0W6YrWeoX6x?= =?us-ascii?q?Y1B2Nkj5vzm1Avu9fX2PlASofNk4Tw7BhNI2KWuIbdyxR8JvYBK5mwfLp56n?= =?us-ascii?q?sJKC4QJ3MIPdqLZPgx+CBtMDDJ6FxEHMwAf9QYPNDCmQpMkE3mRKlT9tbHGl?= =?us-ascii?q?+fE4pzdcco72rxyDwv7ZQ8UuLg6CKrKpHe7lFNOehDjCZtlN/ZuugVwOTSBz?= =?us-ascii?q?IT4XaEahh52CWCxIeRC/zo5+WD1MnUV08aHi4xS4pdJSSC9hahRueukJXpTx?= =?us-ascii?q?6b6s70gJIlbk6QQWaxnKsduKZWDeFAkjn73iRZFo3thfKardSs6GVTtlBcHo?= =?us-ascii?q?d89xvFF7tDPplhPxT3iNWrTFBmBiTjYMHUagYuuO2Oy+cD5+V+MEX/apEfIh?= =?us-ascii?q?IA0L/68n1VTg1vSLHqpFqZW/weZMd+QvPesn9V8Z5gK7MIPFWFoZzqrzRIqF?= =?us-ascii?q?MxAAIyar8/tD9adk7InAJLXab4orgAhRUAUdRho09DBXqwOH4i5zrATalal7?= =?us-ascii?q?eeCPoJ8jiIVawOV0JoMj9iQxOrxpphZqGlnfddsmNJhil9uuQl0yR6RBugvi?= =?us-ascii?q?3hv7oN2TUk+L6irjUAt3tFTuGQkyrTDFVDy/MKjbwCBHn+81y8Z2IDbJDz4L?= =?us-ascii?q?lhKsTs744h424wYR87ZS0JQfygCz3sj6OPGoGPvsxThBqMuMXWc7C+NikTNr?= =?us-ascii?q?U4yRLmWXd9yAzekwhy/GsMWDWg48cuJJ+hNsY92iqoBW/beU4C46NRqsvxtE?= =?us-ascii?q?IEQ/UtZFNkwWVjztKHSTMXSMzIAWY1gRAuaX9Yf5Jb9R8aC64ojy6PvqlC4A?= =?us-ascii?q?4Zey/UEoC/9YnLgcfI2GUyTctwxm3IuKKJnJUq32N5m9ls9C6BpGwSd/DEU8?= =?us-ascii?q?9rGnXz0oZfyerjZ/Siq+wHTIpmyK+9UP8ZKcSj+HG52JNtWkO/wbQeBVW5Ov?= =?us-ascii?q?cZxrjHSyelVXGYWeOTfmiJhTk2Lk7y5RiuLl0wc8pKsU49Mu3ciZ5Ylg3hV6?= =?us-ascii?q?50RyqKqV/c1mwjPvsQdxgqt4e/ZwwKUOkRavCeJec0w/0+D0ADYmTUHStwF+?= =?us-ascii?q?+2sVmtnJV0O3Vg/UX2e+Lt/R76MNGKABkLDZbaroJt+fy9Xm+BO3pgzBpoPE?= =?us-ascii?q?lu9uffDE88tulGfJaUg9fQhs530ekfd/diKSc9oMIcmpp/6YmI18eHaQrRzp?= =?us-ascii?q?j3Jd7Jo/WVAObSz1o0dWFAU7oYYAT154MgMt4/RbLTAegRgRNJAak8XYxkNG?= =?us-ascii?q?rr8qxwBB18fxSXZ7muhMTu4OWRad8cuX7M6XoiISHdpVsHy/qpXUp8dZ/smn?= =?us-ascii?q?a2aJkzXjdpq9xrFwsjEoxSHc8JswugBdiTgq7/w8Cw/0drk+4Mv7D5Bv3D2J?= =?us-ascii?q?K+xYo1F5dA6EOIPB7VBa92kkpik+K+i+vB1Z+3DtntPZsAVe5mUiveZ7TbBI?= =?us-ascii?q?SjO3eLPc7hf0Nu7bGRyvR6Xw+XaSS/WLCJ8GW/OfFl51gr4pBpd+rUijo25v?= =?us-ascii?q?fU38W2L21WuA+ktXOPKoBA7UDBBarZRR0QAeGF9GdNHqANa4bwsuAUPphqxN?= =?us-ascii?q?ma/hk29j1D3OObLKW76EzBwER2cdTcNkS69Tw+XNwpLRKjeWwyjHXCtm7QDG?= =?us-ascii?q?gUesupL9Urh8iYFAfx/UR8hUkiY2dAHizjQtLHajtT4N63eADfrFEDNN0Ehe?= =?us-ascii?q?PiPBdg7PfgQPR0OphDheShvakGltAsMSzUWcxGJH6BfqJ9OT4IX/3G/QVubx?= =?us-ascii?q?MBqLdzX440Yd6LIUdUVSXIxSDzyF7a2FbvP5y31amPKToL6HgP0b/f0DZNqg?= =?us-ascii?q?X48faUi8HuSvbYObn5WffTNGwuUTSX?= X-IPAS-Result: =?us-ascii?q?A2AWBwBhWAVb/wHyM5BcGwEBAQEDAQEBCQEBAYNBA4EEW?= =?us-ascii?q?yiMWowEgm4akzcUgVkWGBMBhECCJyE1FwECAQEBAQEBAgFrHAxCEAGBYiSCU?= =?us-ascii?q?AMDAQIkEwYBDQ4SCwECAQIJAQEFECsICAMBHQIOAwEFAQsRBwcLBRgEgwGBa?= =?us-ascii?q?AEDFQOeaTyMbhYFAReCcAV/BAGCSAoZJg1VV4F0AgYShyh8gVQ/gQ+CWIMEg?= =?us-ascii?q?XEBEgE0hT8Ch0OEZYwGLAcCgWeJc4J0C4dWhSuKL4YpAgQCBAUCBQ8hgQQeA?= =?us-ascii?q?zNhcXBQMYISghQJAgEXg0WKHDUdU3kBAQEohFGFLoI3AQE?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 23 May 2018 12:06:25 +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 w4NC6NLr020986; Wed, 23 May 2018 08:06:24 -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 w4N1KnjG036682 for ; Tue, 22 May 2018 21:20:49 -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 w4N1KrpH026317 for ; Tue, 22 May 2018 21:20:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1DVAAABwQRblywYGNZcHQEBBQELAYNAg?= =?us-ascii?q?WIoi3pfjBaCbhqTNoF4CyyEQAKCISE0GAECAQEBAQEBAhQBAQEBAQYYBkuFNQM?= =?us-ascii?q?DJxkBGx0BAwwGEDshAhEBBQEcBxKDIoFoAQMVA55gPIxuFgUBF4JwBX8EAYJIC?= =?us-ascii?q?hkmDVRXgXQCBhKHJ3yBVD+BD4JYgwSHeAKHPYRkjAIsBwKBZ4lxgnQLh1OFK4o?= =?us-ascii?q?qhikCBAIEBQIFDyGBBByCCnCBAYISghQJAgEOCYNFihw1HVN5K40aAQE?= X-IPAS-Result: =?us-ascii?q?A1DVAAABwQRblywYGNZcHQEBBQELAYNAgWIoi3pfjBaCbhq?= =?us-ascii?q?TNoF4CyyEQAKCISE0GAECAQEBAQEBAhQBAQEBAQYYBkuFNQMDJxkBGx0BAwwGE?= =?us-ascii?q?DshAhEBBQEcBxKDIoFoAQMVA55gPIxuFgUBF4JwBX8EAYJIChkmDVRXgXQCBhK?= =?us-ascii?q?HJ3yBVD+BD4JYgwSHeAKHPYRkjAIsBwKBZ4lxgnQLh1OFK4oqhikCBAIEBQIFD?= =?us-ascii?q?yGBBByCCnCBAYISghQJAgEOCYNFihw1HVN5K40aAQE?= X-IronPort-AV: E=Sophos;i="5.49,431,1520913600"; d="scan'208";a="283123" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.34]) by goalie.tycho.ncsc.mil with ESMTP; 22 May 2018 21:20:52 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3ATFtsWRNuj19RxXMQZ1gl6mtUPXoX/o7sNwtQ0K?= =?us-ascii?q?IMzox0I/X6rarrMEGX3/hxlliBBdydt6ofzbKO+4nbGkU4qa6bt34DdJEeHz?= =?us-ascii?q?Qksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPER?= =?us-ascii?q?vjKwV1Ov71GonPhMiryuy+4ZLebxlGiTanfb9+MAi9oBnMuMURnYZsMLs6xA?= =?us-ascii?q?HTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKH?= =?us-ascii?q?w65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0yRD?= =?us-ascii?q?+s7bpkSAXwhSkaNzA37m/ZhM93gq1ZrhKsvABzz5LObY2JLvdyYr/RcNUHTm?= =?us-ascii?q?RBRMZRUClBD5u5YYQRCeoBIftToZDjp1QQtxu+HhWsBPnxxTBWmn/9wKo30+?= =?us-ascii?q?c/HgHAwAwsBdUOsGrKo9XvL6cSTfq1w7fWwjXfdP5W1jL955LJchAlu/2DQb?= =?us-ascii?q?Vwcc/IxEQpCgjLjU2QpJT7Mz+I2ekBqXaX4uV6We6xhGMrsQ58rze3ysoul4?= =?us-ascii?q?XFnJwZx17L+Clj3Yo4J8O0RFRlbdK5H5ZdsTyROZFsTcM4WW5ovT43yr0Ytp?= =?us-ascii?q?6/eygH0JooygDGZfKBfYWF/AjtWfqNLTp5nn5qZqywhxOp8Uiv0OH8U9O70F?= =?us-ascii?q?dOriZfl9nMt3QN2wTS6siBVPR94l+s1SiS2w3c8O1IP085mbDFJ5Mu2LI9mZ?= =?us-ascii?q?UevVzGHiDsmUX2iKGWdl8j+uit8+nnYavpppmAN4NujQH+LLohmtakAeQkKA?= =?us-ascii?q?gBQXaU+fin2b3s+E32WrRKjvksnqbFt5DaINwXprSlDA9NzoYj9xG/Ai+90N?= =?us-ascii?q?sGmXkHLVRFeA+IjoXyJ1HPIOz3Dfe4g1i2ljdr3OrJMqfuApXKMHiQ2IvmKL?= =?us-ascii?q?J87VNMjQk+19ZS47pKBbwbZvH+QEn8sJrfFBB9exK12eHPGth7151YXWOJH7?= =?us-ascii?q?/fN7nd90KLoqomIPGJTIsUvivtbvYi+vjihGM4nllberOmmdMIaXS8D9xnJU?= =?us-ascii?q?uDaHbhi9tHFn0F+kIxVuHli12qVT9Vema8WL866jgnCYWgS4DZScTlhL2HwT?= =?us-ascii?q?f+BZBde3pHFkHJFHDkaoGJc+kDZTjUIcJ7lDEAE7+7RMtpzhyqtQnn25J7P+?= =?us-ascii?q?HU/Wserpul299ro6XfmA8a8iR5CdqGzGCRRGEymXkHA3ct3KR+iU9w0FGO1e?= =?us-ascii?q?5/mfMcXdhS4e5ZFx0zNJL00eN3EZbxVxjHc9PPT0ypEfu8BjRkbd8335cpfU?= =?us-ascii?q?tnAMm4gx3fl36pDrkJ0buVCYYv7rjR0mTZKMN0ynKA364k2Qp1CvBTPHGr0/?= =?us-ascii?q?YsvzPYAJTExh3DzfSjaLgc0SjR9WyK0WuJugRCXRVtVbneAi9Ne0DRqY2o/k?= =?us-ascii?q?qbEvmjBLE8PU1EwM+GbK5Lbo6hgVZHQaL7Mc/FKyKqmmi2DAqV3L7Ecofwem?= =?us-ascii?q?sc0SmcQEgJmgwe5zCHYCAxAy6gpyTVCzlj?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AEAQBAwQRblywYGNZcHQEBBQELAYN?= =?us-ascii?q?AgWIoi3tfjBaCbhqTNoF4CyyEQAKCISE0GAECAQEBAQEBAgETAQEBAQEGGAZ?= =?us-ascii?q?LDII1IoJSAwMnGQEbHQEDDAYQOyECEQEFARwHEoMigWgBAxUDnmA8jG4WBQE?= =?us-ascii?q?XgnAFfwQBgkgKGSYNVFeBdAIGEocnfIFUP4EPgliDBId4Aoc9hGSMAiwHAoF?= =?us-ascii?q?niXGCdAuHU4UriiqGKQIEAgQFAgUPIYEEHIIKcIEBghKCFAkCAQ4Jg0WKHDU?= =?us-ascii?q?dU3krjQABAQ?= X-IPAS-Result: =?us-ascii?q?A0AEAQBAwQRblywYGNZcHQEBBQELAYNAgWIoi3tfjBaCb?= =?us-ascii?q?hqTNoF4CyyEQAKCISE0GAECAQEBAQEBAgETAQEBAQEGGAZLDII1IoJSAwMnG?= =?us-ascii?q?QEbHQEDDAYQOyECEQEFARwHEoMigWgBAxUDnmA8jG4WBQEXgnAFfwQBgkgKG?= =?us-ascii?q?SYNVFeBdAIGEocnfIFUP4EPgliDBId4Aoc9hGSMAiwHAoFniXGCdAuHU4Uri?= =?us-ascii?q?iqGKQIEAgQFAgUPIYEEHIIKcIEBghKCFAkCAQ4Jg0WKHDUdU3krjQABAQ?= X-IronPort-AV: E=Sophos;i="5.49,431,1520899200"; d="scan'208";a="12074966" 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; 23 May 2018 01:20:52 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;4b3d9b24-d772-47ff-8d0d-6e242f15b4ff Authentication-Results: ucol19pa15.eemsg.mail.mil; dkim=pass (signature verified) header.i=@gmail.com X-EEMSG-check-008: 567435063|UCOL19PA15_EEMSG_MP13.csd.disa.mil X-EEMSG-SBRS: 3.4 X-EEMSG-ORIG-IP: 209.85.220.194 X-EEMSG-check-002: true X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C0AACcvgRbhsLcVdFcHAEBAQQBAQoBAYVKi3pfjBaCbhqTNoF4CyyEQAKCISE0GAECAQEBAQEBAhQBAQEICwsIKCMMhSkDAycZARsdAQMMBhA7IQIRAQUBHAcSgyKBaAEDFZ5lPIxuFgUBF4JwBX8EAYJIChkmDVRXgXQCBgkBCIcnfIFUP4EPgliDBId4Aoc9hGSMAiwHAoFniXGCdAuHU4UriiqGKQIEAgQFAgUPIYEEHIIKcIEBghKCFAkCAQ4Jg0WKHDUdU3krjRoBAQ X-IPAS-Result: A0C0AACcvgRbhsLcVdFcHAEBAQQBAQoBAYVKi3pfjBaCbhqTNoF4CyyEQAKCISE0GAECAQEBAQEBAhQBAQEICwsIKCMMhSkDAycZARsdAQMMBhA7IQIRAQUBHAcSgyKBaAEDFZ5lPIxuFgUBF4JwBX8EAYJIChkmDVRXgXQCBgkBCIcnfIFUP4EPgliDBId4Aoc9hGSMAiwHAoFniXGCdAuHU4UriiqGKQIEAgQFAgUPIYEEHIIKcIEBghKCFAkCAQ4Jg0WKHDUdU3krjRoBAQ Received: from mail-qk0-f194.google.com ([209.85.220.194]) by ucol19pa15.eemsg.mail.mil with ESMTP; 23 May 2018 01:20:50 +0000 Received: by mail-qk0-f194.google.com with SMTP id h19-v6so16193049qkj.10 for ; Tue, 22 May 2018 18:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fqcIWIBm6Hyuq9PYogvdxrGWMM3tXyyxXhWyaGvXexk=; b=boMSu9UgWT7WoWR5EsJQv17c1oGWU52qqxg/uCwCxvfCpaHAM37Kgja4ujNJO9duIp 8NGIXrGDmOGv2Ilqrl97+SZ6XpB1d0bZFlVC3aPnHseK6Jl1LsLtLXREBqPU7Q+GY9JD hKfXRTRn203tK4brIFhB+jZQnicnwVS1bWNwUocnmyWIByltJbhEfigRp+/2baP+pza4 1oYPrhlyzFuiJFiaFAD/KI6k8L/mhfJa/Qz/vQLrZkh0p88BNPldzFkuCN99Eqsekrmu bI0xHNhwIOn5pC1u5W+WDmk5dl8eiqXfruPPao31rhkveoyWGQXtO6iUz6dd2lH3myFn GFDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fqcIWIBm6Hyuq9PYogvdxrGWMM3tXyyxXhWyaGvXexk=; b=XBet7BNl7ivGGhO2TVvuLM2Mi70BJDM7WKW2bJz5C0Gd3lGJOsKUoi+ROCmxU37Mbv C6CaLeIM7zJA+Aiw8H6kgcr/v8DhPx1PI9azwzuJsm250jnd7NmbRH84XJuurY8X4CNZ XoyrxAXFblZLTKvP4jRexTnxTWDy8Rr8RFf/2a7SLGWp56OMgo4qLUlRb4z+Ni+IA0nD bphogNTlVNXa0W2m0QMtOf5AiW4n4elMhtw6FsBawuvgMrFSi8lyhn3yYzltBN5WqQZf 6CzWqvruiq4x9ifqtssAvy29De8qymyJk57wpXdRA37VUJluYgWYuAbyi4kBNrpI63WN gaZQ== X-Gm-Message-State: ALKqPweh1Gxxc0XTis4x4PCxmB1r5RJToYHbnqjGj3U7tEJXMkUgluTe KCK1fNS2kGIGD+K1MUdXcw== X-Google-Smtp-Source: ADUXVKJPfvt62dnPglmMdPj1aPYwU9eQPEEFJMR5beK0ArowsMnILg940l4v3+tXUaJqqU9fxSgq3Q== X-Received: by 2002:a37:6747:: with SMTP id b68-v6mr709134qkc.108.1527038329840; Tue, 22 May 2018 18:18:49 -0700 (PDT) Received: from localhost.localdomain (c-71-234-172-214.hsd1.vt.comcast.net. [71.234.172.214]) by smtp.gmail.com with ESMTPSA id s127-v6sm12604251qkf.21.2018.05.22.18.18.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 18:18:48 -0700 (PDT) X-EEMSG-check-009: 444-444 From: Kent Overstreet To: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, willy@infradead.org, gregkh@linuxfoundation.org, linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, dev@openvswitch.org, shli@kernel.org, linux-raid@vger.kernel.org Date: Tue, 22 May 2018 21:18:20 -0400 Message-Id: <20180523011821.12165-5-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523011821.12165-1-kent.overstreet@gmail.com> References: <20180523011821.12165-1-kent.overstreet@gmail.com> X-Mailman-Approved-At: Wed, 23 May 2018 08:03:44 -0400 Subject: [PATCH 5/6] selinux: convert to genradix 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: Kent Overstreet MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP the new generic radix trees have a simpler API and implementation, and no limitations on number of elements, so all flex_array users are being converted Signed-off-by: Kent Overstreet --- security/selinux/ss/avtab.c | 44 +++++------ security/selinux/ss/avtab.h | 5 +- security/selinux/ss/conditional.c | 8 +- security/selinux/ss/policydb.c | 127 +++++++++++------------------- security/selinux/ss/policydb.h | 12 ++- security/selinux/ss/services.c | 25 +++--- 6 files changed, 86 insertions(+), 135 deletions(-) diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c index 2c3c7d010d..7066d52e74 100644 --- a/security/selinux/ss/avtab.c +++ b/security/selinux/ss/avtab.c @@ -93,12 +93,10 @@ avtab_insert_node(struct avtab *h, int hvalue, newnode->next = prev->next; prev->next = newnode; } else { - newnode->next = flex_array_get_ptr(h->htable, hvalue); - if (flex_array_put_ptr(h->htable, hvalue, newnode, - GFP_KERNEL|__GFP_ZERO)) { - kmem_cache_free(avtab_node_cachep, newnode); - return NULL; - } + struct avtab_node **n = genradix_ptr(&h->htable, hvalue); + + newnode->next = *n; + *n = newnode; } h->nel++; @@ -111,11 +109,11 @@ static int avtab_insert(struct avtab *h, struct avtab_key *key, struct avtab_dat struct avtab_node *prev, *cur, *newnode; u16 specified = key->specified & ~(AVTAB_ENABLED|AVTAB_ENABLED_OLD); - if (!h || !h->htable) + if (!h) return -EINVAL; hvalue = avtab_hash(key, h->mask); - for (prev = NULL, cur = flex_array_get_ptr(h->htable, hvalue); + for (prev = NULL, cur = *genradix_ptr(&h->htable, hvalue); cur; prev = cur, cur = cur->next) { if (key->source_type == cur->key.source_type && @@ -156,10 +154,10 @@ avtab_insert_nonunique(struct avtab *h, struct avtab_key *key, struct avtab_datu struct avtab_node *prev, *cur; u16 specified = key->specified & ~(AVTAB_ENABLED|AVTAB_ENABLED_OLD); - if (!h || !h->htable) + if (!h) return NULL; hvalue = avtab_hash(key, h->mask); - for (prev = NULL, cur = flex_array_get_ptr(h->htable, hvalue); + for (prev = NULL, cur = *genradix_ptr(&h->htable, hvalue); cur; prev = cur, cur = cur->next) { if (key->source_type == cur->key.source_type && @@ -186,11 +184,11 @@ struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *key) struct avtab_node *cur; u16 specified = key->specified & ~(AVTAB_ENABLED|AVTAB_ENABLED_OLD); - if (!h || !h->htable) + if (!h) return NULL; hvalue = avtab_hash(key, h->mask); - for (cur = flex_array_get_ptr(h->htable, hvalue); cur; + for (cur = *genradix_ptr(&h->htable, hvalue); cur; cur = cur->next) { if (key->source_type == cur->key.source_type && key->target_type == cur->key.target_type && @@ -222,11 +220,11 @@ avtab_search_node(struct avtab *h, struct avtab_key *key) struct avtab_node *cur; u16 specified = key->specified & ~(AVTAB_ENABLED|AVTAB_ENABLED_OLD); - if (!h || !h->htable) + if (!h) return NULL; hvalue = avtab_hash(key, h->mask); - for (cur = flex_array_get_ptr(h->htable, hvalue); cur; + for (cur = *genradix_ptr(&h->htable, hvalue); cur; cur = cur->next) { if (key->source_type == cur->key.source_type && key->target_type == cur->key.target_type && @@ -281,11 +279,11 @@ void avtab_destroy(struct avtab *h) int i; struct avtab_node *cur, *temp; - if (!h || !h->htable) + if (!h) return; for (i = 0; i < h->nslot; i++) { - cur = flex_array_get_ptr(h->htable, i); + cur = *genradix_ptr(&h->htable, i); while (cur) { temp = cur; cur = cur->next; @@ -295,15 +293,14 @@ void avtab_destroy(struct avtab *h) kmem_cache_free(avtab_node_cachep, temp); } } - flex_array_free(h->htable); - h->htable = NULL; + genradix_free(&h->htable); h->nslot = 0; h->mask = 0; } int avtab_init(struct avtab *h) { - h->htable = NULL; + genradix_init(&h->htable); h->nel = 0; return 0; } @@ -329,9 +326,8 @@ int avtab_alloc(struct avtab *h, u32 nrules) nslot = MAX_AVTAB_HASH_BUCKETS; mask = nslot - 1; - h->htable = flex_array_alloc(sizeof(struct avtab_node *), nslot, - GFP_KERNEL | __GFP_ZERO); - if (!h->htable) + genradix_init(&h->htable); + if (genradix_prealloc(&h->htable, nslot, GFP_KERNEL)) return -ENOMEM; avtab_alloc_out: @@ -353,7 +349,7 @@ void avtab_hash_eval(struct avtab *h, char *tag) max_chain_len = 0; chain2_len_sum = 0; for (i = 0; i < h->nslot; i++) { - cur = flex_array_get_ptr(h->htable, i); + cur = *genradix_ptr(&h->htable, i); if (cur) { slots_used++; chain_len = 0; @@ -645,7 +641,7 @@ int avtab_write(struct policydb *p, struct avtab *a, void *fp) return rc; for (i = 0; i < a->nslot; i++) { - for (cur = flex_array_get_ptr(a->htable, i); cur; + for (cur = *genradix_ptr(&a->htable, i); cur; cur = cur->next) { rc = avtab_write_item(p, cur, fp); if (rc) diff --git a/security/selinux/ss/avtab.h b/security/selinux/ss/avtab.h index 725853cadc..7f00c41e96 100644 --- a/security/selinux/ss/avtab.h +++ b/security/selinux/ss/avtab.h @@ -24,7 +24,7 @@ #define _SS_AVTAB_H_ #include "security.h" -#include +#include struct avtab_key { u16 source_type; /* source type */ @@ -84,11 +84,10 @@ struct avtab_node { }; struct avtab { - struct flex_array *htable; + GENRADIX(struct avtab_node *) htable; u32 nel; /* number of elements */ u32 nslot; /* number of hash slots */ u32 mask; /* mask to compute hash func */ - }; int avtab_init(struct avtab *); diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index c91543a617..d25ef70748 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c @@ -195,7 +195,6 @@ int cond_index_bool(void *key, void *datum, void *datap) { struct policydb *p; struct cond_bool_datum *booldatum; - struct flex_array *fa; booldatum = datum; p = datap; @@ -203,10 +202,9 @@ int cond_index_bool(void *key, void *datum, void *datap) if (!booldatum->value || booldatum->value > p->p_bools.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_BOOLS]; - if (flex_array_put_ptr(fa, booldatum->value - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->sym_val_to_name[SYM_BOOLS], + booldatum->value - 1) = key; + p->bool_val_to_struct[booldatum->value - 1] = booldatum; return 0; diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 6e8c8056d7..3df39258c9 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "security.h" #include "policydb.h" @@ -341,17 +340,15 @@ static int common_index(void *key, void *datum, void *datap) { struct policydb *p; struct common_datum *comdatum; - struct flex_array *fa; comdatum = datum; p = datap; if (!comdatum->value || comdatum->value > p->p_commons.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_COMMONS]; - if (flex_array_put_ptr(fa, comdatum->value - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->sym_val_to_name[SYM_COMMONS], + comdatum->value - 1) = key; + return 0; } @@ -359,16 +356,15 @@ static int class_index(void *key, void *datum, void *datap) { struct policydb *p; struct class_datum *cladatum; - struct flex_array *fa; cladatum = datum; p = datap; if (!cladatum->value || cladatum->value > p->p_classes.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_CLASSES]; - if (flex_array_put_ptr(fa, cladatum->value - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + + *genradix_ptr(&p->sym_val_to_name[SYM_CLASSES], + cladatum->value - 1) = key; + p->class_val_to_struct[cladatum->value - 1] = cladatum; return 0; } @@ -377,7 +373,6 @@ static int role_index(void *key, void *datum, void *datap) { struct policydb *p; struct role_datum *role; - struct flex_array *fa; role = datum; p = datap; @@ -386,10 +381,9 @@ static int role_index(void *key, void *datum, void *datap) || role->bounds > p->p_roles.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_ROLES]; - if (flex_array_put_ptr(fa, role->value - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->sym_val_to_name[SYM_ROLES], + role->value - 1) = key; + p->role_val_to_struct[role->value - 1] = role; return 0; } @@ -398,7 +392,6 @@ static int type_index(void *key, void *datum, void *datap) { struct policydb *p; struct type_datum *typdatum; - struct flex_array *fa; typdatum = datum; p = datap; @@ -408,15 +401,11 @@ static int type_index(void *key, void *datum, void *datap) || typdatum->value > p->p_types.nprim || typdatum->bounds > p->p_types.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_TYPES]; - if (flex_array_put_ptr(fa, typdatum->value - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->sym_val_to_name[SYM_TYPES], + typdatum->value - 1) = key; - fa = p->type_val_to_struct_array; - if (flex_array_put_ptr(fa, typdatum->value - 1, typdatum, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->type_val_to_struct_array, + typdatum->value - 1) = typdatum; } return 0; @@ -426,7 +415,6 @@ static int user_index(void *key, void *datum, void *datap) { struct policydb *p; struct user_datum *usrdatum; - struct flex_array *fa; usrdatum = datum; p = datap; @@ -435,10 +423,9 @@ static int user_index(void *key, void *datum, void *datap) || usrdatum->bounds > p->p_users.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_USERS]; - if (flex_array_put_ptr(fa, usrdatum->value - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->sym_val_to_name[SYM_USERS], + usrdatum->value - 1) = key; + p->user_val_to_struct[usrdatum->value - 1] = usrdatum; return 0; } @@ -447,7 +434,6 @@ static int sens_index(void *key, void *datum, void *datap) { struct policydb *p; struct level_datum *levdatum; - struct flex_array *fa; levdatum = datum; p = datap; @@ -456,10 +442,8 @@ static int sens_index(void *key, void *datum, void *datap) if (!levdatum->level->sens || levdatum->level->sens > p->p_levels.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_LEVELS]; - if (flex_array_put_ptr(fa, levdatum->level->sens - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->sym_val_to_name[SYM_LEVELS], + levdatum->level->sens - 1) = key; } return 0; @@ -469,7 +453,6 @@ static int cat_index(void *key, void *datum, void *datap) { struct policydb *p; struct cat_datum *catdatum; - struct flex_array *fa; catdatum = datum; p = datap; @@ -477,10 +460,8 @@ static int cat_index(void *key, void *datum, void *datap) if (!catdatum->isalias) { if (!catdatum->value || catdatum->value > p->p_cats.nprim) return -EINVAL; - fa = p->sym_val_to_name[SYM_CATS]; - if (flex_array_put_ptr(fa, catdatum->value - 1, key, - GFP_KERNEL | __GFP_ZERO)) - BUG(); + *genradix_ptr(&p->sym_val_to_name[SYM_CATS], + catdatum->value - 1) = key; } return 0; @@ -566,15 +547,10 @@ static int policydb_index(struct policydb *p) if (!p->user_val_to_struct) return -ENOMEM; - /* Yes, I want the sizeof the pointer, not the structure */ - p->type_val_to_struct_array = flex_array_alloc(sizeof(struct type_datum *), - p->p_types.nprim, - GFP_KERNEL | __GFP_ZERO); - if (!p->type_val_to_struct_array) - return -ENOMEM; + genradix_init(&p->type_val_to_struct_array); - rc = flex_array_prealloc(p->type_val_to_struct_array, 0, - p->p_types.nprim, GFP_KERNEL | __GFP_ZERO); + rc = genradix_prealloc(&p->type_val_to_struct_array, + p->p_types.nprim, GFP_KERNEL); if (rc) goto out; @@ -583,15 +559,10 @@ static int policydb_index(struct policydb *p) goto out; for (i = 0; i < SYM_NUM; i++) { - p->sym_val_to_name[i] = flex_array_alloc(sizeof(char *), - p->symtab[i].nprim, - GFP_KERNEL | __GFP_ZERO); - if (!p->sym_val_to_name[i]) - return -ENOMEM; + genradix_init(&p->sym_val_to_name[i]); - rc = flex_array_prealloc(p->sym_val_to_name[i], - 0, p->symtab[i].nprim, - GFP_KERNEL | __GFP_ZERO); + rc = genradix_prealloc(&p->sym_val_to_name[i], + p->symtab[i].nprim, GFP_KERNEL); if (rc) goto out; @@ -807,16 +778,13 @@ void policydb_destroy(struct policydb *p) hashtab_destroy(p->symtab[i].table); } - for (i = 0; i < SYM_NUM; i++) { - if (p->sym_val_to_name[i]) - flex_array_free(p->sym_val_to_name[i]); - } + for (i = 0; i < SYM_NUM; i++) + genradix_free(&p->sym_val_to_name[i]); kfree(p->class_val_to_struct); kfree(p->role_val_to_struct); kfree(p->user_val_to_struct); - if (p->type_val_to_struct_array) - flex_array_free(p->type_val_to_struct_array); + genradix_free(&p->type_val_to_struct_array); avtab_destroy(&p->te_avtab); @@ -869,17 +837,15 @@ void policydb_destroy(struct policydb *p) hashtab_map(p->range_tr, range_tr_destroy, NULL); hashtab_destroy(p->range_tr); - if (p->type_attr_map_array) { - for (i = 0; i < p->p_types.nprim; i++) { - struct ebitmap *e; + for (i = 0; i < p->p_types.nprim; i++) { + struct ebitmap *e; - e = flex_array_get(p->type_attr_map_array, i); - if (!e) - continue; - ebitmap_destroy(e); - } - flex_array_free(p->type_attr_map_array); + e = genradix_ptr(&p->type_attr_map_array, i); + if (!e) + continue; + ebitmap_destroy(e); } + genradix_free(&p->type_attr_map_array); ebitmap_destroy(&p->filename_trans_ttypes); ebitmap_destroy(&p->policycaps); @@ -1760,8 +1726,8 @@ static int type_bounds_sanity_check(void *key, void *datum, void *datap) return -EINVAL; } - upper = flex_array_get_ptr(p->type_val_to_struct_array, - upper->bounds - 1); + upper = *genradix_ptr(&p->type_val_to_struct_array, + upper->bounds - 1); BUG_ON(!upper); if (upper->attribute) { @@ -2518,21 +2484,16 @@ int policydb_read(struct policydb *p, void *fp) if (rc) goto bad; - rc = -ENOMEM; - p->type_attr_map_array = flex_array_alloc(sizeof(struct ebitmap), - p->p_types.nprim, - GFP_KERNEL | __GFP_ZERO); - if (!p->type_attr_map_array) - goto bad; + genradix_init(&p->type_attr_map_array); /* preallocate so we don't have to worry about the put ever failing */ - rc = flex_array_prealloc(p->type_attr_map_array, 0, p->p_types.nprim, - GFP_KERNEL | __GFP_ZERO); + rc = genradix_prealloc(&p->type_attr_map_array, p->p_types.nprim, + GFP_KERNEL); if (rc) goto bad; for (i = 0; i < p->p_types.nprim; i++) { - struct ebitmap *e = flex_array_get(p->type_attr_map_array, i); + struct ebitmap *e = genradix_ptr(&p->type_attr_map_array, i); BUG_ON(!e); ebitmap_init(e); @@ -3523,7 +3484,7 @@ int policydb_write(struct policydb *p, void *fp) return rc; for (i = 0; i < p->p_types.nprim; i++) { - struct ebitmap *e = flex_array_get(p->type_attr_map_array, i); + struct ebitmap *e = genradix_ptr(&p->type_attr_map_array, i); BUG_ON(!e); rc = ebitmap_write(e, fp); diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h index 215f8f30ac..1ba102463e 100644 --- a/security/selinux/ss/policydb.h +++ b/security/selinux/ss/policydb.h @@ -24,7 +24,7 @@ #ifndef _SS_POLICYDB_H_ #define _SS_POLICYDB_H_ -#include +#include #include "symtab.h" #include "avtab.h" @@ -251,13 +251,13 @@ struct policydb { #define p_cats symtab[SYM_CATS] /* symbol names indexed by (value - 1) */ - struct flex_array *sym_val_to_name[SYM_NUM]; + GENRADIX(char *) sym_val_to_name[SYM_NUM]; /* class, role, and user attributes indexed by (value - 1) */ struct class_datum **class_val_to_struct; struct role_datum **role_val_to_struct; struct user_datum **user_val_to_struct; - struct flex_array *type_val_to_struct_array; + GENRADIX(struct type_datum *) type_val_to_struct_array; /* type enforcement access vectors and transitions */ struct avtab te_avtab; @@ -294,7 +294,7 @@ struct policydb { struct hashtab *range_tr; /* type -> attribute reverse mapping */ - struct flex_array *type_attr_map_array; + GENRADIX(struct ebitmap) type_attr_map_array; struct ebitmap policycaps; @@ -369,9 +369,7 @@ static inline int put_entry(const void *buf, size_t bytes, int num, struct polic static inline char *sym_name(struct policydb *p, unsigned int sym_num, unsigned int element_nr) { - struct flex_array *fa = p->sym_val_to_name[sym_num]; - - return flex_array_get_ptr(fa, element_nr); + return *genradix_ptr(&p->sym_val_to_name[sym_num], element_nr); } extern u16 string_to_security_class(struct policydb *p, const char *name); diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 8900ea5cba..79a56e4653 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include @@ -562,15 +561,15 @@ static void type_attribute_bounds_av(struct context *scontext, struct type_datum *target; u32 masked = 0; - source = flex_array_get_ptr(policydb.type_val_to_struct_array, - scontext->type - 1); + source = *genradix_ptr(&policydb.type_val_to_struct_array, + scontext->type - 1); BUG_ON(!source); if (!source->bounds) return; - target = flex_array_get_ptr(policydb.type_val_to_struct_array, - tcontext->type - 1); + target = *genradix_ptr(&policydb.type_val_to_struct_array, + tcontext->type - 1); BUG_ON(!target); memset(&lo_avd, 0, sizeof(lo_avd)); @@ -669,9 +668,9 @@ static void context_struct_compute_av(struct context *scontext, */ avkey.target_class = tclass; avkey.specified = AVTAB_AV | AVTAB_XPERMS; - sattr = flex_array_get(policydb.type_attr_map_array, scontext->type - 1); + sattr = genradix_ptr(&policydb.type_attr_map_array, scontext->type - 1); BUG_ON(!sattr); - tattr = flex_array_get(policydb.type_attr_map_array, tcontext->type - 1); + tattr = genradix_ptr(&policydb.type_attr_map_array, tcontext->type - 1); BUG_ON(!tattr); ebitmap_for_each_positive_bit(sattr, snode, i) { ebitmap_for_each_positive_bit(tattr, tnode, j) { @@ -895,8 +894,8 @@ int security_bounded_transition(u32 old_sid, u32 new_sid) index = new_context->type; while (true) { - type = flex_array_get_ptr(policydb.type_val_to_struct_array, - index - 1); + type = *genradix_ptr(&policydb.type_val_to_struct_array, + index - 1); BUG_ON(!type); /* not bounded anymore */ @@ -1053,11 +1052,11 @@ void security_compute_xperms_decision(u32 ssid, avkey.target_class = tclass; avkey.specified = AVTAB_XPERMS; - sattr = flex_array_get(policydb.type_attr_map_array, - scontext->type - 1); + sattr = genradix_ptr(&policydb.type_attr_map_array, + scontext->type - 1); BUG_ON(!sattr); - tattr = flex_array_get(policydb.type_attr_map_array, - tcontext->type - 1); + tattr = genradix_ptr(&policydb.type_attr_map_array, + tcontext->type - 1); BUG_ON(!tattr); ebitmap_for_each_positive_bit(sattr, snode, i) { ebitmap_for_each_positive_bit(tattr, tnode, j) {