From patchwork Sat Jan 21 00:05:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Cernekee X-Patchwork-Id: 9532527 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 99F456042D for ; Mon, 23 Jan 2017 13:29:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 867F827D9B for ; Mon, 23 Jan 2017 13:29:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AA622831B; Mon, 23 Jan 2017 13:29:41 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (smtp.nsa.gov [8.44.101.8]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C36528304 for ; Mon, 23 Jan 2017 13:29:39 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.33,274,1477958400"; d="scan'208";a="3056869" IronPort-PHdr: =?us-ascii?q?9a23=3Ah2TFnR8C03/Gv/9uRHKM819IXTAuvvDOBiVQ1KB5?= =?us-ascii?q?0O4XIJqq85mqBkHD//Il1AaPBtSHra4VwLeO+4nbGkU4qa6bt34DdJEeHzQksu?= =?us-ascii?q?4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1?= =?us-ascii?q?Ov71GonPhMiryuy+4ZPebgFHiTanbr5/KBq6oAXNusILnYZsN6E9xwfTrHBVYe?= =?us-ascii?q?pW32RoJVySnxb4+Mi9+YNo/jpTtfw86cNOSL32cKskQ7NWCjQmKH0169bwtRbf?= =?us-ascii?q?VwuP52ATXXsQnxFVHgXK9hD6XpP2sivnqupw3TSRMMPqQbwoXzmp8qlkSAXsiC?= =?us-ascii?q?waKTA39m/ZgdF0gK5CvR6tuxlzzojJa4+XKfV+ZLvQc9MES2RcUMhfVCtPDYGy?= =?us-ascii?q?b4sXDecNIOhVoIbhqFUBsxS+HhKhBP/txzJSmnP7x7E23/onHArb3AIgBdUOsH?= =?us-ascii?q?HModvwKqgST+G1zK/VxjjdcfxWwzH955bLch8/v/6HQLV9ftbPxkk1EQPKkFaQ?= =?us-ascii?q?ppL7MD6OyusNs3Kb7+1lVeKulm4nrht9oj+1xscjk4TEgJ8exFPc9Shh3Yo4Kt?= =?us-ascii?q?K1RFR7bNK5CpdcqS6XO5VsTs8/W21kpjo2x7kctZO4fCUG0okryhrBZ/CdboSF?= =?us-ascii?q?4A/vWeCMKjlinn1lYqiwhxOq/Eilze3zS9e73U5RripAjtnMrncN1wHP6sSfSv?= =?us-ascii?q?ty4EOh2TGX2gDP8O5EO0E0lbfAK5I73r4xloYcsUTEHiPsnkX5kLSWeVk+9uit?= =?us-ascii?q?6uTnZq3qpp6aN4BqlgHzKrkil8OwDOgiMgUCQnKX9fqz2bH950H1Xa1Gjvgsna?= =?us-ascii?q?nYtJDaK94bpqm8AwJNyYYs9RK/Dzag0NQFkngLNUlKeBWaj4jvJ17BPuv4AOyj?= =?us-ascii?q?g1WsjDhrx/fGMqfnApXWNHfPirjhfbFj60JE0go80chf545ICrEGOP/zWEjxtN?= =?us-ascii?q?rCAR8lMwy72eDnBc5/1oMZX2KPB7WWMLjOsVCW/OIvOPOAZIgPuDbyM/Il/eLh?= =?us-ascii?q?jWclmV8BeqmkxZkXaHKiEft6IEWZen3sgtEAEWcUpQc+QujqiECNUDFIenayWb?= =?us-ascii?q?485iwhBIKhF4fDSZingKad0yejAp1WemdGB0iUEXj2bIqLRfEMaCOOIs9miTEE?= =?us-ascii?q?VKauRJE/2h20sw/60bVnJPLO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RaT7oxcA1SPsAX?= =?us-ascii?q?dezighdz62opX5gwB6iGWFIXd9tnXZfd1wygnF5NzHXvNRwCQJRDNjhjnKA1iw?= =?us-ascii?q?Jd6p/c+bl53bqOCxS3qhVoFPcSns1Y6AqDa06nBrARKlm/C+gcHoEQ8/0SDnzd?= =?us-ascii?q?ZqTjnIoAz6Yob1y6SwKfhncVVwBF/g98p6HZlzko0xhJEU3XgVmI6V8GEdnmjt?= =?us-ascii?q?K9Vb3rjybH0XRT4E29TV+hTq2FV/LnKVwIL0Tmudwsp9aNmmZWMWwDgx4NxKCK?= =?us-ascii?q?eT6rxEkjB4ol65rQLXe/d9hDAdxeEp6H4AjOEDoBAtwTmFArAOAUlYOjThlxCJ?= =?us-ascii?q?79ClsKVbfX2vfqa01Ep/m9ChEb6DrxpHWHbhe5ciGy5w4dlkMF7W1n389J3kcs?= =?us-ascii?q?HKbd0Prh2UjwvAj+9NJZIrkfoKgS5nNnznvXI5zO46gwdj3YqnvIebMGVh5qW5?= =?us-ascii?q?AgRXNjftfcMc5intjbpCnsaRx42vBo9uGigPXJfyV/2kCikdtfPjNwaSFz08rG?= =?us-ascii?q?yWGb/DEQ+Z70dps2jDE5a1OHGLPHMZ18ltRAGBJExDhwAZRDY6kYA/FgCx38Hh?= =?us-ascii?q?c1l25jYK5l7+tBRM1vhkNx7lUmfQvA2ocCs7SICDLBpK6QFP/1/VPtaD7uJ3AS?= =?us-ascii?q?5Y5oeurAqRKmOFfQRFFnwJWleaCFD5Jbmi/8LA8++FBuqkM/TBf7uOqetEV/eH?= =?us-ascii?q?252jyI1m8CiQNs+XJHltE+U72lZfXXB+A8nZhTMPRDEMmiLTac6UuRe89jdxrs?= =?us-ascii?q?+h7PThQBjv6peXC7tOLdVv/Ai7gb+ZOO6NgCZ0MipX1pIQxX7I0bQf0kQdiyd0?= =?us-ascii?q?ezmqC7QAujbHTLjMla9PEx4bdyRzOdNL76M82glCJ9XWitby1r52gP46FUtFVU?= =?us-ascii?q?DhmsG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Iv9m/zINr3YlaPjwdD399Pjuq6bbMvAAqhuaDXNAt?= =?us-ascii?q?YnoBRIQLKnc2VNe9my5DsHRKFCO33f4ByAie8z/8oTzdDD37b9p5eviUYxJtCN?= =?us-ascii?q?at9DUw9ai2lETb8pLEJ2H1Ld5ioMPA6fsGp5abDPNZVaJ9vFnYm4lZQXyqTmHO?= =?us-ascii?q?HMWpKJj3bokjccb7Cm2mUlCljTI6UdvxNs63LqeUmQHoWZpUsI6D0T8+KcC9Ez?= =?us-ascii?q?YeGxFsp+0e/698exMMY4A6YR/psAQ+MbazIAGG3dWyW2ytMydZT+FDzeWmYLxa?= =?us-ascii?q?1yksbvW6yXQ6SJE60+m3/FUCRJENlhHR2eyvZ49AXijvAnZdYRnApTIll2h9Me?= =?us-ascii?q?Y/2vs/wBLNsVkbLzCLdOxoZXdZsNE9BVKdO255BnA+R1CCkYrJ+hSs0KwK/ytB?= =?us-ascii?q?g9ZU1vVIsHfkvpDFZjKsRLemqZTSsysua9gmv61xPpLiIsuAqJPRgCbfQIPWsg?= =?us-ascii?q?KbTC6wD+BalcRIICJEXPlInnkoNtYCuYpA9UU+SN8xJ7lPCakqobCqbyBrADUJ?= =?us-ascii?q?wi8YTYyA2iUOgumh27fAkBefbogiOgQesJpemtsdTzJ2YiQGqaC4SYrWkXSJRX?= =?us-ascii?q?IWLwcN8wtM/hkAmZVqfuHl+obIS4VMyzFOqfJuTiTLDoVo90f8SmyOm1j4TvSh?= =?us-ascii?q?nPCp3QJVyPLsycEVVgdiB0ZH2+tYkVAlJ61wK6kVooHFqCSIdV/gsGLr1uSmOE?= =?us-ascii?q?FbydfIeF3gEIrFqW38XzUA9n0WX4BA1GrSGogVkwp9bKYrpUtDIJq6ekng+zMk?= =?us-ascii?q?x55lH76iVcCk31wlt2oJRz+2E9pdDOFrqEjXVyd/Y5Css5roIIlSQnVK952DtV?= =?us-ascii?q?hZlERtMyi2yZpYKsFN7T4MXCRBoTqHptuyTddP2cloAJ8QOt1/oWvyGL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-ascii?q?/uL5AoWjJBs9ptBwNoHIRRH8MArhKnDICPlaC6it+x/kZ6tPEQsar0FP/GztO5?= =?us-ascii?q?359+X5JC/0yEIC7RBLV3gkRilumzjO/A0oPwCcz+Z9wJT+17Qm/Zar/cAIqzMD?= =?us-ascii?q?WOOtjze0Re6b6TzKp5UgmNZCD+R6eGsymkO+t/7EUjzox3ZvHTzCAs777HxNvy?= =?us-ascii?q?fX9UqTm5oX6PKpRf8ETABfbCUBJMVfqF7GFlELUTbYv18ucOLNMjzMGY4wly9z?= =?us-ascii?q?RCzNCFLrOgrkDW3EJ7cojXLEzz2yY2QYMKOgiwMVMwgW/FrXTQGW9cIdagKcls?= =?us-ascii?q?htaVExPs605+l2ExZm5OBHDoSsmJOWcBwM++ZxOF9BhND9kdm+64YlM4tqKoRe?= =?us-ascii?q?lvIJVFlv2gtK8bntZxNyHPWM9aMjnVLLBsIjVRDuTPpF4vYhMfrbg1W4E1aoaK?= =?us-ascii?q?IEMGNkeA1CzzwRHF0U3ueNymzLyJLzoO8nVb07LF1iBBpwujtvaahc3sS6vUbI?= =?us-ascii?q?zwXP7OMColUSyaRTsyEUa141ukveQLvOaAK2cFvl8Uej6SCBIUpq13otjfFHTc?= =?us-ascii?q?mfdifJIUgPCXQD7wSClim6opByZLqFqAQ/wdGgnKd3XhmnZTuBS+Jv9Q+nLod7?= =?us-ascii?q?+Yxq9SW+wMGItMc+aZTsDeef9EIjcniDQZNPy7f93GoLYzykjIQncBE6nU6F2e?= =?us-ascii?q?S1abQueSxzLuQYoYvos5tzE2+t3OhC93EqXJP7GZpzK09I63kjqYs/XEVmYxe0?= =?us-ascii?q?w1nP4CAG6ZzRlCL2EEDdUVtVroQqGeeklM2nUpifhy1BASYghzVGNh0mEF1Mq6?= =?us-ascii?q?T9ZFRFAagWXoQ/kPd0t6Fi8Y5kKB/wv/fZoLvsWXD29T7LEBU5Y1I/4u5I7Nfq?= =?us-ascii?q?IIyfAgmjV8r2ozrmHVA1pDgwet/6POEad4wbNeo28147U+RkiSRxvHe3XDj4+h?= =?us-ascii?q?DNhCgyxppDSszMbPlvx8P7td4YdiCREFBjwybt3F9CpASkns0RGzpA6/FT+TZj?= =?us-ascii?q?UD72UlPysAI8V40e59+D3FbNDM6k6d//YqpVGtBAWGB5K/2IZMD8D00EO/cyYd?= =?us-ascii?q?ImbjLIx/tvsYzIVaWqggf4XrRgmZIw=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2GrAwBABIZY/wHyM5BdGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgxIBAQEBAR+BaY5NqEAth3RXAQEBAQEBAQECAQJgKIIzG4IcB?= =?us-ascii?q?gECJBMUIAsDAwkBARcpCAgDAS0DAQUBCxEHBwsFGASIa59iP41tOiYCihYBCwE?= =?us-ascii?q?lEo9EEQGFYR8BBIkAhyqLIZFdggSIKiYMhhtIkGgygRRYczcqCDqEORyCAlKFV?= =?us-ascii?q?YIuAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 23 Jan 2017 13:29:38 +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 v0NDTX95009563; Mon, 23 Jan 2017 08:29:35 -0500 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 v0L06TSR040438 for ; Fri, 20 Jan 2017 19:06:29 -0500 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 v0L06RNd009764 for ; Fri, 20 Jan 2017 19:06:29 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1CJAQBMpYJYhqvAVdFeHAEBBAEBCgEBgz0BAQEBAYIIsn+ENogfVwECAQEBAQECEwEBAQgLCwodhRoGJ1IQUTQBBQEcBxKJBqJmP41tOop6CQEIlTcfBYkAhymLH5FaggSIKjKGG0iQZjKBFIF/KgiEJAFOHIIBHTWJKQEBAQ X-IPAS-Result: A1CJAQBMpYJYhqvAVdFeHAEBBAEBCgEBgz0BAQEBAYIIsn+ENogfVwECAQEBAQECEwEBAQgLCwodhRoGJ1IQUTQBBQEcBxKJBqJmP41tOop6CQEIlTcfBYkAhymLH5FaggSIKjKGG0iQZjKBFIF/KgiEJAFOHIIBHTWJKQEBAQ X-IronPort-AV: E=Sophos;i="5.33,260,1477972800"; d="scan'208";a="5915764" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 20 Jan 2017 19:06:28 -0500 IronPort-PHdr: =?us-ascii?q?9a23=3AyZiwdhTFIvyaIvr0PXSwp4Lox9psv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa6yZxeN2/xhgRfzUJnB7Loc0qyN4vymBTBLu8rJmUtBWaQEbwUCh8?= =?us-ascii?q?QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6?= =?us-ascii?q?OPn+FJLMgMSrzeCy/IDYbxlViDanb75/KBq7oR/eu8QZjoduNKk8wQbVr3VVfO?= =?us-ascii?q?hb2XlmLk+JkRbm4cew8p9j8yBOtP8k6sVNT6b0cbkmQLJBFDgpPHw768PttRnY?= =?us-ascii?q?UAuA/WAcXXkMkhpJGAfK8hf3VYrsvyTgt+p93C6aPdDqTb0xRD+v4btnRAPuhS?= =?us-ascii?q?waMTMy7WPZhdFqjK9DoByvuQFxzYDXbo+SNvV+cLjQcc8GSWdbQspcTTBNDp+6?= =?us-ascii?q?YoASD+QBJ+FYr4zlqlULsxS+GwisBOXywTJWmHD2x6s63PoiEQ7YwgMrAtUDv2?= =?us-ascii?q?jKo9XvMqcdT+O1w7fWwjjYc/xW2S396I/NchAgvPGMWKh8cc3LyUkgDg7IiEib?= =?us-ascii?q?p4/9Pz6NyOgBr2yW4/BjWO+vkWIrtgV8ria1yssxiITFm4QYwU3e+ypj2oY6P9?= =?us-ascii?q?i4RVZ7YdG6FJtQsDmXN45sTcMjR2FkoT46yrMatZKicigG1ZYqywPFZ/yIdIiI?= =?us-ascii?q?5R3jVOKPLjtimH1lf7e/iw6z8Uim1OL8StG53EhWoidBiNXBtXAA2wbO5sWDVP?= =?us-ascii?q?dx5Fqt1DSS2wzL7+FLO0E0la7VK547xb4wk4IevljdES/snkX5kqyWeVs69eWz?= =?us-ascii?q?5OTnZbLmppCYN4BqkA3xLqMumsmnDeQiLgcOR3Sb+fi71LD75k32XrFKjvwwkq?= =?us-ascii?q?nEv5HXPtgbp66lDA9V1YYv8RC/Dyy839gCknkHK0xFK1q7iN3yJ1zALv3+S/S7?= =?us-ascii?q?ik+3nS137+vLNaDnD4mLJX/G1P/hcKx35lRA4AU0y9xY/dRdErgHKbT0QEC3vc?= =?us-ascii?q?GcRhMwLQGx6+ruFth40oQQRSSJD7PdeLvbrFug/usyJ6yJY4gPtXD2LP1hr+Xi?= =?us-ascii?q?llcliFQdeu+vxpJRZ3emWrxrO0yDYGHEmt4bEHwSugM1QartklLRfyRUYiORUr?= =?us-ascii?q?w94HkQBZigAITOS8j5i7Gb2iq4E5B+bWBcDVWNDHKucJ+LDaRfIBmOK9Nsx2RX?= =?us-ascii?q?HYOqTJUsgEmj?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0EdAgCCpYJYhqvAVdFeHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgxIBAQEBAYIIsn+ENogfVwEBAQEBAQEBAgECEAEBAQgLCwodMII?= =?us-ascii?q?zGYIeBidSEFE0AQUBHAcSiQaiZz+NbTqKegkBCJU3HwWJAIcpix+RWoIEiCoyh?= =?us-ascii?q?htIkGYygRSCACoIhCQBThyCAR01iSkBAQE?= X-IPAS-Result: =?us-ascii?q?A0EdAgCCpYJYhqvAVdFeHAEBBAEBCgEBFwEBBAEBCgEBgxI?= =?us-ascii?q?BAQEBAYIIsn+ENogfVwEBAQEBAQEBAgECEAEBAQgLCwodMIIzGYIeBidSEFE0A?= =?us-ascii?q?QUBHAcSiQaiZz+NbTqKegkBCJU3HwWJAIcpix+RWoIEiCoyhhtIkGYygRSCACo?= =?us-ascii?q?IhCQBThyCAR01iSkBAQE?= X-IronPort-AV: E=Sophos;i="5.33,260,1477958400"; d="scan'208";a="2468371" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from mail-pf0-f171.google.com ([209.85.192.171]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 21 Jan 2017 00:06:27 +0000 Received: by mail-pf0-f171.google.com with SMTP id 189so25929595pfu.3 for ; Fri, 20 Jan 2017 16:06:27 -0800 (PST) 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=TqZixZcmtWrWzV2OLKr3yDo37Cl+l2LkgVE5cE/zfRw=; b=EqBLQipdEmbXADr+ZS73b9jHUsqxSl5teKWmfS/UUr4lCt6Kp4i64LBCZ88A6cZp7U 21mU431DWVp3PmmtKrtLHkXsVEKV9IByw2FCfS2WttJ/JyaSpQj6PgzgdX6W3cLibP1E YQjPNEKE8NVxv6bxuczOs4mI5MnpPUZyAIAQ4r0N53IpsWbw1NeSqYZjC/cpULVrf1mt YOkSPKZKSMSgvQYytPo3arJ49Ngbi0MyplNjnoRIcsHbRRG+xHX7ucTW19TdPsOT1C98 QHJwEf/yrO3oVB/dV1PS+qwqUyMhW09IMRNiqIx3Nwtzw3OLpFuhbuz2r27vUUdDgGRt bNYQ== X-Gm-Message-State: AIkVDXKYzF58yrr9NkYcx3QvSYwIk2FFzEMK01kqA0xJ7C5dNJTLb2DQzctigJeK0HqLZqNb X-Received: by 10.98.88.133 with SMTP id m127mr19749196pfb.155.1484957186151; Fri, 20 Jan 2017 16:06:26 -0800 (PST) Received: from kcl.mtv.corp.google.com ([172.22.66.15]) by smtp.gmail.com with ESMTPSA id 66sm19375359pfx.29.2017.01.20.16.06.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Jan 2017 16:06:25 -0800 (PST) From: Kevin Cernekee To: steffen.klassert@secunet.com, herbert@gondor.apana.org.au, davem@davemloft.net, paul@paul-moore.com, sds@tycho.nsa.gov, eparis@parisplace.org Subject: [PATCH 2/4] xfrm_user: Allow common functions to be called from another file Date: Fri, 20 Jan 2017 16:05:05 -0800 Message-Id: <20170121000507.34381-3-cernekee@chromium.org> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog In-Reply-To: <20170121000507.34381-1-cernekee@chromium.org> References: <20170121000507.34381-1-cernekee@chromium.org> X-Mailman-Approved-At: Mon, 23 Jan 2017 08:28:53 -0500 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: netdev@vger.kernel.org, fw@strlen.de, dianders@chromium.org, linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov, fan.du@windriver.com, dtor@chromium.org MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP xfrm_user_legacy.c will need to call a few common functions. Make sure them have an "xfrm_" prefix, and declare them in a new xfrm_user.h header. Signed-off-by: Kevin Cernekee --- net/xfrm/xfrm_user.c | 147 +++++++++++++++++---------------------------------- net/xfrm/xfrm_user.h | 90 +++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 99 deletions(-) create mode 100644 net/xfrm/xfrm_user.h diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index ed389aad4994..4d733f02c3a1 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -32,6 +32,7 @@ #include #endif #include +#include "xfrm_user.h" static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type) { @@ -100,7 +101,7 @@ static void verify_one_addr(struct nlattr **attrs, enum xfrm_attr_type_t type, *addrp = nla_data(rt); } -static inline int verify_sec_ctx_len(struct nlattr **attrs) +int xfrm_verify_sec_ctx_len(struct nlattr **attrs) { struct nlattr *rt = attrs[XFRMA_SEC_CTX]; struct xfrm_user_sec_ctx *uctx; @@ -148,8 +149,8 @@ static inline int verify_replay(const struct xfrm_usersa_info *p, return 0; } -static int verify_newsa_info(const struct xfrm_usersa_info *p, - struct nlattr **attrs) +int xfrm_verify_newsa_info(const struct xfrm_usersa_info *p, + struct nlattr **attrs) { int err; @@ -241,7 +242,7 @@ static int verify_newsa_info(const struct xfrm_usersa_info *p, goto out; if ((err = verify_one_alg(attrs, XFRMA_ALG_COMP))) goto out; - if ((err = verify_sec_ctx_len(attrs))) + if ((err = xfrm_verify_sec_ctx_len(attrs))) goto out; if ((err = verify_replay(p, attrs))) goto out; @@ -460,17 +461,6 @@ static int xfrm_alloc_replay_state_esn( return 0; } -static inline int xfrm_user_sec_ctx_size(const struct xfrm_sec_ctx *xfrm_ctx) -{ - int len = 0; - - if (xfrm_ctx) { - len += sizeof(struct xfrm_user_sec_ctx); - len += xfrm_ctx->ctx_len; - } - return len; -} - static void copy_from_user_state(struct xfrm_state *x, const struct xfrm_usersa_info *p) { @@ -537,10 +527,10 @@ static void xfrm_update_ae_params(struct xfrm_state *x, x->replay_maxdiff = nla_get_u32(rt); } -static struct xfrm_state *xfrm_state_construct(struct net *net, - const struct xfrm_usersa_info *p, - struct nlattr **attrs, - int *errp) +struct xfrm_state *xfrm_state_construct(struct net *net, + const struct xfrm_usersa_info *p, + struct nlattr **attrs, + int *errp) { struct xfrm_state *x = xfrm_state_alloc(net); int err = -ENOMEM; @@ -634,7 +624,7 @@ static int xfrm_add_sa(struct sk_buff *skb, const struct nlmsghdr *nlh, int err; struct km_event c; - err = verify_newsa_info(p, attrs); + err = xfrm_verify_newsa_info(p, attrs); if (err) return err; @@ -666,10 +656,10 @@ static int xfrm_add_sa(struct sk_buff *skb, const struct nlmsghdr *nlh, return err; } -static struct xfrm_state *xfrm_user_state_lookup(struct net *net, - const struct xfrm_usersa_id *p, - struct nlattr **attrs, - int *errp) +struct xfrm_state *xfrm_user_state_lookup(struct net *net, + const struct xfrm_usersa_id *p, + struct nlattr **attrs, + int *errp) { struct xfrm_state *x = NULL; struct xfrm_mark m; @@ -757,14 +747,7 @@ static void copy_to_user_state(const struct xfrm_state *x, p->seq = x->km.seq; } -struct xfrm_dump_info { - struct sk_buff *in_skb; - struct sk_buff *out_skb; - u32 nlmsg_seq; - u16 nlmsg_flags; -}; - -static int copy_sec_ctx(const struct xfrm_sec_ctx *s, struct sk_buff *skb) +int xfrm_copy_sec_ctx(const struct xfrm_sec_ctx *s, struct sk_buff *skb) { struct xfrm_user_sec_ctx *uctx; struct nlattr *attr; @@ -785,8 +768,8 @@ static int copy_sec_ctx(const struct xfrm_sec_ctx *s, struct sk_buff *skb) return 0; } -static int copy_to_user_auth(const struct xfrm_algo_auth *auth, - struct sk_buff *skb) +int xfrm_copy_to_user_auth(const struct xfrm_algo_auth *auth, + struct sk_buff *skb) { struct xfrm_algo *algo; struct nlattr *nla; @@ -837,7 +820,7 @@ static int copy_to_user_state_extra(const struct xfrm_state *x, goto out; } if (x->aalg) { - ret = copy_to_user_auth(x->aalg, skb); + ret = xfrm_copy_to_user_auth(x->aalg, skb); if (!ret) ret = nla_put(skb, XFRMA_ALG_AUTH_TRUNC, xfrm_alg_auth_len(x->aalg), x->aalg); @@ -877,7 +860,7 @@ static int copy_to_user_state_extra(const struct xfrm_state *x, if (ret) goto out; if (x->security) - ret = copy_sec_ctx(x->security, skb); + ret = xfrm_copy_sec_ctx(x->security, skb); out: return ret; } @@ -992,8 +975,8 @@ static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb, /* A wrapper for nlmsg_multicast() checking that nlsk is still available. * Must be called with RCU read lock. */ -static inline int xfrm_nlmsg_multicast(struct net *net, struct sk_buff *skb, - u32 pid, unsigned int group) +int xfrm_nlmsg_multicast(struct net *net, struct sk_buff *skb, + u32 pid, unsigned int group) { struct sock *nlsk = rcu_dereference(net->xfrm.nlsk); @@ -1270,7 +1253,7 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, const struct nlmsghdr *nlh, return err; } -static int verify_policy_dir(u8 dir) +int xfrm_verify_policy_dir(u8 dir) { switch (dir) { case XFRM_POLICY_IN: @@ -1301,7 +1284,7 @@ static int verify_policy_type(u8 type) return 0; } -static int verify_newpolicy_info(const struct xfrm_userpolicy_info *p) +int xfrm_verify_newpolicy_info(const struct xfrm_userpolicy_info *p) { int ret; @@ -1340,7 +1323,7 @@ static int verify_newpolicy_info(const struct xfrm_userpolicy_info *p) return -EINVAL; } - ret = verify_policy_dir(p->dir); + ret = xfrm_verify_policy_dir(p->dir); if (ret) return ret; if (p->index && ((p->index & XFRM_POLICY_MAX) != p->dir)) @@ -1440,7 +1423,7 @@ static int copy_from_user_tmpl(struct xfrm_policy *pol, struct nlattr **attrs) return 0; } -static int copy_from_user_policy_type(u8 *tp, struct nlattr **attrs) +int xfrm_copy_from_user_policy_type(u8 *tp, struct nlattr **attrs) { struct nlattr *rt = attrs[XFRMA_POLICY_TYPE]; struct xfrm_userpolicy_type *upt; @@ -1490,11 +1473,10 @@ static void copy_to_user_policy(const struct xfrm_policy *xp, p->share = XFRM_SHARE_ANY; /* XXX xp->share */ } -static struct xfrm_policy *xfrm_policy_construct( - struct net *net, - const struct xfrm_userpolicy_info *p, - struct nlattr **attrs, - int *errp) +struct xfrm_policy *xfrm_policy_construct(struct net *net, + const struct xfrm_userpolicy_info *p, + struct nlattr **attrs, + int *errp) { struct xfrm_policy *xp = xfrm_policy_alloc(net, GFP_KERNEL); int err; @@ -1506,7 +1488,7 @@ static struct xfrm_policy *xfrm_policy_construct( copy_from_user_policy(xp, p); - err = copy_from_user_policy_type(&xp->type, attrs); + err = xfrm_copy_from_user_policy_type(&xp->type, attrs); if (err) goto error; @@ -1535,10 +1517,10 @@ static int xfrm_add_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, int err; int excl; - err = verify_newpolicy_info(p); + err = xfrm_verify_newpolicy_info(p); if (err) return err; - err = verify_sec_ctx_len(attrs); + err = xfrm_verify_sec_ctx_len(attrs); if (err) return err; @@ -1570,7 +1552,7 @@ static int xfrm_add_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, return 0; } -static int copy_to_user_tmpl(const struct xfrm_policy *xp, struct sk_buff *skb) +int xfrm_copy_to_user_tmpl(const struct xfrm_policy *xp, struct sk_buff *skb) { struct xfrm_user_tmpl vec[XFRM_MAX_DEPTH]; int i; @@ -1599,22 +1581,6 @@ static int copy_to_user_tmpl(const struct xfrm_policy *xp, struct sk_buff *skb) sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr, vec); } -static inline int copy_to_user_state_sec_ctx(const struct xfrm_state *x, - struct sk_buff *skb) -{ - if (x->security) { - return copy_sec_ctx(x->security, skb); - } - return 0; -} - -static inline int copy_to_user_sec_ctx(const struct xfrm_policy *xp, - struct sk_buff *skb) -{ - if (xp->security) - return copy_sec_ctx(xp->security, skb); - return 0; -} static inline size_t userpolicy_type_attrsize(void) { #ifdef CONFIG_XFRM_SUB_POLICY @@ -1624,23 +1590,6 @@ static inline size_t userpolicy_type_attrsize(void) #endif } -#ifdef CONFIG_XFRM_SUB_POLICY -static int copy_to_user_policy_type(u8 type, struct sk_buff *skb) -{ - struct xfrm_userpolicy_type upt = { - .type = type, - }; - - return nla_put(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt); -} - -#else -static inline int copy_to_user_policy_type(u8 type, struct sk_buff *skb) -{ - return 0; -} -#endif - static int dump_one_policy(const struct xfrm_policy *xp, int dir, int count, @@ -1660,7 +1609,7 @@ static int dump_one_policy(const struct xfrm_policy *xp, p = nlmsg_data(nlh); copy_to_user_policy(xp, p, dir); - err = copy_to_user_tmpl(xp, skb); + err = xfrm_copy_to_user_tmpl(xp, skb); if (!err) err = copy_to_user_sec_ctx(xp, skb); if (!err) @@ -1751,11 +1700,11 @@ static int xfrm_get_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, p = nlmsg_data(nlh); delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; - err = copy_from_user_policy_type(&type, attrs); + err = xfrm_copy_from_user_policy_type(&type, attrs); if (err) return err; - err = verify_policy_dir(p->dir); + err = xfrm_verify_policy_dir(p->dir); if (err) return err; @@ -1765,7 +1714,7 @@ static int xfrm_get_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, struct nlattr *rt = attrs[XFRMA_SEC_CTX]; struct xfrm_sec_ctx *ctx; - err = verify_sec_ctx_len(attrs); + err = xfrm_verify_sec_ctx_len(attrs); if (err) return err; @@ -2013,7 +1962,7 @@ static int xfrm_flush_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, u8 type = XFRM_POLICY_TYPE_MAIN; int err; - err = copy_from_user_policy_type(&type, attrs); + err = xfrm_copy_from_user_policy_type(&type, attrs); if (err) return err; @@ -2045,11 +1994,11 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, const struct nlmsghdr *nlh, struct xfrm_mark m; u32 mark = xfrm_mark_get(attrs, &m); - err = copy_from_user_policy_type(&type, attrs); + err = xfrm_copy_from_user_policy_type(&type, attrs); if (err) return err; - err = verify_policy_dir(p->dir); + err = xfrm_verify_policy_dir(p->dir); if (err) return err; @@ -2059,7 +2008,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, const struct nlmsghdr *nlh, struct nlattr *rt = attrs[XFRMA_SEC_CTX]; struct xfrm_sec_ctx *ctx; - err = verify_sec_ctx_len(attrs); + err = xfrm_verify_sec_ctx_len(attrs); if (err) return err; @@ -2146,7 +2095,7 @@ static int xfrm_add_acquire(struct sk_buff *skb, const struct nlmsghdr *nlh, xfrm_mark_get(attrs, &mark); - err = verify_newpolicy_info(&ua->policy); + err = xfrm_verify_newpolicy_info(&ua->policy); if (err) goto free_state; @@ -2245,7 +2194,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, const struct nlmsghdr *nlh, kmp = attrs[XFRMA_KMADDRESS] ? &km : NULL; - err = copy_from_user_policy_type(&type, attrs); + err = xfrm_copy_from_user_policy_type(&type, attrs); if (err) return err; @@ -2625,7 +2574,7 @@ static int xfrm_notify_sa_flush(const struct km_event *c) return xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_SA); } -static inline size_t xfrm_sa_len(const struct xfrm_state *x) +size_t xfrm_sa_len(const struct xfrm_state *x) { size_t l = 0; if (x->aead) @@ -2777,7 +2726,7 @@ static int build_acquire(struct sk_buff *skb, ua->calgos = xt->calgos; ua->seq = x->km.seq = seq; - err = copy_to_user_tmpl(xp, skb); + err = xfrm_copy_to_user_tmpl(xp, skb); if (!err) err = copy_to_user_state_sec_ctx(x, skb); if (!err) @@ -2846,7 +2795,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt, *dir = -EINVAL; if (len < sizeof(*p) || - verify_newpolicy_info(p)) + xfrm_verify_newpolicy_info(p)) return NULL; nr = ((len - sizeof(*p)) / sizeof(*ut)); @@ -2896,7 +2845,7 @@ static int build_polexpire(struct sk_buff *skb, upe = nlmsg_data(nlh); copy_to_user_policy(xp, &upe->pol, dir); - err = copy_to_user_tmpl(xp, skb); + err = xfrm_copy_to_user_tmpl(xp, skb); if (!err) err = copy_to_user_sec_ctx(xp, skb); if (!err) @@ -2981,7 +2930,7 @@ static int xfrm_notify_policy(const struct xfrm_policy *xp, } copy_to_user_policy(xp, p, dir); - err = copy_to_user_tmpl(xp, skb); + err = xfrm_copy_to_user_tmpl(xp, skb); if (!err) err = copy_to_user_policy_type(xp->type, skb); if (!err) diff --git a/net/xfrm/xfrm_user.h b/net/xfrm/xfrm_user.h new file mode 100644 index 000000000000..29bab2ebee83 --- /dev/null +++ b/net/xfrm/xfrm_user.h @@ -0,0 +1,90 @@ +#ifndef _XFRM_USER_H +#define _XFRM_USER_H + +#include +#include +#include +#include +#include + +struct xfrm_dump_info { + struct sk_buff *in_skb; + struct sk_buff *out_skb; + u32 nlmsg_seq; + u16 nlmsg_flags; +}; + +/* Common functions */ + +int xfrm_copy_sec_ctx(const struct xfrm_sec_ctx *s, struct sk_buff *skb); +int xfrm_copy_to_user_auth(const struct xfrm_algo_auth *auth, + struct sk_buff *skb); +int xfrm_verify_newpolicy_info(const struct xfrm_userpolicy_info *p); +struct xfrm_policy *xfrm_policy_construct(struct net *net, + const struct xfrm_userpolicy_info *p, + struct nlattr **attrs, + int *errp); +int xfrm_copy_from_user_policy_type(u8 *tp, struct nlattr **attrs); +int xfrm_verify_policy_dir(u8 dir); +int xfrm_verify_sec_ctx_len(struct nlattr **attrs); +int xfrm_nlmsg_multicast(struct net *net, struct sk_buff *skb, + u32 pid, unsigned int group); +int xfrm_copy_to_user_tmpl(const struct xfrm_policy *xp, struct sk_buff *skb); +size_t xfrm_sa_len(const struct xfrm_state *x); +int xfrm_verify_newsa_info(const struct xfrm_usersa_info *p, + struct nlattr **attrs); +struct xfrm_state *xfrm_state_construct(struct net *net, + const struct xfrm_usersa_info *p, + struct nlattr **attrs, + int *errp); +struct xfrm_state *xfrm_user_state_lookup(struct net *net, + const struct xfrm_usersa_id *p, + struct nlattr **attrs, + int *errp); + +#ifdef CONFIG_XFRM_SUB_POLICY +static inline int copy_to_user_policy_type(u8 type, struct sk_buff *skb) +{ + struct xfrm_userpolicy_type upt = { + .type = type, + }; + + return nla_put(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt); +} + +#else +static inline int copy_to_user_policy_type(u8 type, struct sk_buff *skb) +{ + return 0; +} +#endif + +static inline int copy_to_user_sec_ctx(const struct xfrm_policy *xp, + struct sk_buff *skb) +{ + if (xp->security) + return xfrm_copy_sec_ctx(xp->security, skb); + return 0; +} + +static inline int xfrm_user_sec_ctx_size(const struct xfrm_sec_ctx *xfrm_ctx) +{ + int len = 0; + + if (xfrm_ctx) { + len += sizeof(struct xfrm_user_sec_ctx); + len += xfrm_ctx->ctx_len; + } + return len; +} + +static inline int copy_to_user_state_sec_ctx(const struct xfrm_state *x, + struct sk_buff *skb) +{ + if (x->security) { + return xfrm_copy_sec_ctx(x->security, skb); + } + return 0; +} + +#endif /* _XFRM_USER_H */