diff options
author | Paul Moore <pmoore@redhat.com> | 2014-08-01 11:17:37 -0400 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2014-08-01 11:17:37 -0400 |
commit | 4fbe63d1c773cceef3fe1f6ed0c9c268f4f24760 (patch) | |
tree | ac8a91fc13402494d211489ef3123aea3a5164f7 | |
parent | d960a6184a92c8da70d26355bfcb5bd8ad637743 (diff) |
netlabel: shorter names for the NetLabel catmap funcs/structs
Historically the NetLabel LSM secattr catmap functions and data
structures have had very long names which makes a mess of the NetLabel
code and anyone who uses NetLabel. This patch renames the catmap
functions and structures from "*_secattr_catmap_*" to just "*_catmap_*"
which improves things greatly.
There are no substantial code or logic changes in this patch.
Signed-off-by: Paul Moore <pmoore@redhat.com>
Tested-by: Casey Schaufler <casey@schaufler-ca.com>
-rw-r--r-- | include/net/netlabel.h | 100 | ||||
-rw-r--r-- | net/ipv4/cipso_ipv4.c | 35 | ||||
-rw-r--r-- | net/netlabel/netlabel_kapi.c | 109 | ||||
-rw-r--r-- | security/selinux/ss/ebitmap.c | 18 | ||||
-rw-r--r-- | security/selinux/ss/ebitmap.h | 8 | ||||
-rw-r--r-- | security/smack/smack_access.c | 6 | ||||
-rw-r--r-- | security/smack/smack_lsm.c | 6 | ||||
-rw-r--r-- | security/smack/smackfs.c | 14 |
8 files changed, 139 insertions, 157 deletions
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index bda7a121f31e..a4fc39bb3e4f 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -139,7 +139,7 @@ struct netlbl_lsm_cache { | |||
139 | }; | 139 | }; |
140 | 140 | ||
141 | /** | 141 | /** |
142 | * struct netlbl_lsm_secattr_catmap - NetLabel LSM secattr category bitmap | 142 | * struct netlbl_lsm_catmap - NetLabel LSM secattr category bitmap |
143 | * @startbit: the value of the lowest order bit in the bitmap | 143 | * @startbit: the value of the lowest order bit in the bitmap |
144 | * @bitmap: the category bitmap | 144 | * @bitmap: the category bitmap |
145 | * @next: pointer to the next bitmap "node" or NULL | 145 | * @next: pointer to the next bitmap "node" or NULL |
@@ -162,10 +162,10 @@ struct netlbl_lsm_cache { | |||
162 | #define NETLBL_CATMAP_SIZE (NETLBL_CATMAP_MAPSIZE * \ | 162 | #define NETLBL_CATMAP_SIZE (NETLBL_CATMAP_MAPSIZE * \ |
163 | NETLBL_CATMAP_MAPCNT) | 163 | NETLBL_CATMAP_MAPCNT) |
164 | #define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01 | 164 | #define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01 |
165 | struct netlbl_lsm_secattr_catmap { | 165 | struct netlbl_lsm_catmap { |
166 | u32 startbit; | 166 | u32 startbit; |
167 | NETLBL_CATMAP_MAPTYPE bitmap[NETLBL_CATMAP_MAPCNT]; | 167 | NETLBL_CATMAP_MAPTYPE bitmap[NETLBL_CATMAP_MAPCNT]; |
168 | struct netlbl_lsm_secattr_catmap *next; | 168 | struct netlbl_lsm_catmap *next; |
169 | }; | 169 | }; |
170 | 170 | ||
171 | /** | 171 | /** |
@@ -209,7 +209,7 @@ struct netlbl_lsm_secattr { | |||
209 | struct netlbl_lsm_cache *cache; | 209 | struct netlbl_lsm_cache *cache; |
210 | struct { | 210 | struct { |
211 | struct { | 211 | struct { |
212 | struct netlbl_lsm_secattr_catmap *cat; | 212 | struct netlbl_lsm_catmap *cat; |
213 | u32 lvl; | 213 | u32 lvl; |
214 | } mls; | 214 | } mls; |
215 | u32 secid; | 215 | u32 secid; |
@@ -258,7 +258,7 @@ static inline void netlbl_secattr_cache_free(struct netlbl_lsm_cache *cache) | |||
258 | } | 258 | } |
259 | 259 | ||
260 | /** | 260 | /** |
261 | * netlbl_secattr_catmap_alloc - Allocate a LSM secattr catmap | 261 | * netlbl_catmap_alloc - Allocate a LSM secattr catmap |
262 | * @flags: memory allocation flags | 262 | * @flags: memory allocation flags |
263 | * | 263 | * |
264 | * Description: | 264 | * Description: |
@@ -266,24 +266,22 @@ static inline void netlbl_secattr_cache_free(struct netlbl_lsm_cache *cache) | |||
266 | * on failure. | 266 | * on failure. |
267 | * | 267 | * |
268 | */ | 268 | */ |
269 | static inline struct netlbl_lsm_secattr_catmap *netlbl_secattr_catmap_alloc( | 269 | static inline struct netlbl_lsm_catmap *netlbl_catmap_alloc(gfp_t flags) |
270 | gfp_t flags) | ||
271 | { | 270 | { |
272 | return kzalloc(sizeof(struct netlbl_lsm_secattr_catmap), flags); | 271 | return kzalloc(sizeof(struct netlbl_lsm_catmap), flags); |
273 | } | 272 | } |
274 | 273 | ||
275 | /** | 274 | /** |
276 | * netlbl_secattr_catmap_free - Free a LSM secattr catmap | 275 | * netlbl_catmap_free - Free a LSM secattr catmap |
277 | * @catmap: the category bitmap | 276 | * @catmap: the category bitmap |
278 | * | 277 | * |
279 | * Description: | 278 | * Description: |
280 | * Free a LSM secattr catmap. | 279 | * Free a LSM secattr catmap. |
281 | * | 280 | * |
282 | */ | 281 | */ |
283 | static inline void netlbl_secattr_catmap_free( | 282 | static inline void netlbl_catmap_free(struct netlbl_lsm_catmap *catmap) |
284 | struct netlbl_lsm_secattr_catmap *catmap) | ||
285 | { | 283 | { |
286 | struct netlbl_lsm_secattr_catmap *iter; | 284 | struct netlbl_lsm_catmap *iter; |
287 | 285 | ||
288 | while (catmap) { | 286 | while (catmap) { |
289 | iter = catmap; | 287 | iter = catmap; |
@@ -321,7 +319,7 @@ static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr) | |||
321 | if (secattr->flags & NETLBL_SECATTR_CACHE) | 319 | if (secattr->flags & NETLBL_SECATTR_CACHE) |
322 | netlbl_secattr_cache_free(secattr->cache); | 320 | netlbl_secattr_cache_free(secattr->cache); |
323 | if (secattr->flags & NETLBL_SECATTR_MLS_CAT) | 321 | if (secattr->flags & NETLBL_SECATTR_MLS_CAT) |
324 | netlbl_secattr_catmap_free(secattr->attr.mls.cat); | 322 | netlbl_catmap_free(secattr->attr.mls.cat); |
325 | } | 323 | } |
326 | 324 | ||
327 | /** | 325 | /** |
@@ -390,24 +388,22 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
390 | /* | 388 | /* |
391 | * LSM security attribute operations | 389 | * LSM security attribute operations |
392 | */ | 390 | */ |
393 | int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, | 391 | int netlbl_catmap_walk(struct netlbl_lsm_catmap *catmap, u32 offset); |
394 | u32 offset); | 392 | int netlbl_catmap_walkrng(struct netlbl_lsm_catmap *catmap, u32 offset); |
395 | int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, | 393 | int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap, |
396 | u32 offset); | 394 | u32 *offset, |
397 | int netlbl_secattr_catmap_getlong(struct netlbl_lsm_secattr_catmap *catmap, | 395 | unsigned long *bitmap); |
398 | u32 *offset, | 396 | int netlbl_catmap_setbit(struct netlbl_lsm_catmap **catmap, |
399 | unsigned long *bitmap); | 397 | u32 bit, |
400 | int netlbl_secattr_catmap_setbit(struct netlbl_lsm_secattr_catmap **catmap, | 398 | gfp_t flags); |
401 | u32 bit, | 399 | int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap, |
402 | gfp_t flags); | 400 | u32 start, |
403 | int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap **catmap, | 401 | u32 end, |
404 | u32 start, | 402 | gfp_t flags); |
405 | u32 end, | 403 | int netlbl_catmap_setlong(struct netlbl_lsm_catmap **catmap, |
406 | gfp_t flags); | 404 | u32 offset, |
407 | int netlbl_secattr_catmap_setlong(struct netlbl_lsm_secattr_catmap **catmap, | 405 | unsigned long bitmap, |
408 | u32 offset, | 406 | gfp_t flags); |
409 | unsigned long bitmap, | ||
410 | gfp_t flags); | ||
411 | 407 | ||
412 | /* | 408 | /* |
413 | * LSM protocol operations (NetLabel LSM/kernel API) | 409 | * LSM protocol operations (NetLabel LSM/kernel API) |
@@ -499,45 +495,39 @@ static inline int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
499 | { | 495 | { |
500 | return -ENOSYS; | 496 | return -ENOSYS; |
501 | } | 497 | } |
502 | static inline int netlbl_secattr_catmap_walk( | 498 | static inline int netlbl_catmap_walk(struct netlbl_lsm_catmap *catmap, |
503 | struct netlbl_lsm_secattr_catmap *catmap, | 499 | u32 offset) |
504 | u32 offset) | ||
505 | { | 500 | { |
506 | return -ENOENT; | 501 | return -ENOENT; |
507 | } | 502 | } |
508 | static inline int netlbl_secattr_catmap_walk_rng( | 503 | static inline int netlbl_catmap_walkrng(struct netlbl_lsm_catmap *catmap, |
509 | struct netlbl_lsm_secattr_catmap *catmap, | 504 | u32 offset) |
510 | u32 offset) | ||
511 | { | 505 | { |
512 | return -ENOENT; | 506 | return -ENOENT; |
513 | } | 507 | } |
514 | static inline int netlbl_secattr_catmap_getlong( | 508 | static inline int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap, |
515 | struct netlbl_lsm_secattr_catmap *catmap, | 509 | u32 *offset, |
516 | u32 *offset, | 510 | unsigned long *bitmap) |
517 | unsigned long *bitmap) | ||
518 | { | 511 | { |
519 | return 0; | 512 | return 0; |
520 | } | 513 | } |
521 | static inline int netlbl_secattr_catmap_setbit( | 514 | static inline int netlbl_catmap_setbit(struct netlbl_lsm_catmap **catmap, |
522 | struct netlbl_lsm_secattr_catmap **catmap, | 515 | u32 bit, |
523 | u32 bit, | 516 | gfp_t flags) |
524 | gfp_t flags) | ||
525 | { | 517 | { |
526 | return 0; | 518 | return 0; |
527 | } | 519 | } |
528 | static inline int netlbl_secattr_catmap_setrng( | 520 | static inline int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap, |
529 | struct netlbl_lsm_secattr_catmap **catmap, | 521 | u32 start, |
530 | u32 start, | 522 | u32 end, |
531 | u32 end, | 523 | gfp_t flags) |
532 | gfp_t flags) | ||
533 | { | 524 | { |
534 | return 0; | 525 | return 0; |
535 | } | 526 | } |
536 | static int netlbl_secattr_catmap_setlong( | 527 | static int netlbl_catmap_setlong(struct netlbl_lsm_catmap **catmap, |
537 | struct netlbl_lsm_secattr_catmap **catmap, | 528 | u32 offset, |
538 | u32 offset, | 529 | unsigned long bitmap, |
539 | unsigned long bitmap, | 530 | gfp_t flags) |
540 | gfp_t flags) | ||
541 | { | 531 | { |
542 | return 0; | 532 | return 0; |
543 | } | 533 | } |
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 8a0c7bd6eff4..05b708bbdb0d 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -890,8 +890,8 @@ static int cipso_v4_map_cat_rbm_hton(const struct cipso_v4_doi *doi_def, | |||
890 | } | 890 | } |
891 | 891 | ||
892 | for (;;) { | 892 | for (;;) { |
893 | host_spot = netlbl_secattr_catmap_walk(secattr->attr.mls.cat, | 893 | host_spot = netlbl_catmap_walk(secattr->attr.mls.cat, |
894 | host_spot + 1); | 894 | host_spot + 1); |
895 | if (host_spot < 0) | 895 | if (host_spot < 0) |
896 | break; | 896 | break; |
897 | 897 | ||
@@ -973,7 +973,7 @@ static int cipso_v4_map_cat_rbm_ntoh(const struct cipso_v4_doi *doi_def, | |||
973 | return -EPERM; | 973 | return -EPERM; |
974 | break; | 974 | break; |
975 | } | 975 | } |
976 | ret_val = netlbl_secattr_catmap_setbit(&secattr->attr.mls.cat, | 976 | ret_val = netlbl_catmap_setbit(&secattr->attr.mls.cat, |
977 | host_spot, | 977 | host_spot, |
978 | GFP_ATOMIC); | 978 | GFP_ATOMIC); |
979 | if (ret_val != 0) | 979 | if (ret_val != 0) |
@@ -1039,8 +1039,7 @@ static int cipso_v4_map_cat_enum_hton(const struct cipso_v4_doi *doi_def, | |||
1039 | u32 cat_iter = 0; | 1039 | u32 cat_iter = 0; |
1040 | 1040 | ||
1041 | for (;;) { | 1041 | for (;;) { |
1042 | cat = netlbl_secattr_catmap_walk(secattr->attr.mls.cat, | 1042 | cat = netlbl_catmap_walk(secattr->attr.mls.cat, cat + 1); |
1043 | cat + 1); | ||
1044 | if (cat < 0) | 1043 | if (cat < 0) |
1045 | break; | 1044 | break; |
1046 | if ((cat_iter + 2) > net_cat_len) | 1045 | if ((cat_iter + 2) > net_cat_len) |
@@ -1075,9 +1074,9 @@ static int cipso_v4_map_cat_enum_ntoh(const struct cipso_v4_doi *doi_def, | |||
1075 | u32 iter; | 1074 | u32 iter; |
1076 | 1075 | ||
1077 | for (iter = 0; iter < net_cat_len; iter += 2) { | 1076 | for (iter = 0; iter < net_cat_len; iter += 2) { |
1078 | ret_val = netlbl_secattr_catmap_setbit(&secattr->attr.mls.cat, | 1077 | ret_val = netlbl_catmap_setbit(&secattr->attr.mls.cat, |
1079 | get_unaligned_be16(&net_cat[iter]), | 1078 | get_unaligned_be16(&net_cat[iter]), |
1080 | GFP_ATOMIC); | 1079 | GFP_ATOMIC); |
1081 | if (ret_val != 0) | 1080 | if (ret_val != 0) |
1082 | return ret_val; | 1081 | return ret_val; |
1083 | } | 1082 | } |
@@ -1155,8 +1154,7 @@ static int cipso_v4_map_cat_rng_hton(const struct cipso_v4_doi *doi_def, | |||
1155 | return -ENOSPC; | 1154 | return -ENOSPC; |
1156 | 1155 | ||
1157 | for (;;) { | 1156 | for (;;) { |
1158 | iter = netlbl_secattr_catmap_walk(secattr->attr.mls.cat, | 1157 | iter = netlbl_catmap_walk(secattr->attr.mls.cat, iter + 1); |
1159 | iter + 1); | ||
1160 | if (iter < 0) | 1158 | if (iter < 0) |
1161 | break; | 1159 | break; |
1162 | cat_size += (iter == 0 ? 0 : sizeof(u16)); | 1160 | cat_size += (iter == 0 ? 0 : sizeof(u16)); |
@@ -1164,8 +1162,7 @@ static int cipso_v4_map_cat_rng_hton(const struct cipso_v4_doi *doi_def, | |||
1164 | return -ENOSPC; | 1162 | return -ENOSPC; |
1165 | array[array_cnt++] = iter; | 1163 | array[array_cnt++] = iter; |
1166 | 1164 | ||
1167 | iter = netlbl_secattr_catmap_walk_rng(secattr->attr.mls.cat, | 1165 | iter = netlbl_catmap_walkrng(secattr->attr.mls.cat, iter); |
1168 | iter); | ||
1169 | if (iter < 0) | 1166 | if (iter < 0) |
1170 | return -EFAULT; | 1167 | return -EFAULT; |
1171 | cat_size += sizeof(u16); | 1168 | cat_size += sizeof(u16); |
@@ -1217,10 +1214,10 @@ static int cipso_v4_map_cat_rng_ntoh(const struct cipso_v4_doi *doi_def, | |||
1217 | else | 1214 | else |
1218 | cat_low = 0; | 1215 | cat_low = 0; |
1219 | 1216 | ||
1220 | ret_val = netlbl_secattr_catmap_setrng(&secattr->attr.mls.cat, | 1217 | ret_val = netlbl_catmap_setrng(&secattr->attr.mls.cat, |
1221 | cat_low, | 1218 | cat_low, |
1222 | cat_high, | 1219 | cat_high, |
1223 | GFP_ATOMIC); | 1220 | GFP_ATOMIC); |
1224 | if (ret_val != 0) | 1221 | if (ret_val != 0) |
1225 | return ret_val; | 1222 | return ret_val; |
1226 | } | 1223 | } |
@@ -1340,7 +1337,7 @@ static int cipso_v4_parsetag_rbm(const struct cipso_v4_doi *doi_def, | |||
1340 | tag_len - 4, | 1337 | tag_len - 4, |
1341 | secattr); | 1338 | secattr); |
1342 | if (ret_val != 0) { | 1339 | if (ret_val != 0) { |
1343 | netlbl_secattr_catmap_free(secattr->attr.mls.cat); | 1340 | netlbl_catmap_free(secattr->attr.mls.cat); |
1344 | return ret_val; | 1341 | return ret_val; |
1345 | } | 1342 | } |
1346 | 1343 | ||
@@ -1431,7 +1428,7 @@ static int cipso_v4_parsetag_enum(const struct cipso_v4_doi *doi_def, | |||
1431 | tag_len - 4, | 1428 | tag_len - 4, |
1432 | secattr); | 1429 | secattr); |
1433 | if (ret_val != 0) { | 1430 | if (ret_val != 0) { |
1434 | netlbl_secattr_catmap_free(secattr->attr.mls.cat); | 1431 | netlbl_catmap_free(secattr->attr.mls.cat); |
1435 | return ret_val; | 1432 | return ret_val; |
1436 | } | 1433 | } |
1437 | 1434 | ||
@@ -1521,7 +1518,7 @@ static int cipso_v4_parsetag_rng(const struct cipso_v4_doi *doi_def, | |||
1521 | tag_len - 4, | 1518 | tag_len - 4, |
1522 | secattr); | 1519 | secattr); |
1523 | if (ret_val != 0) { | 1520 | if (ret_val != 0) { |
1524 | netlbl_secattr_catmap_free(secattr->attr.mls.cat); | 1521 | netlbl_catmap_free(secattr->attr.mls.cat); |
1525 | return ret_val; | 1522 | return ret_val; |
1526 | } | 1523 | } |
1527 | 1524 | ||
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index bc3883814890..05ea4a4cc0ac 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c | |||
@@ -410,7 +410,7 @@ out_entry: | |||
410 | #define _CM_F_WALK 0x00000002 | 410 | #define _CM_F_WALK 0x00000002 |
411 | 411 | ||
412 | /** | 412 | /** |
413 | * _netlbl_secattr_catmap_getnode - Get a individual node from a catmap | 413 | * _netlbl_catmap_getnode - Get a individual node from a catmap |
414 | * @catmap: pointer to the category bitmap | 414 | * @catmap: pointer to the category bitmap |
415 | * @offset: the requested offset | 415 | * @offset: the requested offset |
416 | * @cm_flags: catmap flags, see _CM_F_* | 416 | * @cm_flags: catmap flags, see _CM_F_* |
@@ -424,36 +424,36 @@ out_entry: | |||
424 | * be returned. Returns a pointer to the node on success, NULL on failure. | 424 | * be returned. Returns a pointer to the node on success, NULL on failure. |
425 | * | 425 | * |
426 | */ | 426 | */ |
427 | static struct netlbl_lsm_secattr_catmap *_netlbl_secattr_catmap_getnode( | 427 | static struct netlbl_lsm_catmap *_netlbl_catmap_getnode( |
428 | struct netlbl_lsm_secattr_catmap **catmap, | 428 | struct netlbl_lsm_catmap **catmap, |
429 | u32 offset, | 429 | u32 offset, |
430 | unsigned int cm_flags, | 430 | unsigned int cm_flags, |
431 | gfp_t gfp_flags) | 431 | gfp_t gfp_flags) |
432 | { | 432 | { |
433 | struct netlbl_lsm_secattr_catmap *iter = *catmap; | 433 | struct netlbl_lsm_catmap *iter = *catmap; |
434 | struct netlbl_lsm_secattr_catmap *prev = NULL; | 434 | struct netlbl_lsm_catmap *prev = NULL; |
435 | 435 | ||
436 | if (iter == NULL) | 436 | if (iter == NULL) |
437 | goto secattr_catmap_getnode_alloc; | 437 | goto catmap_getnode_alloc; |
438 | if (offset < iter->startbit) | 438 | if (offset < iter->startbit) |
439 | goto secattr_catmap_getnode_walk; | 439 | goto catmap_getnode_walk; |
440 | while (iter && offset >= (iter->startbit + NETLBL_CATMAP_SIZE)) { | 440 | while (iter && offset >= (iter->startbit + NETLBL_CATMAP_SIZE)) { |
441 | prev = iter; | 441 | prev = iter; |
442 | iter = iter->next; | 442 | iter = iter->next; |
443 | } | 443 | } |
444 | if (iter == NULL || offset < iter->startbit) | 444 | if (iter == NULL || offset < iter->startbit) |
445 | goto secattr_catmap_getnode_walk; | 445 | goto catmap_getnode_walk; |
446 | 446 | ||
447 | return iter; | 447 | return iter; |
448 | 448 | ||
449 | secattr_catmap_getnode_walk: | 449 | catmap_getnode_walk: |
450 | if (cm_flags & _CM_F_WALK) | 450 | if (cm_flags & _CM_F_WALK) |
451 | return iter; | 451 | return iter; |
452 | secattr_catmap_getnode_alloc: | 452 | catmap_getnode_alloc: |
453 | if (!(cm_flags & _CM_F_ALLOC)) | 453 | if (!(cm_flags & _CM_F_ALLOC)) |
454 | return NULL; | 454 | return NULL; |
455 | 455 | ||
456 | iter = netlbl_secattr_catmap_alloc(gfp_flags); | 456 | iter = netlbl_catmap_alloc(gfp_flags); |
457 | if (iter == NULL) | 457 | if (iter == NULL) |
458 | return NULL; | 458 | return NULL; |
459 | iter->startbit = offset & ~(NETLBL_CATMAP_SIZE - 1); | 459 | iter->startbit = offset & ~(NETLBL_CATMAP_SIZE - 1); |
@@ -470,7 +470,7 @@ secattr_catmap_getnode_alloc: | |||
470 | } | 470 | } |
471 | 471 | ||
472 | /** | 472 | /** |
473 | * netlbl_secattr_catmap_walk - Walk a LSM secattr catmap looking for a bit | 473 | * netlbl_catmap_walk - Walk a LSM secattr catmap looking for a bit |
474 | * @catmap: the category bitmap | 474 | * @catmap: the category bitmap |
475 | * @offset: the offset to start searching at, in bits | 475 | * @offset: the offset to start searching at, in bits |
476 | * | 476 | * |
@@ -479,15 +479,14 @@ secattr_catmap_getnode_alloc: | |||
479 | * returns the spot of the first set bit or -ENOENT if no bits are set. | 479 | * returns the spot of the first set bit or -ENOENT if no bits are set. |
480 | * | 480 | * |
481 | */ | 481 | */ |
482 | int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, | 482 | int netlbl_catmap_walk(struct netlbl_lsm_catmap *catmap, u32 offset) |
483 | u32 offset) | ||
484 | { | 483 | { |
485 | struct netlbl_lsm_secattr_catmap *iter = catmap; | 484 | struct netlbl_lsm_catmap *iter = catmap; |
486 | u32 idx; | 485 | u32 idx; |
487 | u32 bit; | 486 | u32 bit; |
488 | NETLBL_CATMAP_MAPTYPE bitmap; | 487 | NETLBL_CATMAP_MAPTYPE bitmap; |
489 | 488 | ||
490 | iter = _netlbl_secattr_catmap_getnode(&catmap, offset, _CM_F_WALK, 0); | 489 | iter = _netlbl_catmap_getnode(&catmap, offset, _CM_F_WALK, 0); |
491 | if (iter == NULL) | 490 | if (iter == NULL) |
492 | return -ENOENT; | 491 | return -ENOENT; |
493 | if (offset > iter->startbit) { | 492 | if (offset > iter->startbit) { |
@@ -524,7 +523,7 @@ int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, | |||
524 | } | 523 | } |
525 | 524 | ||
526 | /** | 525 | /** |
527 | * netlbl_secattr_catmap_walk_rng - Find the end of a string of set bits | 526 | * netlbl_catmap_walkrng - Find the end of a string of set bits |
528 | * @catmap: the category bitmap | 527 | * @catmap: the category bitmap |
529 | * @offset: the offset to start searching at, in bits | 528 | * @offset: the offset to start searching at, in bits |
530 | * | 529 | * |
@@ -534,17 +533,16 @@ int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, | |||
534 | * the end of the bitmap. | 533 | * the end of the bitmap. |
535 | * | 534 | * |
536 | */ | 535 | */ |
537 | int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, | 536 | int netlbl_catmap_walkrng(struct netlbl_lsm_catmap *catmap, u32 offset) |
538 | u32 offset) | ||
539 | { | 537 | { |
540 | struct netlbl_lsm_secattr_catmap *iter; | 538 | struct netlbl_lsm_catmap *iter; |
541 | struct netlbl_lsm_secattr_catmap *prev = NULL; | 539 | struct netlbl_lsm_catmap *prev = NULL; |
542 | u32 idx; | 540 | u32 idx; |
543 | u32 bit; | 541 | u32 bit; |
544 | NETLBL_CATMAP_MAPTYPE bitmask; | 542 | NETLBL_CATMAP_MAPTYPE bitmask; |
545 | NETLBL_CATMAP_MAPTYPE bitmap; | 543 | NETLBL_CATMAP_MAPTYPE bitmap; |
546 | 544 | ||
547 | iter = _netlbl_secattr_catmap_getnode(&catmap, offset, _CM_F_WALK, 0); | 545 | iter = _netlbl_catmap_getnode(&catmap, offset, _CM_F_WALK, 0); |
548 | if (iter == NULL) | 546 | if (iter == NULL) |
549 | return -ENOENT; | 547 | return -ENOENT; |
550 | if (offset > iter->startbit) { | 548 | if (offset > iter->startbit) { |
@@ -584,7 +582,7 @@ int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, | |||
584 | } | 582 | } |
585 | 583 | ||
586 | /** | 584 | /** |
587 | * netlbl_secattr_catmap_getlong - Export an unsigned long bitmap | 585 | * netlbl_catmap_getlong - Export an unsigned long bitmap |
588 | * @catmap: pointer to the category bitmap | 586 | * @catmap: pointer to the category bitmap |
589 | * @offset: pointer to the requested offset | 587 | * @offset: pointer to the requested offset |
590 | * @bitmap: the exported bitmap | 588 | * @bitmap: the exported bitmap |
@@ -597,11 +595,11 @@ int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, | |||
597 | * Returns zero on sucess, negative values on failure. | 595 | * Returns zero on sucess, negative values on failure. |
598 | * | 596 | * |
599 | */ | 597 | */ |
600 | int netlbl_secattr_catmap_getlong(struct netlbl_lsm_secattr_catmap *catmap, | 598 | int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap, |
601 | u32 *offset, | 599 | u32 *offset, |
602 | unsigned long *bitmap) | 600 | unsigned long *bitmap) |
603 | { | 601 | { |
604 | struct netlbl_lsm_secattr_catmap *iter; | 602 | struct netlbl_lsm_catmap *iter; |
605 | u32 off = *offset; | 603 | u32 off = *offset; |
606 | u32 idx; | 604 | u32 idx; |
607 | 605 | ||
@@ -613,7 +611,7 @@ int netlbl_secattr_catmap_getlong(struct netlbl_lsm_secattr_catmap *catmap, | |||
613 | off = catmap->startbit; | 611 | off = catmap->startbit; |
614 | *offset = off; | 612 | *offset = off; |
615 | } | 613 | } |
616 | iter = _netlbl_secattr_catmap_getnode(&catmap, off, _CM_F_NONE, 0); | 614 | iter = _netlbl_catmap_getnode(&catmap, off, _CM_F_NONE, 0); |
617 | if (iter == NULL) { | 615 | if (iter == NULL) { |
618 | *offset = (u32)-1; | 616 | *offset = (u32)-1; |
619 | return 0; | 617 | return 0; |
@@ -632,7 +630,7 @@ int netlbl_secattr_catmap_getlong(struct netlbl_lsm_secattr_catmap *catmap, | |||
632 | } | 630 | } |
633 | 631 | ||
634 | /** | 632 | /** |
635 | * netlbl_secattr_catmap_setbit - Set a bit in a LSM secattr catmap | 633 | * netlbl_catmap_setbit - Set a bit in a LSM secattr catmap |
636 | * @catmap: pointer to the category bitmap | 634 | * @catmap: pointer to the category bitmap |
637 | * @bit: the bit to set | 635 | * @bit: the bit to set |
638 | * @flags: memory allocation flags | 636 | * @flags: memory allocation flags |
@@ -642,14 +640,14 @@ int netlbl_secattr_catmap_getlong(struct netlbl_lsm_secattr_catmap *catmap, | |||
642 | * negative values on failure. | 640 | * negative values on failure. |
643 | * | 641 | * |
644 | */ | 642 | */ |
645 | int netlbl_secattr_catmap_setbit(struct netlbl_lsm_secattr_catmap **catmap, | 643 | int netlbl_catmap_setbit(struct netlbl_lsm_catmap **catmap, |
646 | u32 bit, | 644 | u32 bit, |
647 | gfp_t flags) | 645 | gfp_t flags) |
648 | { | 646 | { |
649 | struct netlbl_lsm_secattr_catmap *iter; | 647 | struct netlbl_lsm_catmap *iter; |
650 | u32 idx; | 648 | u32 idx; |
651 | 649 | ||
652 | iter = _netlbl_secattr_catmap_getnode(catmap, bit, _CM_F_ALLOC, flags); | 650 | iter = _netlbl_catmap_getnode(catmap, bit, _CM_F_ALLOC, flags); |
653 | if (iter == NULL) | 651 | if (iter == NULL) |
654 | return -ENOMEM; | 652 | return -ENOMEM; |
655 | 653 | ||
@@ -661,7 +659,7 @@ int netlbl_secattr_catmap_setbit(struct netlbl_lsm_secattr_catmap **catmap, | |||
661 | } | 659 | } |
662 | 660 | ||
663 | /** | 661 | /** |
664 | * netlbl_secattr_catmap_setrng - Set a range of bits in a LSM secattr catmap | 662 | * netlbl_catmap_setrng - Set a range of bits in a LSM secattr catmap |
665 | * @catmap: pointer to the category bitmap | 663 | * @catmap: pointer to the category bitmap |
666 | * @start: the starting bit | 664 | * @start: the starting bit |
667 | * @end: the last bit in the string | 665 | * @end: the last bit in the string |
@@ -672,10 +670,10 @@ int netlbl_secattr_catmap_setbit(struct netlbl_lsm_secattr_catmap **catmap, | |||
672 | * on success, negative values on failure. | 670 | * on success, negative values on failure. |
673 | * | 671 | * |
674 | */ | 672 | */ |
675 | int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap **catmap, | 673 | int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap, |
676 | u32 start, | 674 | u32 start, |
677 | u32 end, | 675 | u32 end, |
678 | gfp_t flags) | 676 | gfp_t flags) |
679 | { | 677 | { |
680 | int rc = 0; | 678 | int rc = 0; |
681 | u32 spot = start; | 679 | u32 spot = start; |
@@ -683,22 +681,20 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap **catmap, | |||
683 | while (rc == 0 && spot <= end) { | 681 | while (rc == 0 && spot <= end) { |
684 | if (((spot & (BITS_PER_LONG - 1)) != 0) && | 682 | if (((spot & (BITS_PER_LONG - 1)) != 0) && |
685 | ((end - spot) > BITS_PER_LONG)) { | 683 | ((end - spot) > BITS_PER_LONG)) { |
686 | rc = netlbl_secattr_catmap_setlong(catmap, | 684 | rc = netlbl_catmap_setlong(catmap, |
687 | spot, | 685 | spot, |
688 | (unsigned long)-1, | 686 | (unsigned long)-1, |
689 | flags); | 687 | flags); |
690 | spot += BITS_PER_LONG; | 688 | spot += BITS_PER_LONG; |
691 | } else | 689 | } else |
692 | rc = netlbl_secattr_catmap_setbit(catmap, | 690 | rc = netlbl_catmap_setbit(catmap, spot++, flags); |
693 | spot++, | ||
694 | flags); | ||
695 | } | 691 | } |
696 | 692 | ||
697 | return rc; | 693 | return rc; |
698 | } | 694 | } |
699 | 695 | ||
700 | /** | 696 | /** |
701 | * netlbl_secattr_catmap_setlong - Import an unsigned long bitmap | 697 | * netlbl_catmap_setlong - Import an unsigned long bitmap |
702 | * @catmap: pointer to the category bitmap | 698 | * @catmap: pointer to the category bitmap |
703 | * @offset: offset to the start of the imported bitmap | 699 | * @offset: offset to the start of the imported bitmap |
704 | * @bitmap: the bitmap to import | 700 | * @bitmap: the bitmap to import |
@@ -710,20 +706,19 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap **catmap, | |||
710 | * on success, negative values on failure. | 706 | * on success, negative values on failure. |
711 | * | 707 | * |
712 | */ | 708 | */ |
713 | int netlbl_secattr_catmap_setlong(struct netlbl_lsm_secattr_catmap **catmap, | 709 | int netlbl_catmap_setlong(struct netlbl_lsm_catmap **catmap, |
714 | u32 offset, | 710 | u32 offset, |
715 | unsigned long bitmap, | 711 | unsigned long bitmap, |
716 | gfp_t flags) | 712 | gfp_t flags) |
717 | { | 713 | { |
718 | struct netlbl_lsm_secattr_catmap *iter; | 714 | struct netlbl_lsm_catmap *iter; |
719 | u32 idx; | 715 | u32 idx; |
720 | 716 | ||
721 | /* only allow aligned offsets */ | 717 | /* only allow aligned offsets */ |
722 | if ((offset & (BITS_PER_LONG - 1)) != 0) | 718 | if ((offset & (BITS_PER_LONG - 1)) != 0) |
723 | return -EINVAL; | 719 | return -EINVAL; |
724 | 720 | ||
725 | iter = _netlbl_secattr_catmap_getnode(catmap, | 721 | iter = _netlbl_catmap_getnode(catmap, offset, _CM_F_ALLOC, flags); |
726 | offset, _CM_F_ALLOC, flags); | ||
727 | if (iter == NULL) | 722 | if (iter == NULL) |
728 | return -ENOMEM; | 723 | return -ENOMEM; |
729 | 724 | ||
diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c index 842deca9484d..afe6a269ec17 100644 --- a/security/selinux/ss/ebitmap.c +++ b/security/selinux/ss/ebitmap.c | |||
@@ -86,7 +86,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src) | |||
86 | * | 86 | * |
87 | */ | 87 | */ |
88 | int ebitmap_netlbl_export(struct ebitmap *ebmap, | 88 | int ebitmap_netlbl_export(struct ebitmap *ebmap, |
89 | struct netlbl_lsm_secattr_catmap **catmap) | 89 | struct netlbl_lsm_catmap **catmap) |
90 | { | 90 | { |
91 | struct ebitmap_node *e_iter = ebmap->node; | 91 | struct ebitmap_node *e_iter = ebmap->node; |
92 | unsigned long e_map; | 92 | unsigned long e_map; |
@@ -100,7 +100,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap, | |||
100 | } | 100 | } |
101 | 101 | ||
102 | if (*catmap != NULL) | 102 | if (*catmap != NULL) |
103 | netlbl_secattr_catmap_free(*catmap); | 103 | netlbl_catmap_free(*catmap); |
104 | *catmap = NULL; | 104 | *catmap = NULL; |
105 | 105 | ||
106 | while (e_iter) { | 106 | while (e_iter) { |
@@ -108,10 +108,10 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap, | |||
108 | for (iter = 0; iter < EBITMAP_UNIT_NUMS; iter++) { | 108 | for (iter = 0; iter < EBITMAP_UNIT_NUMS; iter++) { |
109 | e_map = e_iter->maps[iter]; | 109 | e_map = e_iter->maps[iter]; |
110 | if (e_map != 0) { | 110 | if (e_map != 0) { |
111 | rc = netlbl_secattr_catmap_setlong(catmap, | 111 | rc = netlbl_catmap_setlong(catmap, |
112 | offset, | 112 | offset, |
113 | e_map, | 113 | e_map, |
114 | GFP_ATOMIC); | 114 | GFP_ATOMIC); |
115 | if (rc != 0) | 115 | if (rc != 0) |
116 | goto netlbl_export_failure; | 116 | goto netlbl_export_failure; |
117 | } | 117 | } |
@@ -123,7 +123,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap, | |||
123 | return 0; | 123 | return 0; |
124 | 124 | ||
125 | netlbl_export_failure: | 125 | netlbl_export_failure: |
126 | netlbl_secattr_catmap_free(*catmap); | 126 | netlbl_catmap_free(*catmap); |
127 | return -ENOMEM; | 127 | return -ENOMEM; |
128 | } | 128 | } |
129 | 129 | ||
@@ -138,7 +138,7 @@ netlbl_export_failure: | |||
138 | * | 138 | * |
139 | */ | 139 | */ |
140 | int ebitmap_netlbl_import(struct ebitmap *ebmap, | 140 | int ebitmap_netlbl_import(struct ebitmap *ebmap, |
141 | struct netlbl_lsm_secattr_catmap *catmap) | 141 | struct netlbl_lsm_catmap *catmap) |
142 | { | 142 | { |
143 | int rc; | 143 | int rc; |
144 | struct ebitmap_node *e_iter = NULL; | 144 | struct ebitmap_node *e_iter = NULL; |
@@ -147,7 +147,7 @@ int ebitmap_netlbl_import(struct ebitmap *ebmap, | |||
147 | unsigned long bitmap; | 147 | unsigned long bitmap; |
148 | 148 | ||
149 | for (;;) { | 149 | for (;;) { |
150 | rc = netlbl_secattr_catmap_getlong(catmap, &offset, &bitmap); | 150 | rc = netlbl_catmap_getlong(catmap, &offset, &bitmap); |
151 | if (rc < 0) | 151 | if (rc < 0) |
152 | goto netlbl_import_failure; | 152 | goto netlbl_import_failure; |
153 | if (offset == (u32)-1) | 153 | if (offset == (u32)-1) |
diff --git a/security/selinux/ss/ebitmap.h b/security/selinux/ss/ebitmap.h index 712c8a7b8e8b..9637b8c71085 100644 --- a/security/selinux/ss/ebitmap.h +++ b/security/selinux/ss/ebitmap.h | |||
@@ -132,17 +132,17 @@ int ebitmap_write(struct ebitmap *e, void *fp); | |||
132 | 132 | ||
133 | #ifdef CONFIG_NETLABEL | 133 | #ifdef CONFIG_NETLABEL |
134 | int ebitmap_netlbl_export(struct ebitmap *ebmap, | 134 | int ebitmap_netlbl_export(struct ebitmap *ebmap, |
135 | struct netlbl_lsm_secattr_catmap **catmap); | 135 | struct netlbl_lsm_catmap **catmap); |
136 | int ebitmap_netlbl_import(struct ebitmap *ebmap, | 136 | int ebitmap_netlbl_import(struct ebitmap *ebmap, |
137 | struct netlbl_lsm_secattr_catmap *catmap); | 137 | struct netlbl_lsm_catmap *catmap); |
138 | #else | 138 | #else |
139 | static inline int ebitmap_netlbl_export(struct ebitmap *ebmap, | 139 | static inline int ebitmap_netlbl_export(struct ebitmap *ebmap, |
140 | struct netlbl_lsm_secattr_catmap **catmap) | 140 | struct netlbl_lsm_catmap **catmap) |
141 | { | 141 | { |
142 | return -ENOMEM; | 142 | return -ENOMEM; |
143 | } | 143 | } |
144 | static inline int ebitmap_netlbl_import(struct ebitmap *ebmap, | 144 | static inline int ebitmap_netlbl_import(struct ebitmap *ebmap, |
145 | struct netlbl_lsm_secattr_catmap *catmap) | 145 | struct netlbl_lsm_catmap *catmap) |
146 | { | 146 | { |
147 | return -ENOMEM; | 147 | return -ENOMEM; |
148 | } | 148 | } |
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index ea1bc5055792..732df7b91227 100644 --- a/security/smack/smack_access.c +++ b/security/smack/smack_access.c | |||
@@ -441,10 +441,10 @@ int smk_netlbl_mls(int level, char *catset, struct netlbl_lsm_secattr *sap, | |||
441 | for (m = 0x80; m != 0; m >>= 1, cat++) { | 441 | for (m = 0x80; m != 0; m >>= 1, cat++) { |
442 | if ((m & *cp) == 0) | 442 | if ((m & *cp) == 0) |
443 | continue; | 443 | continue; |
444 | rc = netlbl_secattr_catmap_setbit(&sap->attr.mls.cat, | 444 | rc = netlbl_catmap_setbit(&sap->attr.mls.cat, |
445 | cat, GFP_ATOMIC); | 445 | cat, GFP_ATOMIC); |
446 | if (rc < 0) { | 446 | if (rc < 0) { |
447 | netlbl_secattr_catmap_free(sap->attr.mls.cat); | 447 | netlbl_catmap_free(sap->attr.mls.cat); |
448 | return rc; | 448 | return rc; |
449 | } | 449 | } |
450 | } | 450 | } |
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 14f52be78c75..c32bba566df9 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -3091,9 +3091,9 @@ static struct smack_known *smack_from_secattr(struct netlbl_lsm_secattr *sap, | |||
3091 | break; | 3091 | break; |
3092 | } | 3092 | } |
3093 | for (acat = -1, kcat = -1; acat == kcat; ) { | 3093 | for (acat = -1, kcat = -1; acat == kcat; ) { |
3094 | acat = netlbl_secattr_catmap_walk( | 3094 | acat = netlbl_catmap_walk(sap->attr.mls.cat, |
3095 | sap->attr.mls.cat, acat + 1); | 3095 | acat + 1); |
3096 | kcat = netlbl_secattr_catmap_walk( | 3096 | kcat = netlbl_catmap_walk( |
3097 | skp->smk_netlabel.attr.mls.cat, | 3097 | skp->smk_netlabel.attr.mls.cat, |
3098 | kcat + 1); | 3098 | kcat + 1); |
3099 | if (acat < 0 || kcat < 0) | 3099 | if (acat < 0 || kcat < 0) |
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 3198cfe1dcc6..893b06b93f6d 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c | |||
@@ -777,7 +777,7 @@ static int cipso_seq_show(struct seq_file *s, void *v) | |||
777 | struct list_head *list = v; | 777 | struct list_head *list = v; |
778 | struct smack_known *skp = | 778 | struct smack_known *skp = |
779 | list_entry(list, struct smack_known, list); | 779 | list_entry(list, struct smack_known, list); |
780 | struct netlbl_lsm_secattr_catmap *cmp = skp->smk_netlabel.attr.mls.cat; | 780 | struct netlbl_lsm_catmap *cmp = skp->smk_netlabel.attr.mls.cat; |
781 | char sep = '/'; | 781 | char sep = '/'; |
782 | int i; | 782 | int i; |
783 | 783 | ||
@@ -794,8 +794,8 @@ static int cipso_seq_show(struct seq_file *s, void *v) | |||
794 | 794 | ||
795 | seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl); | 795 | seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl); |
796 | 796 | ||
797 | for (i = netlbl_secattr_catmap_walk(cmp, 0); i >= 0; | 797 | for (i = netlbl_catmap_walk(cmp, 0); i >= 0; |
798 | i = netlbl_secattr_catmap_walk(cmp, i + 1)) { | 798 | i = netlbl_catmap_walk(cmp, i + 1)) { |
799 | seq_printf(s, "%c%d", sep, i); | 799 | seq_printf(s, "%c%d", sep, i); |
800 | sep = ','; | 800 | sep = ','; |
801 | } | 801 | } |
@@ -916,7 +916,7 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf, | |||
916 | 916 | ||
917 | rc = smk_netlbl_mls(maplevel, mapcatset, &ncats, SMK_CIPSOLEN); | 917 | rc = smk_netlbl_mls(maplevel, mapcatset, &ncats, SMK_CIPSOLEN); |
918 | if (rc >= 0) { | 918 | if (rc >= 0) { |
919 | netlbl_secattr_catmap_free(skp->smk_netlabel.attr.mls.cat); | 919 | netlbl_catmap_free(skp->smk_netlabel.attr.mls.cat); |
920 | skp->smk_netlabel.attr.mls.cat = ncats.attr.mls.cat; | 920 | skp->smk_netlabel.attr.mls.cat = ncats.attr.mls.cat; |
921 | skp->smk_netlabel.attr.mls.lvl = ncats.attr.mls.lvl; | 921 | skp->smk_netlabel.attr.mls.lvl = ncats.attr.mls.lvl; |
922 | rc = count; | 922 | rc = count; |
@@ -966,14 +966,14 @@ static int cipso2_seq_show(struct seq_file *s, void *v) | |||
966 | struct list_head *list = v; | 966 | struct list_head *list = v; |
967 | struct smack_known *skp = | 967 | struct smack_known *skp = |
968 | list_entry(list, struct smack_known, list); | 968 | list_entry(list, struct smack_known, list); |
969 | struct netlbl_lsm_secattr_catmap *cmp = skp->smk_netlabel.attr.mls.cat; | 969 | struct netlbl_lsm_catmap *cmp = skp->smk_netlabel.attr.mls.cat; |
970 | char sep = '/'; | 970 | char sep = '/'; |
971 | int i; | 971 | int i; |
972 | 972 | ||
973 | seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl); | 973 | seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl); |
974 | 974 | ||
975 | for (i = netlbl_secattr_catmap_walk(cmp, 0); i >= 0; | 975 | for (i = netlbl_catmap_walk(cmp, 0); i >= 0; |
976 | i = netlbl_secattr_catmap_walk(cmp, i + 1)) { | 976 | i = netlbl_catmap_walk(cmp, i + 1)) { |
977 | seq_printf(s, "%c%d", sep, i); | 977 | seq_printf(s, "%c%d", sep, i); |
978 | sep = ','; | 978 | sep = ','; |
979 | } | 979 | } |