Skip to content

Commit

Permalink
SELinux: kills warnings in Improve SELinux performance when AVC misses
Browse files Browse the repository at this point in the history
This patch kills ugly warnings when the "Improve SELinux performance
when ACV misses" patch.

Signed-off-by: KaiGai Kohei <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
kaigai authored and James Morris committed Oct 16, 2007
1 parent 9fe79ad commit 087feb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 5 additions & 6 deletions security/selinux/ss/ebitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int ebitmap_netlbl_import(struct ebitmap *ebmap,
e_sft = delta % EBITMAP_UNIT_SIZE;
while (map) {
e_iter->maps[e_idx++] |= map & (-1UL);
map >>= EBITMAP_UNIT_SIZE;
map = EBITMAP_SHIFT_UNIT_SIZE(map);
}
}
c_iter = c_iter->next;
Expand Down Expand Up @@ -389,13 +389,13 @@ int ebitmap_read(struct ebitmap *e, void *fp)

if (startbit & (mapunit - 1)) {
printk(KERN_ERR "security: ebitmap start bit (%d) is "
"not a multiple of the map unit size (%Zd)\n",
"not a multiple of the map unit size (%u)\n",
startbit, mapunit);
goto bad;
}
if (startbit > e->highbit - mapunit) {
printk(KERN_ERR "security: ebitmap start bit (%d) is "
"beyond the end of the bitmap (%Zd)\n",
"beyond the end of the bitmap (%u)\n",
startbit, (e->highbit - mapunit));
goto bad;
}
Expand Down Expand Up @@ -433,9 +433,8 @@ int ebitmap_read(struct ebitmap *e, void *fp)

index = (startbit - n->startbit) / EBITMAP_UNIT_SIZE;
while (map) {
n->maps[index] = map & (-1UL);
map = map >> EBITMAP_UNIT_SIZE;
index++;
n->maps[index++] = map & (-1UL);
map = EBITMAP_SHIFT_UNIT_SIZE(map);
}
}
ok:
Expand Down
2 changes: 2 additions & 0 deletions security/selinux/ss/ebitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#define EBITMAP_UNIT_SIZE BITS_PER_LONG
#define EBITMAP_SIZE (EBITMAP_UNIT_NUMS * EBITMAP_UNIT_SIZE)
#define EBITMAP_BIT 1ULL
#define EBITMAP_SHIFT_UNIT_SIZE(x) \
(((x) >> EBITMAP_UNIT_SIZE / 2) >> EBITMAP_UNIT_SIZE / 2)

struct ebitmap_node {
struct ebitmap_node *next;
Expand Down

0 comments on commit 087feb9

Please sign in to comment.