From patchwork Fri May 11 00:54:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10394431 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 214CB60170 for ; Fri, 11 May 2018 14:41:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1233F28E99 for ; Fri, 11 May 2018 14:41:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 108EC28EA4; Fri, 11 May 2018 14:41:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,NO_RDNS_DOTCOM_HELO,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from ucol19pa09.eemsg.mail.mil (ucol19pa09.eemsg.mail.mil [214.24.24.82]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 428B628EAC for ; Fri, 11 May 2018 14:41:09 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.49,389,1520899200"; d="scan'208";a="695328125" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by ucol19pa09.eemsg.mail.mil with ESMTP; 11 May 2018 14:41:07 +0000 X-IronPort-AV: E=Sophos;i="5.49,389,1520899200"; d="scan'208";a="13190399" IronPort-PHdr: =?us-ascii?q?9a23=3AEFdj0herncUrd49MkFbvBgJtlGMj4u6mDksu8p?= =?us-ascii?q?Mizoh2WeGdxcq6ZxKN2/xhgRfzUJnB7Loc0qyK6/umATRIyK3CmUhKSIZLWR?= =?us-ascii?q?4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBx?= =?us-ascii?q?rwKxd+KPjrFY7OlcS30P2594HObwlSizexfb1/IA+qoQnNq8IbnZZsJqEtxx?= =?us-ascii?q?XTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM3?= =?us-ascii?q?0u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xy?= =?us-ascii?q?mp4rx1QxH0ligIKz858HnWisNuiqJbvAmhrAF7z4LNfY2ZKOZycqbbcNwUX2?= =?us-ascii?q?pBWttaWTJHDI2ycoADC/MNMftEo4X4oVYBqhmxChOsBOPozT9En2b60LE03u?= =?us-ascii?q?kgDA3KxRAsE88Tu3jQstn5KKIeXOaox6fK0DrDdetb1ynz6IbIcR4vr/+DUr?= =?us-ascii?q?1yfsXNxkchChvFg1eNpYHrITyVzf8As3SZ4ud6Se6jl2AqpgN3rzOyxskskI?= =?us-ascii?q?7JhocNx13a7yp525g6JN2lQ0BmfdGkEIFftzyUN4tyXMwiWXxjtSEmxbIcop?= =?us-ascii?q?60YigLxY88xxHDa/yIaZWI4hznVOmPOzd0nW5qd6ilixmu9kigz/TxW8+p21?= =?us-ascii?q?hJtipIisTAu38C2hDJ6sWLV+Fx8lmu1DqRzQzf9/lILEE2mKbBNpIsw7o9mo?= =?us-ascii?q?ASvEnDBCP6hlv6gaCQe0454Oan8f7nba/jppKEMo90jRzxPbo2l8ykBOQ4Lh?= =?us-ascii?q?AOX2+G+eSgzLHj/VP2QLFNjvAujqnWqoraJcUGpq6iGQNVzoYi5Aq/Dzehyt?= =?us-ascii?q?gYm2UILElZdx6diojpOlXOLOj5Dfe5nVusjC9my+3JM7DuGJnALmXPnK3/cb?= =?us-ascii?q?ty9UJQ0hc/wcha551OC7EBJPzzWlX2tNzdFhI5KBK7w+LmCNV7y4MfVnuDDb?= =?us-ascii?q?SeMKPPt1+H+vwgI/K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WPMHdiAOMn2kpfXX?= =?us-ascii?q?B5HMHZlCsVRywRiS3Nc9aRpA2g9S1vssC/7PPrVRrh5YSVDbtSLdJv+xWtjK?= =?us-ascii?q?eNKeGfmSF5KSxC2ZMU33/Iz7of00AOhCFybTWtFq4AtSHVRqLKhqBXFwIbaz?= =?us-ascii?q?90NMZQ8q0zwgxNOcnditPpy7J1leA1BElfVVzgm8CpYsoKL3u7NFzZGEaBLK?= =?us-ascii?q?6GKiHTw8HrfaO8TqVdjOtOtxKupDmbCFXsPjKflznuTBCiKvtDgz2ePBBEv4?= =?us-ascii?q?G9aBltA3D5TN36ch27LMN3jTouzL0ynHPFL3YcMSBnfkNDr72Q9zhYgulxG2?= =?us-ascii?q?xA6HpqN++ElDqY7+bCLpYaq/xrAj57l+hC+nQ116NV7D1YRPxygCbdtcVhr1?= =?us-ascii?q?aikumO0TpnTAFOpixQhI2VoUpuI77Z+YdEWXbF+hIN8GqRBg8WqNplEN3vpr?= =?us-ascii?q?tQxsLBla3pNDdC6NXU/c0GC8jTMsKHP2IrMQD1Fz7MEAsFUTmrOHnZh0xclP?= =?us-ascii?q?GS8mOaroMhp5f2hpUOULhbWEYyFvMABURvBMYCL4tvXjM4jb6bi9YF6mG/rB?= =?us-ascii?q?neQ8VauIvKWe+MDvr0KTaWl79EawEPwbPiIoQZLpf71FB6allmgITKHFLdUs?= =?us-ascii?q?pCoiJ7cA87vl5A8H9mTmIt3ULlbxmi4H4XFfGvmR43hRFyYeM39Dfj+103PE?= =?us-ascii?q?bFpDMskEktntXomSyRcDn0LKuqR4FWDCv1uFY3MpzgWQZ1ahO9nU9/OTjYQL?= =?us-ascii?q?JRiqdvenpwiA/Ao5dPH+BTTbFcah8K2f6Xf+ko0Uhbqii/x09H5evECYNllA?= =?us-ascii?q?sucJ6ss2xP1hlmbN40OazQPrRGwkJXhqKUsS+izvoxzxMGJ0YR7GOSfzYFuE?= =?us-ascii?q?oWObY8Iyql5e9s6QuZmztfYmcMUeEqovFr9k8n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ii?q?J0S9yqpfL+2kI251ixNAAGwato5YeZ/qqIuO7XYAfQzbceXKjqXdn/rrM2u0?= =?us-ascii?q?Od/fckjqIBenRpYw27F+gQTswdyX3mzaAk1yIsFN7MEKz79f5fTX05mCngm5?= =?us-ascii?q?dnE1UQBPwUAaKB/Z5CkWcgh+zZKtoWf7hNmmaSFB6kFrsCxmCu6yaMPWZqnA?= =?us-ascii?q?rB0xDqTmO19lP2qjV4QSTUxdf5jkVVTqW3BVtVXyexO094sTaPMRHttNXpua?= =?us-ascii?q?U68ls2Mm3itNKCjmehPq1YH9HnLtyGPSY0vE4XjIE2RtG334AbHcGwINYX8H?= =?us-ascii?q?F7dPfe6mWrkyFbo6hdnIre/tuV+ujLEnm8kq2asauCyCpfyngislE18sqgOe?= =?us-ascii?q?3W592WX/So0H4cTyJ4uwvHQx61paLUoksROUyKykjLnpIFPs1X3Hk/zEHm5/?= =?us-ascii?q?MjTMg19ApACobKf+kCqizrODvo3VafZMo6Vi2F0ztSHl/4Cld4F7Yh12L3ps?= =?us-ascii?q?LGj2/Q+0cvRolyaUPomQB3A58/KUI351gd2jADHhQVaRCHELGoAlzoLYoFVE?= =?us-ascii?q?cZcxuIwKO3erwp0k1v3Lyg+PXfbetmB6oCLvxdlBKBnEBHGpIKtq0TWKlze1?= =?us-ascii?q?5G9K/ZvAfiCYnnX+T+lXUqKP21RttX/twet3Q//AmwXQeg6Y1E77YBkp+EbK?= =?us-ascii?q?lEYYLDvMpk9Udo+SYPdjBRgBh4lx65SfoTpPz/7djbvpuo7fyuVKU0S+UM6R?= =?us-ascii?q?c0A2V+j53tgFEsutzXz/1TSpHJhoT//gFNJGSKuIXA3xl/N+UOMYSrc6hk93?= =?us-ascii?q?kdICgePX0ON8KMa/Yg+y9tLCnT51taD8MDf9wYJtTCmRxUikDyXLFT99bbFU?= =?us-ascii?q?GYC4hpasAo9HD7yDYr/psgSuzg8iO5JYjD71FROPNOlCpsm8zEpOgJxvrSDy?= =?us-ascii?q?8b4WK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?= =?us-ascii?q?5u9+fQD14xrPNTc46NndjMgNR2yesFeO1xPi09u94TnIVj5JKK0MeLdxHe0J?= =?us-ascii?q?LyJdDToviFDPzT1UMqentVUrABewP6+506PsIlW73UBbZZvw4TBas9QJM6LG?= =?us-ascii?q?rx6ad0LB9zcg7WebS0jcnqpv6RaptSuXDW8ko6LD3AtB0b1vy0UQt7Yoixh3?= =?us-ascii?q?X8JZA/WjNMot52Bxt4AoRPAcIArgugA56Sgq27jcG++18p89MN5I7LL7ie0N?= =?us-ascii?q?W/wpU0RJVR+FaKICeUAa5nn0Bopvq9j+2G0ZTrD87mP9QeW74/CkrmTpqOSo?= =?us-ascii?q?G+LC+ef8HxYUhL95aC379jFBacfib0W+yBriLycL1c6Fg/gql/e/DehGg15q?= =?us-ascii?q?zf8MP7emUeoyCkt3PPP5xauhiCPvDTRxJZT7K+9W9hGaAGJd/v+PwmLc0pwN?= =?us-ascii?q?/a5RJ6qjtFzp3Ba5OM5mvN3F9rPcbAIU/o3TspcZUbKxS4d003iCnWrWqLRT?= =?us-ascii?q?wWFe2NAuoojNeOBQH2/GF1mHoxfSgZQyzvX9jbcTwg/uuVR0iG9RlAEs0Yt+?= =?us-ascii?q?q2YlIj8PXrD+5yNcMB0cettLNPs9FpIifUSc4SayPXLLkwPD1RB+PUqV4AaR?= =?us-ascii?q?cCtL40UY4xI5OJJRVDeGSNxDi65gzF0gWgdNGhz62OJyU++XVdyLfEzD0KoB?= =?us-ascii?q?O277LRvsD/S63eJLH/WvLbeH49WzeVWDU0VEWk41Gpv9IF+f6fP2pZuVkXfz?= =?us-ascii?q?ibTgge4KJ3+5yYLGbWlPYrWZoQnvGBE3TyTSpijqspLiBCsE2NBf0ZGl+FQW?= =?us-ascii?q?XmhT93sRevN7d39nLscrOcy7AdD+cfGYZdWuaSQ9LFd/RTPXIjn3MSP+PqLI?= =?us-ascii?q?6UlKowzl+dFThRKKLP7lDLCR/OGKbOzi/3XYgTo4k/szYp/dSVhCJsDqDUJO?= =?us-ascii?q?nO9QOF1arjpx6x4LWYW2QoeENzhesDBC+EwR0TTQNMB9IUvRT1S7WbLwZX1X?= =?us-ascii?q?0vgP5zwRJEZglpU3Nv33EX1PawE8FUUxgV2Uu/Sf0BaxZ8CzY9?= X-IPAS-Result: =?us-ascii?q?A2DNCQDMqvVa/wHyM5BcGwEBAQEDAQEBCQEBAYNAA4FcK?= =?us-ascii?q?INyiGKMEYF5dRqBQJNiLhMBhEACRYJDITgUAQIBAQEBAQECAWscDII1JIJPA?= =?us-ascii?q?QMDAQIgBBkBATgCAwkBARsDAQIDAiIEAgIDAUEKCAYBDAYCAQEBgx6BaQMVA?= =?us-ascii?q?6FHihhtgWkzgm8BAQWBAgEBXoI0A4E1gkAIF3KEeIIkghOBDyOCMweCAoM4g?= =?us-ascii?q?meCVIcyCIVBPIp8CY5LZIcThHiLNYZKMyGBUk0jFYJ+ghQMF4NFihwBVU96A?= =?us-ascii?q?QGQFQEB?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 11 May 2018 14:41:05 +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 w4BEf3b1003555; Fri, 11 May 2018 10:41:03 -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 w4B0t4Ov007168 for ; Thu, 10 May 2018 20:55:04 -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 w4B0tANt001841 for ; Thu, 10 May 2018 20:55:11 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1AIBACA6PRaly0YGNZcHQIFDINBgV8og?= =?us-ascii?q?3GIYIwQgXl1GoFAk2uEdwJFgjshOBQBAgEBAQEBAQIUAQEBAQEGGAZLhTQBAwM?= =?us-ascii?q?jBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWkDFQOgaIoYbYFpM4JvAQEFg?= =?us-ascii?q?QIBAV6COgOBNYJACBdyhHiCJIITgQ8jgjOCCYM4gmeCVIcwCIVBPIp6CY5JZIc?= =?us-ascii?q?ShHWCK4kHhkkzgXNNIxWCfoIgDgkRgzSKHAFVT5A7AQE?= X-IPAS-Result: =?us-ascii?q?A1AIBACA6PRaly0YGNZcHQIFDINBgV8og3GIYIwQgXl1GoF?= =?us-ascii?q?Ak2uEdwJFgjshOBQBAgEBAQEBAQIUAQEBAQEGGAZLhTQBAwMjBBkBATgPHAMBA?= =?us-ascii?q?gMCJgICRQoIBgEMBgIBAYMfgWkDFQOgaIoYbYFpM4JvAQEFgQIBAV6COgOBNYJ?= =?us-ascii?q?ACBdyhHiCJIITgQ8jgjOCCYM4gmeCVIcwCIVBPIp6CY5JZIcShHWCK4kHhkkzg?= =?us-ascii?q?XNNIxWCfoIgDgkRgzSKHAFVT5A7AQE?= X-IronPort-AV: E=Sophos;i="5.49,387,1520913600"; d="scan'208";a="274409" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.34]) by goalie.tycho.ncsc.mil with ESMTP; 10 May 2018 20:55:11 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3A7kWBPBOxburmitjKq50l6mtUPXoX/o7sNwtQ0K?= =?us-ascii?q?IMzox0K/76o8bcNUDSrc9gkEXOFd2Cra4c0KyO6+jJYi8p2d65qncMcZhBBV?= =?us-ascii?q?cuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx?= =?us-ascii?q?7xKRR6JvjvGo7Vks+7y/2+94fcbglUijexe69+IAmrpgjNq8cahpdvJLwswR?= =?us-ascii?q?XTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3?= =?us-ascii?q?sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Qi?= =?us-ascii?q?qp4bt1RxD0iScHLz85/3/Risxsl6JQvRatqwViz4LIfI2ZMfxzcaTfctwARW?= =?us-ascii?q?pBWcFRWzVYDo6gYYYCDvcNMf9Eo4XgulACqQWyCRWpCO7p1zRGhGL53bci3u?= =?us-ascii?q?o8Dw/G0gwuEdEAvnvao9r6NrsdX++uwanUzzjOde9a1Svz5YXKdB0qvPGCXa?= =?us-ascii?q?h3ccrU0UQiCRnKjk6Opo3lIjiby/gCs2iB4Op9W+Kvj3AoqxtsqTWo2sgjkJ?= =?us-ascii?q?LJiZwVy13f7iV23IY1KselSE51Zd6rDoFQuziGOIRsWM8tX2ZouCMjx7AApJ?= =?us-ascii?q?W1fzAKxYw5yxLCZPGLaZaE7x35WOqPLjp0nn1odbKnixuz80Ws0PDwW8iw3V?= =?us-ascii?q?pQrydIksPAum4T2xHc7MWMV+Fz8V272TmV0gDe8uFELl4wlarcM5MuzKA9mI?= =?us-ascii?q?MVv0nNACL4gln7gLOUe0k+5Oen9eHnYq7pppOGMo97kAD+MqA0lsy6AOQ4Nh?= =?us-ascii?q?ACX2md+euiyL3u5VP1TKhFg/EsjKXUv4rWKdoUq6KjDAJY0p4v6xOlADen1N?= =?us-ascii?q?QYk2MHLFVAeB+fk4fmIUrOL+74DPqkmFSjjDdryOrbPr3vBpXCMGLDnK79cr?= =?us-ascii?q?ln8UJT1A0zzdVH65JOFr4BOO7zWlP2tNHAFR82LQi0w+fhCNVg2YITQn6PA6?= =?us-ascii?q?+FP6PStl+E/OQvI/KWa4MPtzb9LOYltLbSiiodonpVKa2o24YHLWu1Fel8Il?= =?us-ascii?q?mIJH/rjsoFHE8UsQckCu/nkluPVXhUfXnkG+oYxRUeQNaiDIHeVsWujaaH0S?= =?us-ascii?q?OTAJJbfCZFB0qKHHOucJ+LDbNEUCuPJodElTseWPD1U4Y80Tm2vRL+jr9gKf?= =?us-ascii?q?DZvCYfsMSnnONp6vXTmBd6zjl9C8CQwinZVG1vtn8ZTD8xmqZkqApyzUnVle?= =?us-ascii?q?BDrrR8FNpO97sdSQo+NJjB38RmGtvyXUTHZd7PR1G4FJHuSwoUZ/kShtMPeE?= =?us-ascii?q?1gAM6KihHYwzHsW+ZTkKaETtRgyYf19Fu0K8dmwGvdz4EljkI6WY0XbCuhnK?= =?us-ascii?q?Eps0DxAI7P22eel6+sbqkalHrP82eFi2iJvEheSwN2ea7MW3cZZ0DfqZLy4U?= =?us-ascii?q?aUC/eNBLk8eiBGzs3KfqhHZ8biilJFbPzjItPbYn+03WCqCkDMjo+BcJH3fC?= =?us-ascii?q?091SPRAQBQiw0V8muHM009Cz2nrmb2DXlqEkziJVjl8vRkoTW9Qwk211fOJ2?= =?us-ascii?q?9o0reusjsSn+adULtH3LcDoj0gsB1yFVOw3pTREdXW9CR7e6AJStom7UYP7m?= =?us-ascii?q?nZvhFzOpG6Z/Rpj0UTYixstEPnyhtzB58FmsFsp3QvmlkhYZmE2U9MImvLla?= =?us-ascii?q?v7PafafyyipEr1OafLxlHT1sqX8a4T6fM+7k/upxytClF9rCda+P5xiFCkz8?= =?us-ascii?q?ySSgcfVIn+FEM+9hw8orDeMWEx5ILRgGVlKrL88iTD1NQgGPY/x16+cs1ePq?= =?us-ascii?q?KJGE66E8ATC8W0bu1/s0mgbhUDeutV8aM=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C6AwD46PRaly0YGNZcHQIFDINBgV8?= =?us-ascii?q?og3GIYIwQgXl1GoFAk2uEdwJFgjshOBQBAgEBAQEBAQIBEwEBAQEBBhgGSwy?= =?us-ascii?q?CNSSCTwEDAyMEGQEBOA8cAwECAwImAgJFCggGAQwGAgEBgx+BaQMVA6Boihh?= =?us-ascii?q?tgWkzgm8BAQWBAgEBXoI6A4E1gkAIF3KEeIIkghOBDyOCM4IJgziCZ4JUhzA?= =?us-ascii?q?IhUE8inoJjklkhxKEdYIriQeGSTOBc00jFYJ+giAOCRGDNIocAVVPkDsBAQ?= X-IPAS-Result: =?us-ascii?q?A0C6AwD46PRaly0YGNZcHQIFDINBgV8og3GIYIwQgXl1G?= =?us-ascii?q?oFAk2uEdwJFgjshOBQBAgEBAQEBAQIBEwEBAQEBBhgGSwyCNSSCTwEDAyMEG?= =?us-ascii?q?QEBOA8cAwECAwImAgJFCggGAQwGAgEBgx+BaQMVA6BoihhtgWkzgm8BAQWBA?= =?us-ascii?q?gEBXoI6A4E1gkAIF3KEeIIkghOBDyOCM4IJgziCZ4JUhzAIhUE8inoJjklkh?= =?us-ascii?q?xKEdYIriQeGSTOBc00jFYJ+giAOCRGDNIocAVVPkDsBAQ?= X-IronPort-AV: E=Sophos;i="5.49,387,1520899200"; d="scan'208";a="11679335" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from ucol3cpa07.eemsg.mail.mil ([214.24.24.45]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 11 May 2018 00:55:10 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;855c9a43-15d4-467d-be13-9bd1a9694d7b Authentication-Results: UCOL3CPA10.eemsg.mail.mil; dkim=pass (signature verified) header.i=@yahoo.com X-EEMSG-check-008: 30769423|UCOL3CPA10_EEMSG_MP25.csd.disa.mil X-EEMSG-SBRS: 3.5 X-EEMSG-ORIG-IP: 66.163.189.90 X-EEMSG-check-002: true X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ChAgCs6fRah1q9o0JcHQIFDIUgKINxiGCOCXUagUCTa4R3AkWCOyE4FAECAQEBAQEBAhQBAQEKCwkIKCMMhSgBAwMjBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWkDFaBsihhtgWkzgm8BAQWBAgEBXoI6A4E1gkAIF3KEeIQ3gQ8jgjMHggKDOIJnglSHMAiFQTyKegmOSWSHEoR1izKGSTOBc00jFYJ+giAOCYNFihwBVR8wkDsBAQ X-IPAS-Result: A0ChAgCs6fRah1q9o0JcHQIFDIUgKINxiGCOCXUagUCTa4R3AkWCOyE4FAECAQEBAQEBAhQBAQEKCwkIKCMMhSgBAwMjBBkBATgPHAMBAgMCJgICRQoIBgEMBgIBAYMfgWkDFaBsihhtgWkzgm8BAQWBAgEBXoI6A4E1gkAIF3KEeIQ3gQ8jgjMHggKDOIJnglSHMAiFQTyKegmOSWSHEoR1izKGSTOBc00jFYJ+giAOCYNFihwBVR8wkDsBAQ Received: from sonic306-28.consmr.mail.ne1.yahoo.com ([66.163.189.90]) by UCOL3CPA10.eemsg.mail.mil with ESMTP; 11 May 2018 00:54:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1526000094; bh=JBTkT7GdXr3A6LzezJlbNkp/jeSn2dNyCqFlVVgH3Ek=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=G8h+RDrKHjyhf6nmV6JsVarF+F6tmMujE6ktw5xs3snheSYURHflSxV/tcozNhTQXegf0f3tnUtwfWnHR58jcOpGiplpZjVDORy36o0B221uEMAnaXtA52lPVePii/G7xWCYWrX0p9Ft2wsrAIJJMMNeVK7Cu9nwHfa/Bul9xItEFfiTnLftXeVSScaLwErdo7q740QvTxoTwh53AUD+tgjhmlsxffUVzbl4rJAoj+qGdwIl8AiTqO43aXrgIBgpbsvgke5SiMLpMBzBs6xOFOiNNt+KXbht4sgerqr3EpOVxwa6AR798SWXuWm+wH506/rPR7o2Yam64lC9+koP4Q== X-YMail-OSG: Plawk2MVM1l0y_HLVH0Kw.TG74w9D6uGjMtgRreuASrptjTK7qXOu3dkdkQwrVB 2DmYpRWA3yAptuW9wxKaM3o9QweeIRA7TC9aqIP19zZOIEO52HvPfzZghzNUPFcN3m.YIsFbXAfS w3oMrSXtsXhOnFgUXIRdzELQ3K9DBiN93nqYrOYqo6X7oN54o89MuW_c2W.W0cILXcYr_AUfkmkV 6j611_Vpk0W5DGi2brFxne62da11MTN7Bavn7zwVcD8sdAabm1b5bIA1eJndIN70lTdGKeuDLjgW r2wJK4.gMr1.pLKhwicBX62eLzdBHZ7YGlS5mxfXU5ZN309PO170196JyqP223kpp.jh5f1dDH49 dL4Oe6A3ca07fLyyYPW6obAs7xlsRvQrqqvs1zP.1byuDZqkQ2zAc.dONZAJINyOM2XBolitxL6F 41bV0PMkzPYd46hZAj5IZOTWxWfmBe1wMB1XtBqFI9lVy0We2ceXhcyDxsBbLzU2xhVirYXgGO5j l7PtaWbLgMWzbQw8YKjN9VAV6DT9ZySIj1vzBNPX5pbKY3MYmh366YZa4bXsjmJT1Ik0fShKRNmh hdqcUsQF4tTwoPvAFBXql.Q0BYxh9NAVxiH7deXF_c8III.x3VO2nNbc4pyP9ccDop07E9oBbtsQ vLkw- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Fri, 11 May 2018 00:54:54 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.105]) ([67.169.65.224]) by smtp408.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 233612e38e7962626479636ea616cb22; Fri, 11 May 2018 00:54:53 +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: Date: Thu, 10 May 2018 17:54:50 -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 13/23] LSM: Infrastructure management of the ipc security blob 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:30:15 -0700 Subject: [PATCH 13/23] LSM: Infrastructure management of the ipc security blob Move management of the kern_ipc_perm->security and msg_msg->security blobs out of the individual security modules and into the security infrastructure. Instead of allocating the blobs from within the modules the modules tell the infrastructure how much space is required, and the space is allocated there. Signed-off-by: Casey Schaufler --- include/linux/lsm_hooks.h | 2 + security/security.c | 91 ++++++++++++++++++++++++++++-- security/selinux/hooks.c | 116 ++++++++------------------------------ security/selinux/include/objsec.h | 12 ++++ security/smack/smack.h | 10 ++++ security/smack/smack_lsm.c | 50 ++++++---------- 6 files changed, 150 insertions(+), 131 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index 5c1be19167dc..42535da852bc 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2018,6 +2018,8 @@ struct lsm_blob_sizes { int lbs_cred; int lbs_file; int lbs_inode; + int lbs_ipc; + int lbs_msg_msg; int lbs_sock; int lbs_superblock; int lbs_task; diff --git a/security/security.c b/security/security.c index 685e0aff0d36..9414d1a78ee5 100644 --- a/security/security.c +++ b/security/security.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -115,6 +116,8 @@ int __init security_init(void) pr_info("LSM: cred blob size = %d\n", blob_sizes.lbs_cred); pr_info("LSM: file blob size = %d\n", blob_sizes.lbs_file); pr_info("LSM: inode blob size = %d\n", blob_sizes.lbs_inode); + pr_info("LSM: ipc blob size = %d\n", blob_sizes.lbs_ipc); + pr_info("LSM: msg_msg blob size = %d\n", blob_sizes.lbs_msg_msg); pr_info("LSM: sock blob size = %d\n", blob_sizes.lbs_sock); pr_info("LSM: superblock blob size = %d\n", blob_sizes.lbs_superblock); pr_info("LSM: task blob size = %d\n", blob_sizes.lbs_task); @@ -293,6 +296,8 @@ void __init security_add_blobs(struct lsm_blob_sizes *needed) { lsm_set_size(&needed->lbs_cred, &blob_sizes.lbs_cred); lsm_set_size(&needed->lbs_file, &blob_sizes.lbs_file); + lsm_set_size(&needed->lbs_ipc, &blob_sizes.lbs_ipc); + lsm_set_size(&needed->lbs_msg_msg, &blob_sizes.lbs_msg_msg); lsm_set_size(&needed->lbs_sock, &blob_sizes.lbs_sock); lsm_set_size(&needed->lbs_superblock, &blob_sizes.lbs_superblock); lsm_set_size(&needed->lbs_task, &blob_sizes.lbs_task); @@ -406,6 +411,48 @@ void lsm_early_inode(struct inode *inode) panic("%s: Early inode alloc failed.\n", __func__); } +/** + * lsm_ipc_alloc - allocate a composite ipc blob + * @kip: the ipc that needs a blob + * + * Allocate the ipc blob for all the modules + * + * Returns 0, or -ENOMEM if memory can't be allocated. + */ +int lsm_ipc_alloc(struct kern_ipc_perm *kip) +{ + if (blob_sizes.lbs_ipc == 0) { + kip->security = NULL; + return 0; + } + + kip->security = kzalloc(blob_sizes.lbs_ipc, GFP_KERNEL); + if (kip->security == NULL) + return -ENOMEM; + return 0; +} + +/** + * lsm_msg_msg_alloc - allocate a composite msg_msg blob + * @mp: the msg_msg that needs a blob + * + * Allocate the ipc blob for all the modules + * + * Returns 0, or -ENOMEM if memory can't be allocated. + */ +int lsm_msg_msg_alloc(struct msg_msg *mp) +{ + if (blob_sizes.lbs_msg_msg == 0) { + mp->security = NULL; + return 0; + } + + mp->security = kzalloc(blob_sizes.lbs_msg_msg, GFP_KERNEL); + if (mp->security == NULL) + return -ENOMEM; + return 0; +} + /** * lsm_sock_alloc - allocate a composite sock blob * @sock: the sock that needs a blob @@ -1504,22 +1551,40 @@ void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid) int security_msg_msg_alloc(struct msg_msg *msg) { - return call_int_hook(msg_msg_alloc_security, 0, msg); + int rc = lsm_msg_msg_alloc(msg); + + if (unlikely(rc)) + return rc; + rc = call_int_hook(msg_msg_alloc_security, 0, msg); + if (unlikely(rc)) + security_msg_msg_free(msg); + return rc; } void security_msg_msg_free(struct msg_msg *msg) { call_void_hook(msg_msg_free_security, msg); + kfree(msg->security); + msg->security = NULL; } int security_msg_queue_alloc(struct kern_ipc_perm *msq) { - return call_int_hook(msg_queue_alloc_security, 0, msq); + int rc = lsm_ipc_alloc(msq); + + if (unlikely(rc)) + return rc; + rc = call_int_hook(msg_queue_alloc_security, 0, msq); + if (unlikely(rc)) + security_msg_queue_free(msq); + return rc; } void security_msg_queue_free(struct kern_ipc_perm *msq) { call_void_hook(msg_queue_free_security, msq); + kfree(msq->security); + msq->security = NULL; } int security_msg_queue_associate(struct kern_ipc_perm *msq, int msqflg) @@ -1546,12 +1611,21 @@ int security_msg_queue_msgrcv(struct kern_ipc_perm *msq, struct msg_msg *msg, int security_shm_alloc(struct kern_ipc_perm *shp) { - return call_int_hook(shm_alloc_security, 0, shp); + int rc = lsm_ipc_alloc(shp); + + if (unlikely(rc)) + return rc; + rc = call_int_hook(shm_alloc_security, 0, shp); + if (unlikely(rc)) + security_shm_free(shp); + return rc; } void security_shm_free(struct kern_ipc_perm *shp) { call_void_hook(shm_free_security, shp); + kfree(shp->security); + shp->security = NULL; } int security_shm_associate(struct kern_ipc_perm *shp, int shmflg) @@ -1571,12 +1645,21 @@ int security_shm_shmat(struct kern_ipc_perm *shp, char __user *shmaddr, int shmf int security_sem_alloc(struct kern_ipc_perm *sma) { - return call_int_hook(sem_alloc_security, 0, sma); + int rc = lsm_ipc_alloc(sma); + + if (unlikely(rc)) + return rc; + rc = call_int_hook(sem_alloc_security, 0, sma); + if (unlikely(rc)) + security_sem_free(sma); + return rc; } void security_sem_free(struct kern_ipc_perm *sma) { call_void_hook(sem_free_security, sma); + kfree(sma->security); + sma->security = NULL; } int security_sem_associate(struct kern_ipc_perm *sma, int semflg) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 62ac0dbf21ed..3911e28e3907 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -5771,51 +5771,22 @@ static int selinux_netlink_send(struct sock *sk, struct sk_buff *skb) return selinux_nlmsg_perm(sk, skb); } -static int ipc_alloc_security(struct kern_ipc_perm *perm, - u16 sclass) +static void ipc_init_security(struct ipc_security_struct *isec, u16 sclass) { - struct ipc_security_struct *isec; - - isec = kzalloc(sizeof(struct ipc_security_struct), GFP_KERNEL); - if (!isec) - return -ENOMEM; - isec->sclass = sclass; isec->sid = current_sid(); - perm->security = isec; - - return 0; -} - -static void ipc_free_security(struct kern_ipc_perm *perm) -{ - struct ipc_security_struct *isec = perm->security; - perm->security = NULL; - kfree(isec); } static int msg_msg_alloc_security(struct msg_msg *msg) { struct msg_security_struct *msec; - msec = kzalloc(sizeof(struct msg_security_struct), GFP_KERNEL); - if (!msec) - return -ENOMEM; - + msec = selinux_msg_msg(msg); msec->sid = SECINITSID_UNLABELED; - msg->security = msec; return 0; } -static void msg_msg_free_security(struct msg_msg *msg) -{ - struct msg_security_struct *msec = msg->security; - - msg->security = NULL; - kfree(msec); -} - static int ipc_has_perm(struct kern_ipc_perm *ipc_perms, u32 perms) { @@ -5823,7 +5794,7 @@ static int ipc_has_perm(struct kern_ipc_perm *ipc_perms, struct common_audit_data ad; u32 sid = current_sid(); - isec = ipc_perms->security; + isec = selinux_ipc(ipc_perms); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = ipc_perms->key; @@ -5837,11 +5808,6 @@ static int selinux_msg_msg_alloc_security(struct msg_msg *msg) return msg_msg_alloc_security(msg); } -static void selinux_msg_msg_free_security(struct msg_msg *msg) -{ - msg_msg_free_security(msg); -} - /* message queue security operations */ static int selinux_msg_queue_alloc_security(struct kern_ipc_perm *msq) { @@ -5850,11 +5816,8 @@ static int selinux_msg_queue_alloc_security(struct kern_ipc_perm *msq) u32 sid = current_sid(); int rc; - rc = ipc_alloc_security(msq, SECCLASS_MSGQ); - if (rc) - return rc; - - isec = msq->security; + isec = selinux_ipc(msq); + ipc_init_security(isec, SECCLASS_MSGQ); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = msq->key; @@ -5862,16 +5825,7 @@ static int selinux_msg_queue_alloc_security(struct kern_ipc_perm *msq) rc = avc_has_perm(&selinux_state, sid, isec->sid, SECCLASS_MSGQ, MSGQ__CREATE, &ad); - if (rc) { - ipc_free_security(msq); - return rc; - } - return 0; -} - -static void selinux_msg_queue_free_security(struct kern_ipc_perm *msq) -{ - ipc_free_security(msq); + return rc; } static int selinux_msg_queue_associate(struct kern_ipc_perm *msq, int msqflg) @@ -5880,7 +5834,7 @@ static int selinux_msg_queue_associate(struct kern_ipc_perm *msq, int msqflg) struct common_audit_data ad; u32 sid = current_sid(); - isec = msq->security; + isec = selinux_ipc(msq); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = msq->key; @@ -5929,8 +5883,8 @@ static int selinux_msg_queue_msgsnd(struct kern_ipc_perm *msq, struct msg_msg *m u32 sid = current_sid(); int rc; - isec = msq->security; - msec = msg->security; + isec = selinux_ipc(msq); + msec = selinux_msg_msg(msg); /* * First time through, need to assign label to the message @@ -5977,8 +5931,8 @@ static int selinux_msg_queue_msgrcv(struct kern_ipc_perm *msq, struct msg_msg *m u32 sid = task_sid(target); int rc; - isec = msq->security; - msec = msg->security; + isec = selinux_ipc(msq); + msec = selinux_msg_msg(msg); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = msq->key; @@ -6001,11 +5955,8 @@ static int selinux_shm_alloc_security(struct kern_ipc_perm *shp) u32 sid = current_sid(); int rc; - rc = ipc_alloc_security(shp, SECCLASS_SHM); - if (rc) - return rc; - - isec = shp->security; + isec = selinux_ipc(shp); + ipc_init_security(isec, SECCLASS_SHM); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = shp->key; @@ -6013,16 +5964,7 @@ static int selinux_shm_alloc_security(struct kern_ipc_perm *shp) rc = avc_has_perm(&selinux_state, sid, isec->sid, SECCLASS_SHM, SHM__CREATE, &ad); - if (rc) { - ipc_free_security(shp); - return rc; - } - return 0; -} - -static void selinux_shm_free_security(struct kern_ipc_perm *shp) -{ - ipc_free_security(shp); + return rc; } static int selinux_shm_associate(struct kern_ipc_perm *shp, int shmflg) @@ -6031,7 +5973,7 @@ static int selinux_shm_associate(struct kern_ipc_perm *shp, int shmflg) struct common_audit_data ad; u32 sid = current_sid(); - isec = shp->security; + isec = selinux_ipc(shp); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = shp->key; @@ -6098,11 +6040,8 @@ static int selinux_sem_alloc_security(struct kern_ipc_perm *sma) u32 sid = current_sid(); int rc; - rc = ipc_alloc_security(sma, SECCLASS_SEM); - if (rc) - return rc; - - isec = sma->security; + isec = selinux_ipc(sma); + ipc_init_security(isec, SECCLASS_SEM); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = sma->key; @@ -6110,16 +6049,7 @@ static int selinux_sem_alloc_security(struct kern_ipc_perm *sma) rc = avc_has_perm(&selinux_state, sid, isec->sid, SECCLASS_SEM, SEM__CREATE, &ad); - if (rc) { - ipc_free_security(sma); - return rc; - } - return 0; -} - -static void selinux_sem_free_security(struct kern_ipc_perm *sma) -{ - ipc_free_security(sma); + return rc; } static int selinux_sem_associate(struct kern_ipc_perm *sma, int semflg) @@ -6128,7 +6058,7 @@ static int selinux_sem_associate(struct kern_ipc_perm *sma, int semflg) struct common_audit_data ad; u32 sid = current_sid(); - isec = sma->security; + isec = selinux_ipc(sma); ad.type = LSM_AUDIT_DATA_IPC; ad.u.ipc_id = sma->key; @@ -6214,7 +6144,7 @@ static int selinux_ipc_permission(struct kern_ipc_perm *ipcp, short flag) static void selinux_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid) { - struct ipc_security_struct *isec = ipcp->security; + struct ipc_security_struct *isec = selinux_ipc(ipcp); *secid = isec->sid; } @@ -6750,6 +6680,8 @@ struct lsm_blob_sizes selinux_blob_sizes = { .lbs_cred = sizeof(struct task_security_struct), .lbs_file = sizeof(struct file_security_struct), .lbs_inode = sizeof(struct inode_security_struct), + .lbs_ipc = sizeof(struct ipc_security_struct), + .lbs_msg_msg = sizeof(struct msg_security_struct), .lbs_sock = sizeof(struct sk_security_struct), .lbs_superblock = sizeof(struct superblock_security_struct), }; @@ -6860,24 +6792,20 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(ipc_getsecid, selinux_ipc_getsecid), LSM_HOOK_INIT(msg_msg_alloc_security, selinux_msg_msg_alloc_security), - LSM_HOOK_INIT(msg_msg_free_security, selinux_msg_msg_free_security), LSM_HOOK_INIT(msg_queue_alloc_security, selinux_msg_queue_alloc_security), - LSM_HOOK_INIT(msg_queue_free_security, selinux_msg_queue_free_security), LSM_HOOK_INIT(msg_queue_associate, selinux_msg_queue_associate), LSM_HOOK_INIT(msg_queue_msgctl, selinux_msg_queue_msgctl), LSM_HOOK_INIT(msg_queue_msgsnd, selinux_msg_queue_msgsnd), LSM_HOOK_INIT(msg_queue_msgrcv, selinux_msg_queue_msgrcv), LSM_HOOK_INIT(shm_alloc_security, selinux_shm_alloc_security), - LSM_HOOK_INIT(shm_free_security, selinux_shm_free_security), LSM_HOOK_INIT(shm_associate, selinux_shm_associate), LSM_HOOK_INIT(shm_shmctl, selinux_shm_shmctl), LSM_HOOK_INIT(shm_shmat, selinux_shm_shmat), LSM_HOOK_INIT(sem_alloc_security, selinux_sem_alloc_security), - LSM_HOOK_INIT(sem_free_security, selinux_sem_free_security), LSM_HOOK_INIT(sem_associate, selinux_sem_associate), LSM_HOOK_INIT(sem_semctl, selinux_sem_semctl), LSM_HOOK_INIT(sem_semop, selinux_sem_semop), diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h index 7e4bd14498b5..d1d883f8c552 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h @@ -180,6 +180,18 @@ static inline struct superblock_security_struct *selinux_superblock( return superblock->s_security; } +static inline struct msg_security_struct *selinux_msg_msg( + const struct msg_msg *msg_msg) +{ + return msg_msg->security; +} + +static inline struct ipc_security_struct *selinux_ipc( + const struct kern_ipc_perm *ipc) +{ + return ipc->security; +} + static inline struct sk_security_struct *selinux_sock(const struct sock *sock) { return sock->sk_security; diff --git a/security/smack/smack.h b/security/smack/smack.h index f457dd3b4aa0..42c36e37b0bd 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h @@ -383,6 +383,16 @@ static inline struct superblock_smack *smack_superblock( return superblock->s_security; } +static inline struct smack_known **smack_msg_msg(const struct msg_msg *msg) +{ + return msg->security; +} + +static inline struct smack_known **smack_ipc(const struct kern_ipc_perm *ipc) +{ + return ipc->security; +} + /* * Is the directory transmuting? */ diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index dec965eea49f..a419953c1004 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -2833,23 +2833,12 @@ static int smack_flags_to_may(int flags) */ static int smack_msg_msg_alloc_security(struct msg_msg *msg) { - struct smack_known *skp = smk_of_current(); + struct smack_known **blob = smack_msg_msg(msg); - msg->security = skp; + *blob = smk_of_current(); return 0; } -/** - * smack_msg_msg_free_security - Clear the security blob for msg_msg - * @msg: the object - * - * Clears the blob pointer - */ -static void smack_msg_msg_free_security(struct msg_msg *msg) -{ - msg->security = NULL; -} - /** * smack_of_ipc - the smack pointer for the ipc * @isp: the object @@ -2858,7 +2847,13 @@ static void smack_msg_msg_free_security(struct msg_msg *msg) */ static struct smack_known *smack_of_ipc(struct kern_ipc_perm *isp) { - return (struct smack_known *)isp->security; +#ifdef CONFIG_SECURITY_STACKING + struct smack_known **blob = smack_ipc(isp); + + return *blob; +#else + return isp->security; +#endif } /** @@ -2869,23 +2864,12 @@ static struct smack_known *smack_of_ipc(struct kern_ipc_perm *isp) */ static int smack_ipc_alloc_security(struct kern_ipc_perm *isp) { - struct smack_known *skp = smk_of_current(); + struct smack_known **blob = smack_ipc(isp); - isp->security = skp; + *blob = smk_of_current(); return 0; } -/** - * smack_ipc_free_security - Clear the security blob for ipc - * @isp: the object - * - * Clears the blob pointer - */ -static void smack_ipc_free_security(struct kern_ipc_perm *isp) -{ - isp->security = NULL; -} - /** * smk_curacc_shm : check if current has access on shm * @isp : the object @@ -3183,7 +3167,8 @@ static int smack_msg_queue_msgrcv(struct kern_ipc_perm *isp, struct msg_msg *msg */ static int smack_ipc_permission(struct kern_ipc_perm *ipp, short flag) { - struct smack_known *iskp = ipp->security; + struct smack_known **blob = smack_ipc(ipp); + struct smack_known *iskp = *blob; int may = smack_flags_to_may(flag); struct smk_audit_info ad; int rc; @@ -3204,7 +3189,8 @@ static int smack_ipc_permission(struct kern_ipc_perm *ipp, short flag) */ static void smack_ipc_getsecid(struct kern_ipc_perm *ipp, u32 *secid) { - struct smack_known *iskp = ipp->security; + struct smack_known **blob = smack_ipc(ipp); + struct smack_known *iskp = *blob; *secid = iskp->smk_secid; } @@ -4518,6 +4504,8 @@ struct lsm_blob_sizes smack_blob_sizes = { .lbs_cred = sizeof(struct task_smack), .lbs_file = sizeof(struct smack_known *), .lbs_inode = sizeof(struct inode_smack), + .lbs_ipc = sizeof(struct smack_known *), + .lbs_msg_msg = sizeof(struct smack_known *), .lbs_sock = sizeof(struct socket_smack), .lbs_superblock = sizeof(struct superblock_smack), }; @@ -4590,23 +4578,19 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(ipc_getsecid, smack_ipc_getsecid), LSM_HOOK_INIT(msg_msg_alloc_security, smack_msg_msg_alloc_security), - LSM_HOOK_INIT(msg_msg_free_security, smack_msg_msg_free_security), LSM_HOOK_INIT(msg_queue_alloc_security, smack_ipc_alloc_security), - LSM_HOOK_INIT(msg_queue_free_security, smack_ipc_free_security), LSM_HOOK_INIT(msg_queue_associate, smack_msg_queue_associate), LSM_HOOK_INIT(msg_queue_msgctl, smack_msg_queue_msgctl), LSM_HOOK_INIT(msg_queue_msgsnd, smack_msg_queue_msgsnd), LSM_HOOK_INIT(msg_queue_msgrcv, smack_msg_queue_msgrcv), LSM_HOOK_INIT(shm_alloc_security, smack_ipc_alloc_security), - LSM_HOOK_INIT(shm_free_security, smack_ipc_free_security), LSM_HOOK_INIT(shm_associate, smack_shm_associate), LSM_HOOK_INIT(shm_shmctl, smack_shm_shmctl), LSM_HOOK_INIT(shm_shmat, smack_shm_shmat), LSM_HOOK_INIT(sem_alloc_security, smack_ipc_alloc_security), - LSM_HOOK_INIT(sem_free_security, smack_ipc_free_security), LSM_HOOK_INIT(sem_associate, smack_sem_associate), LSM_HOOK_INIT(sem_semctl, smack_sem_semctl), LSM_HOOK_INIT(sem_semop, smack_sem_semop),