From patchwork Thu Mar 29 20:06:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Carter X-Patchwork-Id: 10316111 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 A1769602D6 for ; Thu, 29 Mar 2018 20:05:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DF502A4D5 for ; Thu, 29 Mar 2018 20:05:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 805692A4E5; Thu, 29 Mar 2018 20:05:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from USFB19PA14.eemsg.mail.mil (uphb19pa11.eemsg.mail.mil [214.24.26.85]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ED212A4D5 for ; Thu, 29 Mar 2018 20:05:55 +0000 (UTC) Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by USFB19PA14.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 29 Mar 2018 20:05:52 +0000 X-IronPort-AV: E=Sophos;i="5.48,378,1517875200"; d="scan'208";a="11404375" IronPort-PHdr: =?us-ascii?q?9a23=3AuONN7hbUMfxf1dZBzo3uuoL/LSx+4OfEezUN45?= =?us-ascii?q?9isYplN5qZosm8Yh7h7PlgxGXEQZ/co6odzbaO6Oa4ASQp2tWoiDg6aptCVh?= =?us-ascii?q?sI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFR?= =?us-ascii?q?rhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahb75+Ngm6oRnMvcQKnIVuLbo8xA?= =?us-ascii?q?HUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLn?= =?us-ascii?q?s65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD?= =?us-ascii?q?+t4b1rSBv1gykZMTA3/nzchshpgK5FvB6tohpyyJPWbo6ILvpzZqPTc80US2?= =?us-ascii?q?RCWchfSjRBD4GhY4YBEeUBJv1Vo5Xhq1YUsRezHxWgCP/pxzRVhnH2x6o60+?= =?us-ascii?q?E5HA/CxgMgGswBsG/Jp9jrLqgSS/y1w7fSzT7eaP5W2zn855TSfRA7vfGAQ6?= =?us-ascii?q?l9cdbRyEYzFwPFiU+cqYr+PzyPzOgNvG+b7/R5WO+plmUpqBlxryCyysojhY?= =?us-ascii?q?TFnIIYxk3e+Slnz4s5O8e0RFN9bNW5CpVfrTuaOJFzQs46RmFovzs1xaMetJ?= =?us-ascii?q?6geSgK1IwnxxnCa/yba4SI4gzsVOKWITpgmHJqYqi/hxev8Ui70OH8Ssm130?= =?us-ascii?q?pKripCiNXMsGwC1wfP5cSdT/t9/0Oh1S6O1wDV9O5EPVg5mbfUJpMu2LI9lo?= =?us-ascii?q?cfvV7dEiL5hkn6lrKael0h+uey6uTnZrvmpoWbN49xkgz+Kbohmsi+AeQ+Lw?= =?us-ascii?q?gPUHGX9v+71L3++032XKtFjuYtn6nFsJHVOcQbpqmjDw9TyYYs8QyzDzih0N?= =?us-ascii?q?QGhXUHNk5KeAqbj4j1PFHDOPL4DfC5g1u2jDdrx+rJPrv6D5XPKXjDlrLhcq?= =?us-ascii?q?xm605A1gUz18tf64hTCrEbL/L5QlXxu8DADh8lLwy0xP7qCNd/1owERW2PAb?= =?us-ascii?q?SZMKTUsV+J+OIiOOeMZIsIuDfyMPcl+vjujWMkmVMHeqmpx5QXYmiiHvt6O0?= =?us-ascii?q?WZfWbsgtAZHGcSoAUxV/LliFuDUT5PYHa/RKM86S8lB424F4vDQZqtgLOZ1i?= =?us-ascii?q?ehApJWfnxGCkyLEXrwaoqEXPEMaCSPLcB/ljwEVKOsRJU/2hG0sw/20b1nLv?= =?us-ascii?q?Db+icAr5LsyMB15/HPlRE17TF7Etid3HuXT2xvgmwIQDo207xlrkxm1lePy6?= =?us-ascii?q?54jOJEFdZL/fNGTh86NYLAz+x9E93yWwTBfsuXR1aiXNqmBC8+Ts4rw94OeE?= =?us-ascii?q?t9HM2igQ7F3yqvGbAVlriLC4cz8qPTxXTxINx9y3ne3qk7k1YmWtdPNXGhhq?= =?us-ascii?q?Nn9wnSBonJk0OCmqavcaQQxS/N9GGZwWqIpk5YSg1wUaTbXX8BfEfWq8r25l?= =?us-ascii?q?/aRb+0FbsnKhdBydKFKqZSdNLplU9JRO3iONTFeG+xg32/BQyJxrOXdIrqf3?= =?us-ascii?q?8S0znDB0QelAAT53mGPxAkBii9u2LeECBuFVX3bkLi8Ol+rHa7QVEuzwyRYU?= =?us-ascii?q?1uyae6+hkPhfOGU/MTxLUEuCU/pDpoAFaxxdXWC8CPpwB5ZqVTfcs94Etb1W?= =?us-ascii?q?LerwF9MIagILpkhlECcgR3pFjj1xBvCoVBiMQqt30rzBFoJaKfylNBeCuS3Y?= =?us-ascii?q?rsNb3PNmny4BevZrbV2l7E09aW/boP5e87q1r5vwGpEVci/29g09lP3HuW/o?= =?us-ascii?q?/KAxYKUZLtTkY38AB3qKvHbSkn5oPby2dsPLKuvTDe3tIlHuwlygyvf91HKq?= =?us-ascii?q?OLCBfyE9EGB8ipMOElh0KmbhYaM+BJ6K41P8SmeuCd2KG3PeZvgjSmjXhG4I?= =?us-ascii?q?9nyE6M8TRzSvLQ1ZYf3/6YxheHVyv7jFq5qMD4hJ1LaCodHmq6xinoHohRab?= =?us-ascii?q?NufYwTE2ehP9W3xslih57qQ3NY71CjB0kB2M+yZRqfdEf93QtX1UUZpHyogy?= =?us-ascii?q?24wy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ascii?q?iX5fI6lL8BZHZ1YwyhEOgSTMIdwHnvzbwyxyI2D8zDB67g+OJEV38hmDLgn4?= =?us-ascii?q?twH1QQGvMRB7aL/IJenmkim+PDLd0WbrpCmnuTGh64D78C02Ck5zGQIGl/jR?= =?us-ascii?q?HEywvwTn+r7F/qsS94RjPBz9LkkkpTSrm3ClldUjGsOU95qjyPOhTntMb5uK?= =?us-ascii?q?Qy9kE2MXfkuMiLlGS/JLNdB9f/K8CEISkouFIXi4U8Rti02YAeGdewO9kR/2?= =?us-ascii?q?9jYfvZ8WOkiTdBo71Ah4rc/M6a5unXEWOnj62ApLWH3CpYxWQgvVEj9tCgMe?= =?us-ascii?q?nD59yLQvuyzWkeUzxyuxDfUB6ptLPUs0oYOUuR0EfEgIYKJM1W3WEk1kH64+?= =?us-ascii?q?guWMk89ARFFofOffwCpzHzOCfswVmFftI3UjKT3CdQHl3oD1Z3ArU82Hj3vM?= =?us-ascii?q?LTj3jc4VooRpN/d0b/nxx4E504KV4x6FgQ2icDCRICaQyHA7GoC0XlKpEEVU?= =?us-ascii?q?saZRScwre6fqY33UtuwrKg/+LTdfZzB7YROfZdgA+Om0JbGpEMva0dXr18YV?= =?us-ascii?q?ld+7DTpgT4DIjnRffmn2IqNfKpWsBa7dwZt3w67wawXRWg84lM76obiJ2Tcq?= =?us-ascii?q?5EYITMs95870h9+D4PbTZBgB5hgBOlSeocvvzs4sDHsJq07eajTKktSPsR9x?= =?us-ascii?q?goAGR+iJz8gEs9rtHT1udcTJDViIvk/QBJPXGKoobb3ANmJeoINY2rYK5q92?= =?us-ascii?q?8bKCgGO3IOId2WZuE64y9sLDrT4FhCDdkXZd8CPcrNngdUilbyWLxI88rWFV?= =?us-ascii?q?CZB510d8Ay4Gr90Co1/ockUub89D+2IojS715RMPNYlyVgjc/MqucTz/rTDi?= =?us-ascii?q?gX/HaYZgN6wiOH0ZaNDej/8f+LyNHOWFMMBjQ2XJtFJDqe5QynQfK4lJfuUg?= =?us-ascii?q?OU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1p?= =?us-ascii?q?byOc3Vov+ADv3EwUQqf31VX7sabA7u+YU1IMQ5W7zSHLteuxQQH646T4I9Nz?= =?us-ascii?q?S5yKYhNw53cwjMdJyok8LqoaSNfZISqHjIvXwqKyKJmRQGx+f8ZgVhc52wzy?= =?us-ascii?q?HwP5s5XC4bh8F8ARthWo1UEoUPqBTxUM3co72yl9LkoxAygOQNq6elT6qS2Q?= =?us-ascii?q?=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2DdAgD3Rb1a/wHyM5BdHAEBAQQBAQoBAYMTBCuBUBUTi?= =?us-ascii?q?1xejCSDA5JRFIFZMIkIITQYAQIBAQEBAQECAWooQg4BgWckglECJFUDCQJIC?= =?us-ascii?q?AMBbAWCV1qBSg2vTjOEVYNrgiqHXoITgQyHW4VsAoEjAZYPBgKOIQuMMpEfH?= =?us-ascii?q?DiBUisIAhgpSYEdgSaCIBeOFR1TiDKGRQEB?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 29 Mar 2018 20:05:51 +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 w2TK5Pvc020351; Thu, 29 Mar 2018 16:05:30 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id w2TK5JXY052961 for ; Thu, 29 Mar 2018 16:05:19 -0400 Received: from moss-lions.infosec.tycho.ncsc.mil (moss-lions [192.168.25.4]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w2TK5NUK020349 for ; Thu, 29 Mar 2018 16:05:23 -0400 From: James Carter To: selinux@tycho.nsa.gov Date: Thu, 29 Mar 2018 16:06:49 -0400 Message-Id: <20180329200649.30211-1-jwcart2@tycho.nsa.gov> X-Mailer: git-send-email 2.13.6 Subject: [PATCH 1/1] libsepol/cil: Improve processing of context rules 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 Improve the processing of netifcon, genfscon, ibpkeycon, ibendportcon, portcon, nodecon, fsuse, filecon, iomemcon, ioportcon, pcidevicecon, and devicetreecon rules. If the multiple-decls option is not used then report errors if duplicate context rules are found. If it is used then remove duplicate context rules and report errors when two rules are identical except for the context. This also changes the ordering of portcon and filecon rules. The protocol of portcon rules will be compared if the port numbers are the same and the path strings of filecon rules will be compared if the number of meta characters, the stem length, string length and file types are the same. Based on an initial patch by Pierre-Hugues Husson (phh@phh.me) Signed-off-by: James Carter Acked-by: Jeff Vander Stoep --- libsepol/cil/src/cil_post.c | 331 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 318 insertions(+), 13 deletions(-) diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c index a2122454..0b09cecc 100644 --- a/libsepol/cil/src/cil_post.c +++ b/libsepol/cil/src/cil_post.c @@ -53,6 +53,83 @@ static int __cil_expr_to_bitmap(struct cil_list *expr, ebitmap_t *out, int max, struct cil_db *db); static int __cil_expr_list_to_bitmap(struct cil_list *expr_list, ebitmap_t *out, int max, struct cil_db *db); +static int cats_compare(struct cil_cats *a, struct cil_cats *b) +{ + struct cil_list_item *i, *j; + int rc; + + if (a == b) return 0; + if (!a) return -1; + if (!b) return 1; + + /* Expects cat expression to have been evaluated */ + cil_list_for_each(i, a->datum_expr) { + cil_list_for_each(j, b->datum_expr) { + rc = strcmp(DATUM(i->data)->fqn, DATUM(j->data)->fqn); + if (!rc) return rc; + } + } + return 0; +} + +static int level_compare(struct cil_level *a, struct cil_level *b) +{ + int rc; + + if (a == b) return 0; + if (!a) return -1; + if (!b) return 1; + + if (a->sens != b->sens) { + rc = strcmp(DATUM(a->sens)->fqn, DATUM(b->sens)->fqn); + if (rc != 0) return rc; + } + if (a->cats != b->cats) { + return cats_compare(a->cats, b->cats); + } + return 0; +} + +static int range_compare(struct cil_levelrange *a, struct cil_levelrange *b) +{ + int rc; + + if (a == b) return 0; + if (!a) return -1; + if (!b) return 1; + + if (a->low != b->low) { + rc = level_compare(a->low, b->low); + if (rc != 0) return rc; + } + if (a->high != b->high) { + return level_compare(a->high, b->high); + } + return 0; +} + +static int context_compare(struct cil_context *a, struct cil_context *b) +{ + int rc; + + if (a->user != b->user) { + rc = strcmp(DATUM(a->user)->fqn, DATUM(b->user)->fqn); + if (rc != 0) return rc; + } + if (a->role != b->role) { + rc = strcmp(DATUM(a->role)->fqn, DATUM(b->role)->fqn); + if (rc != 0) return rc; + } + if (a->type != b->type) { + rc = strcmp(DATUM(a->type)->fqn, DATUM(b->type)->fqn); + if (rc != 0) return rc; + } + if (a->range != b->range) { + return range_compare(a->range, b->range); + } + return 0; +} + static int cil_verify_is_list(struct cil_list *list, enum cil_flavor flavor) { struct cil_list_item *curr; @@ -145,6 +222,8 @@ int cil_post_filecon_compare(const void *a, const void *b) rc = -1; } else if (b_filecon->type < a_filecon->type) { rc = 1; + } else { + rc = strcmp(a_filecon->path_str, b_filecon->path_str); } free(a_path); @@ -190,6 +269,10 @@ int cil_post_portcon_compare(const void *a, const void *b) rc = -1; } else if (bportcon->port_low < aportcon->port_low) { rc = 1; + } else if (aportcon->proto < bportcon->proto) { + rc = -1; + } else if (aportcon->proto > bportcon->proto) { + rc = 1; } } @@ -369,6 +452,102 @@ int cil_post_fsuse_compare(const void *a, const void *b) return rc; } +int cil_post_filecon_context_compare(const void *a, const void *b) +{ + struct cil_filecon *a_filecon = *(struct cil_filecon**)a; + struct cil_filecon *b_filecon = *(struct cil_filecon**)b; + return context_compare(a_filecon->context, b_filecon->context); +} + +int cil_post_ibpkeycon_context_compare(const void *a, const void *b) +{ + struct cil_ibpkeycon *a_ibpkeycon = *(struct cil_ibpkeycon **)a; + struct cil_ibpkeycon *b_ibpkeycon = *(struct cil_ibpkeycon **)b; + return context_compare(a_ibpkeycon->context, b_ibpkeycon->context); +} + +int cil_post_portcon_context_compare(const void *a, const void *b) +{ + struct cil_portcon *a_portcon = *(struct cil_portcon**)a; + struct cil_portcon *b_portcon = *(struct cil_portcon**)b; + return context_compare(a_portcon->context, b_portcon->context); +} + +int cil_post_genfscon_context_compare(const void *a, const void *b) +{ + struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a; + struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b; + return context_compare(a_genfscon->context, b_genfscon->context); +} + +int cil_post_netifcon_context_compare(const void *a, const void *b) +{ + int rc; + struct cil_netifcon *a_netifcon = *(struct cil_netifcon**)a; + struct cil_netifcon *b_netifcon = *(struct cil_netifcon**)b; + rc = context_compare(a_netifcon->if_context, b_netifcon->if_context); + if (rc != 0) { + return rc; + } + return context_compare(a_netifcon->packet_context, b_netifcon->packet_context); +} + +int cil_post_ibendportcon_context_compare(const void *a, const void *b) +{ + struct cil_ibendportcon *a_ibendportcon = *(struct cil_ibendportcon **)a; + struct cil_ibendportcon *b_ibendportcon = *(struct cil_ibendportcon **)b; + return context_compare(a_ibendportcon->context, b_ibendportcon->context); +} + +int cil_post_nodecon_context_compare(const void *a, const void *b) +{ + struct cil_nodecon *a_nodecon = *(struct cil_nodecon **)a; + struct cil_nodecon *b_nodecon = *(struct cil_nodecon **)b; + return context_compare(a_nodecon->context, b_nodecon->context); +} + +int cil_post_pirqcon_context_compare(const void *a, const void *b) +{ + struct cil_pirqcon *a_pirqcon = *(struct cil_pirqcon**)a; + struct cil_pirqcon *b_pirqcon = *(struct cil_pirqcon**)b; + return context_compare(a_pirqcon->context, b_pirqcon->context); +} + +int cil_post_iomemcon_context_compare(const void *a, const void *b) +{ + struct cil_iomemcon *a_iomemcon = *(struct cil_iomemcon**)a; + struct cil_iomemcon *b_iomemcon = *(struct cil_iomemcon**)b; + return context_compare(a_iomemcon->context, b_iomemcon->context); +} + +int cil_post_ioportcon_context_compare(const void *a, const void *b) +{ + struct cil_ioportcon *a_ioportcon = *(struct cil_ioportcon**)a; + struct cil_ioportcon *b_ioportcon = *(struct cil_ioportcon**)b; + return context_compare(a_ioportcon->context, b_ioportcon->context); +} + +int cil_post_pcidevicecon_context_compare(const void *a, const void *b) +{ + struct cil_pcidevicecon *a_pcidevicecon = *(struct cil_pcidevicecon**)a; + struct cil_pcidevicecon *b_pcidevicecon = *(struct cil_pcidevicecon**)b; + return context_compare(a_pcidevicecon->context, b_pcidevicecon->context); +} + +int cil_post_devicetreecon_context_compare(const void *a, const void *b) +{ + struct cil_devicetreecon *a_devicetreecon = *(struct cil_devicetreecon**)a; + struct cil_devicetreecon *b_devicetreecon = *(struct cil_devicetreecon**)b; + return context_compare(a_devicetreecon->context, b_devicetreecon->context); +} + +int cil_post_fsuse_context_compare(const void *a, const void *b) +{ + struct cil_fsuse *a_fsuse = *(struct cil_fsuse**)a; + struct cil_fsuse *b_fsuse = *(struct cil_fsuse**)b; + return context_compare(a_fsuse->context, b_fsuse->context); +} + static int __cil_post_db_count_helper(struct cil_tree_node *node, uint32_t *finished, void *extra_args) { struct cil_db *db = extra_args; @@ -2064,6 +2243,74 @@ exit: return rc; } +static int __cil_post_report_conflict(struct cil_tree_node *node, uint32_t *finished, void *extra_args) +{ + struct cil_list_item *li = extra_args; + + if (node->flavor == CIL_BLOCK) { + struct cil_block *blk = node->data; + if (blk->is_abstract == CIL_TRUE) { + *finished = CIL_TREE_SKIP_HEAD; + } + } else if (node->flavor == CIL_MACRO) { + *finished = CIL_TREE_SKIP_HEAD; + } else if (node->flavor == li->flavor) { + if (node->data == li->data) { + char *path = cil_tree_get_cil_path(node); + cil_log(CIL_WARN, " at %s:%d\n", path, node->line); + } + } + return SEPOL_OK; +} + +static int __cil_post_process_context_rules(struct cil_sort *sort, int (*compar)(const void *, const void *), int (*concompar)(const void *, const void *), struct cil_db *db, enum cil_flavor flavor, const char *flavor_str) +{ + uint32_t count = sort->count; + uint32_t i, j = 0, removed = 0; + int rc = SEPOL_OK; + + if (count < 2) { + return SEPOL_OK; + } + + qsort(sort->array, sort->count, sizeof(sort->array), compar); + + for (i=1; iarray[i], &sort->array[j]) != 0) { + j++; + } else { + removed++; + if (!db->multiple_decls || + concompar(&sort->array[i], &sort->array[j]) != 0) { + struct cil_list_item li; + int rc2; + cil_log(CIL_WARN, "Found conflicting %s rules\n", + flavor_str); + rc = SEPOL_ERR; + li.flavor = flavor; + li.data = sort->array[i]; + rc2 = cil_tree_walk(db->ast->root, + __cil_post_report_conflict, + NULL, NULL, &li); + if (rc2 != SEPOL_OK) goto exit; + li.data = sort->array[j]; + rc2 = cil_tree_walk(db->ast->root, + __cil_post_report_conflict, + NULL, NULL, &li); + if (rc2 != SEPOL_OK) goto exit; + } + } + if (i != j) { + sort->array[j] = sort->array[i]; + } + } + + sort->count = count - removed; + +exit: + return rc; +} + static int cil_post_db(struct cil_db *db) { int rc = SEPOL_ERR; @@ -2116,19 +2363,77 @@ static int cil_post_db(struct cil_db *db) goto exit; } - qsort(db->netifcon->array, db->netifcon->count, sizeof(db->netifcon->array), cil_post_netifcon_compare); - qsort(db->genfscon->array, db->genfscon->count, sizeof(db->genfscon->array), cil_post_genfscon_compare); - qsort(db->ibpkeycon->array, db->ibpkeycon->count, sizeof(db->ibpkeycon->array), cil_post_ibpkeycon_compare); - qsort(db->ibendportcon->array, db->ibendportcon->count, sizeof(db->ibendportcon->array), cil_post_ibendportcon_compare); - qsort(db->portcon->array, db->portcon->count, sizeof(db->portcon->array), cil_post_portcon_compare); - qsort(db->nodecon->array, db->nodecon->count, sizeof(db->nodecon->array), cil_post_nodecon_compare); - qsort(db->fsuse->array, db->fsuse->count, sizeof(db->fsuse->array), cil_post_fsuse_compare); - qsort(db->filecon->array, db->filecon->count, sizeof(db->filecon->array), cil_post_filecon_compare); - qsort(db->pirqcon->array, db->pirqcon->count, sizeof(db->pirqcon->array), cil_post_pirqcon_compare); - qsort(db->iomemcon->array, db->iomemcon->count, sizeof(db->iomemcon->array), cil_post_iomemcon_compare); - qsort(db->ioportcon->array, db->ioportcon->count, sizeof(db->ioportcon->array), cil_post_ioportcon_compare); - qsort(db->pcidevicecon->array, db->pcidevicecon->count, sizeof(db->pcidevicecon->array), cil_post_pcidevicecon_compare); - qsort(db->devicetreecon->array, db->devicetreecon->count, sizeof(db->devicetreecon->array), cil_post_devicetreecon_compare); + rc = __cil_post_process_context_rules(db->netifcon, cil_post_netifcon_compare, cil_post_netifcon_context_compare, db, CIL_NETIFCON, CIL_KEY_NETIFCON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing netifcon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->genfscon, cil_post_genfscon_compare, cil_post_genfscon_context_compare, db, CIL_GENFSCON, CIL_KEY_GENFSCON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing genfscon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->ibpkeycon, cil_post_ibpkeycon_compare, cil_post_ibpkeycon_context_compare, db, CIL_IBPKEYCON, CIL_KEY_IBPKEYCON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing ibpkeycon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->ibendportcon, cil_post_ibendportcon_compare, cil_post_ibendportcon_context_compare, db, CIL_IBENDPORTCON, CIL_KEY_IBENDPORTCON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing ibendportcon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->portcon, cil_post_portcon_compare, cil_post_portcon_context_compare, db, CIL_PORTCON, CIL_KEY_PORTCON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing portcon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->nodecon, cil_post_nodecon_compare, cil_post_nodecon_context_compare, db, CIL_NODECON, CIL_KEY_NODECON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing nodecon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->fsuse, cil_post_fsuse_compare, cil_post_fsuse_context_compare, db, CIL_FSUSE, CIL_KEY_FSUSE); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing fsuse rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->filecon, cil_post_filecon_compare, cil_post_filecon_context_compare, db, CIL_FILECON, CIL_KEY_FILECON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing filecon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->iomemcon, cil_post_iomemcon_compare, cil_post_iomemcon_context_compare, db, CIL_IOMEMCON, CIL_KEY_IOMEMCON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing iomemcon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->ioportcon, cil_post_ioportcon_compare, cil_post_ioportcon_context_compare, db, CIL_IOPORTCON, CIL_KEY_IOPORTCON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing ioportcon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->pcidevicecon, cil_post_pcidevicecon_compare, cil_post_pcidevicecon_context_compare, db, CIL_PCIDEVICECON, CIL_KEY_PCIDEVICECON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing pcidevicecon rules\n"); + goto exit; + } + + rc = __cil_post_process_context_rules(db->devicetreecon, cil_post_devicetreecon_compare, cil_post_devicetreecon_context_compare, db, CIL_DEVICETREECON, CIL_KEY_DEVICETREECON); + if (rc != SEPOL_OK) { + cil_log(CIL_ERR, "Problems processing devicetreecon rules\n"); + goto exit; + } exit: return rc;