diff options
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r-- | security/selinux/ss/services.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index ab6dbce5fd2a..afcbc19817f7 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -530,12 +530,18 @@ static void type_attribute_bounds_av(struct context *scontext, | |||
530 | struct context lo_scontext; | 530 | struct context lo_scontext; |
531 | struct context lo_tcontext; | 531 | struct context lo_tcontext; |
532 | struct av_decision lo_avd; | 532 | struct av_decision lo_avd; |
533 | struct type_datum *source | 533 | struct type_datum *source; |
534 | = policydb.type_val_to_struct[scontext->type - 1]; | 534 | struct type_datum *target; |
535 | struct type_datum *target | ||
536 | = policydb.type_val_to_struct[tcontext->type - 1]; | ||
537 | u32 masked = 0; | 535 | u32 masked = 0; |
538 | 536 | ||
537 | source = flex_array_get_ptr(policydb.type_val_to_struct_array, | ||
538 | scontext->type - 1); | ||
539 | BUG_ON(!source); | ||
540 | |||
541 | target = flex_array_get_ptr(policydb.type_val_to_struct_array, | ||
542 | tcontext->type - 1); | ||
543 | BUG_ON(!target); | ||
544 | |||
539 | if (source->bounds) { | 545 | if (source->bounds) { |
540 | memset(&lo_avd, 0, sizeof(lo_avd)); | 546 | memset(&lo_avd, 0, sizeof(lo_avd)); |
541 | 547 | ||
@@ -828,7 +834,8 @@ int security_bounded_transition(u32 old_sid, u32 new_sid) | |||
828 | 834 | ||
829 | index = new_context->type; | 835 | index = new_context->type; |
830 | while (true) { | 836 | while (true) { |
831 | type = policydb.type_val_to_struct[index - 1]; | 837 | type = flex_array_get_ptr(policydb.type_val_to_struct_array, |
838 | index - 1); | ||
832 | BUG_ON(!type); | 839 | BUG_ON(!type); |
833 | 840 | ||
834 | /* not bounded anymore */ | 841 | /* not bounded anymore */ |