diff options
author | Joshua Roys <joshua.roys@gtri.gatech.edu> | 2010-02-24 18:52:44 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-02-25 01:49:20 -0500 |
commit | c36f74e67fa12202dbcb4ad92c5ac844f9d36b98 (patch) | |
tree | 13cf4be470470b32ce348202ab4ba6a342c39ed9 /security/selinux | |
parent | baac35c4155a8aa826c70acee6553368ca5243a2 (diff) |
netlabel: fix export of SELinux categories > 127
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>
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/ss/ebitmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c index 68c7348d1acc..04b6145d767f 100644 --- a/security/selinux/ss/ebitmap.c +++ b/security/selinux/ss/ebitmap.c | |||
@@ -128,7 +128,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap, | |||
128 | cmap_idx = delta / NETLBL_CATMAP_MAPSIZE; | 128 | cmap_idx = delta / NETLBL_CATMAP_MAPSIZE; |
129 | cmap_sft = delta % NETLBL_CATMAP_MAPSIZE; | 129 | cmap_sft = delta % NETLBL_CATMAP_MAPSIZE; |
130 | c_iter->bitmap[cmap_idx] | 130 | c_iter->bitmap[cmap_idx] |
131 | |= e_iter->maps[cmap_idx] << cmap_sft; | 131 | |= e_iter->maps[i] << cmap_sft; |
132 | } | 132 | } |
133 | e_iter = e_iter->next; | 133 | e_iter = e_iter->next; |
134 | } | 134 | } |