Skip to content

Commit

Permalink
netlabel: fix export of SELinux categories > 127
Browse files Browse the repository at this point in the history
This fixes corrupted CIPSO packets when SELinux categories greater than 127
are used.  The bug occured on the second (and later) loops through the
while; the inner for loop through the ebitmap->maps array used the same
index as the NetLabel catmap->bitmap array, even though the NetLabel bitmap
is twice as long as the SELinux bitmap.

Signed-off-by: Joshua Roys <joshua.roys@gtri.gatech.edu>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Joshua Roys authored and James Morris committed Feb 25, 2010
1 parent baac35c commit c36f74e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/selinux/ss/ebitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap,
cmap_idx = delta / NETLBL_CATMAP_MAPSIZE;
cmap_sft = delta % NETLBL_CATMAP_MAPSIZE;
c_iter->bitmap[cmap_idx]
|= e_iter->maps[cmap_idx] << cmap_sft;
|= e_iter->maps[i] << cmap_sft;
}
e_iter = e_iter->next;
}
Expand Down

0 comments on commit c36f74e

Please sign in to comment.