]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: don't waste ebitmap space when importing NetLabel categories
authorPaul Moore <pmoore@redhat.com>
Thu, 9 Jul 2015 18:20:36 +0000 (14:20 -0400)
committerPaul Moore <pmoore@redhat.com>
Thu, 9 Jul 2015 18:20:36 +0000 (14:20 -0400)
commitb014e2491d3f54f209892ebe28034f2d8810e8d3
tree649a698e2fd30d766dd5f465f36f961c3292cb5e
parentc29c3080c989e19d9392e044c66a0844e9891941
selinux: don't waste ebitmap space when importing NetLabel categories

At present we don't create efficient ebitmaps when importing NetLabel
category bitmaps.  This can present a problem when comparing ebitmaps
since ebitmap_cmp() is very strict about these things and considers
these wasteful ebitmaps not equal when compared to their more
efficient counterparts, even if their values are the same.  This isn't
likely to cause problems on 64-bit systems due to a bit of luck on
how NetLabel/CIPSO works and the default ebitmap size, but it can be
a problem on 32-bit systems.

This patch fixes this problem by being a bit more intelligent when
importing NetLabel category bitmaps by skipping over empty sections
which should result in a nice, efficient ebitmap.

Cc: stable@vger.kernel.org # 3.17
Signed-off-by: Paul Moore <pmoore@redhat.com>
security/selinux/ss/ebitmap.c