Message ID | 1471276754-25266-4-git-send-email-william.c.roberts@intel.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <selinux-bounces@tycho.nsa.gov> 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 48FA760467 for <patchwork-selinux@patchwork.kernel.org>; Mon, 15 Aug 2016 16:31:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3940A28DB7 for <patchwork-selinux@patchwork.kernel.org>; Mon, 15 Aug 2016 16:31:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DF8928DCD; Mon, 15 Aug 2016 16:31:58 +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 autolearn=ham version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (emsm-gh1-uea10.nsa.gov [8.44.101.8]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B0A828DB7 for <patchwork-selinux@patchwork.kernel.org>; Mon, 15 Aug 2016 16:31:55 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.28,525,1464652800"; d="scan'208";a="16601675" IronPort-PHdr: =?us-ascii?q?9a23=3AEJ5nax/yDz1WwP9uRHKM819IXTAuvvDOBiVQ1KB8?= =?us-ascii?q?0OMcTK2v8tzYMVDF4r011RmSDNydsq8P0rKM++C4ACpbsM7H6ChDOLV3FDY9wf?= =?us-ascii?q?0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5?= =?us-ascii?q?K6zPF5LIiIzvjqbpqsSVOlgD3WLnKfMqdVPt/F2X7pFXyaJZaY8JgiPTpXVJf+?= =?us-ascii?q?kEjUhJHnm02yjG28Gr4ZR4+D5Rsf9yv+RJUKH9YrhqBecAVGduDnoxrPHPmVGD?= =?us-ascii?q?CFLXpyhUbmJDiRdMAg7Y/DnmT5zxtW38reM71y6EeYX0Urs9Qyj4x7t6Qx/vzi?= =?us-ascii?q?EcPng293+Twtd9haRXuhWgq1l7wpXISJ2EP/p5OKXGdJUVQnQFFt1dTARdE4i8?= =?us-ascii?q?aM0JFONHMuFG/KfnoF5bshq6AQilAaXkjCVPjHLswbYS0uI9HAWA1wslTIFGi2?= =?us-ascii?q?jdsNigbPRaauuy1qSdiGybYg=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2E4BwBu7bFX/wHyM5BeGgEBAQGDJ4FSpxqUFSOHVEwBAQE?= =?us-ascii?q?BAQEBAgECWyeCMgQDEYIVAgQBAiQTFCAOAwkBARcIIQgIAwEtFREHBwsFGASIE?= =?us-ascii?q?L11DAEkiCqGXxEBhXcFjxCKLo8WAolqhVeQL1SCEhyBbE4BhW2BNgEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 15 Aug 2016 16:29:58 +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 u7FGSBwu008940; Mon, 15 Aug 2016 12:28:42 -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 u7FFxYhn198295 for <selinux@prometheus.infosec.tycho.ncsc.mil>; Mon, 15 Aug 2016 11:59:34 -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 u7FFxUNI005172; Mon, 15 Aug 2016 11:59:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1DFBADi5bFX/yNjr8ZeGgEBAQGDJ4FSty2EDIYdAoFOTAEBAQEBAQECXoUGAgQnUhAgMVcHEogxvW0BAQEBBgIBJIgqjGgFjxCKLo8WAo9BkC9UghIcgWwcMgGHIwEBAQ X-IPAS-Result: A1DFBADi5bFX/yNjr8ZeGgEBAQGDJ4FSty2EDIYdAoFOTAEBAQEBAQECXoUGAgQnUhAgMVcHEogxvW0BAQEBBgIBJIgqjGgFjxCKLo8WAo9BkC9UghIcgWwcMgGHIwEBAQ X-IronPort-AV: E=Sophos;i="5.28,525,1464667200"; d="scan'208";a="5645656" 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; 15 Aug 2016 11:59:30 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AA1M3WhfkxqCha4w7o0XMSsCOlGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc++YB7h7PlgxGXEQZ/co6odzbGH6ua5BCdRut7B6ClEK80UEUddyI?= =?us-ascii?q?0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0Iu?= =?us-ascii?q?frymUrDbg8n/7e2u4ZqbO1wO32vkJ+ovZ0Tt5UWJ749N0NMkcv5wgjLy4VJwM9?= =?us-ascii?q?xMwm1pIV/B1z3d3eyXuKBZziJLpvg6/NRBW6ipN44xTLhfESh0ezttvJ6jnVD5?= =?us-ascii?q?QACO/noRVHkN2loNWlCdrUKyYpCkqSb+t+xgyAGGLMb2SvYyQj3k4KB1DFfqly?= =?us-ascii?q?wOLSJj2H3Ggcx3yqRAqVSuoAI7i5XZaYeZLv1/cubZfMgGbXZQVcZWESpaC8Wz?= =?us-ascii?q?aJVLR/ENJs5EvoL9oB0IthL4Cg6yV831zTodmX7y2awz1qIqVxvB1gE6A8kmsX?= =?us-ascii?q?LIodGzP6AXArP997XB0TiWN6Ae4jz68oWdN0l5+fw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0FsCAAe5rFX/yNjr8ZeGwEBAYMngVKnG?= =?us-ascii?q?pAThAyGHQKBTkwBAQEBAQEBAgECWyeCMgQBEwGCFAIEJ1IQIDFXBxKIMb1uAQE?= =?us-ascii?q?BAQYBAQEBI4gqjGgFjxCKLo8WAo9BkC9UghIcgWwcMgGHIwEBAQ?= X-IPAS-Result: =?us-ascii?q?A0FsCAAe5rFX/yNjr8ZeGwEBAYMngVKnGpAThAyGHQKBTkw?= =?us-ascii?q?BAQEBAQEBAgECWyeCMgQBEwGCFAIEJ1IQIDFXBxKIMb1uAQEBAQYBAQEBI4gqj?= =?us-ascii?q?GgFjxCKLo8WAo9BkC9UghIcgWwcMgGHIwEBAQ?= X-IronPort-AV: E=Sophos;i="5.28,525,1464652800"; d="scan'208";a="18475755" Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP; 15 Aug 2016 15:59:20 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga002-icc.fm.intel.com with ESMTP; 15 Aug 2016 08:59:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,525,1464678000"; d="scan'208"; a="1014647687" Received: from hkramach-mobl1.amr.corp.intel.com (HELO wcrobert-MOBL1.amr.corp.intel.com) ([10.254.184.14]) by orsmga001.jf.intel.com with ESMTP; 15 Aug 2016 08:59:17 -0700 From: william.c.roberts@intel.com To: selinux@tycho.nsa.gov, jwcart2@tycho.nsa.gov, seandroid-list@tycho.nsa.gov, sds@tycho.nsa.gov Subject: [PATCH v3 3/7] ebitmap: detect invalid bitmap Date: Mon, 15 Aug 2016 08:59:10 -0700 Message-Id: <1471276754-25266-4-git-send-email-william.c.roberts@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471276754-25266-1-git-send-email-william.c.roberts@intel.com> References: <1471276754-25266-1-git-send-email-william.c.roberts@intel.com> X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" <selinux.tycho.nsa.gov> List-Post: <mailto:selinux@tycho.nsa.gov> List-Help: <mailto:selinux-request@tycho.nsa.gov?subject=help> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" <selinux-bounces@tycho.nsa.gov> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/libsepol/src/ebitmap.c b/libsepol/src/ebitmap.c index 58f2fc4..fe8beb8 100644 --- a/libsepol/src/ebitmap.c +++ b/libsepol/src/ebitmap.c @@ -394,6 +394,10 @@ int ebitmap_read(ebitmap_t * e, void *fp) e->highbit, MAPSIZE); goto bad; } + + if (e->highbit && !count) + goto bad; + l = NULL; for (i = 0; i < count; i++) { rc = next_entry(buf, fp, sizeof(uint32_t));