@@ -672,14 +672,16 @@ static int (*const index_f[SYM_NUM])(void *key, void *datum, void *datap) = {
672
672
/* clang-format on */
673
673
674
674
#ifdef CONFIG_SECURITY_SELINUX_DEBUG
675
- static void hash_eval (struct hashtab * h , const char * hash_name )
675
+ static void hash_eval (struct hashtab * h , const char * hash_name ,
676
+ const char * hash_details )
676
677
{
677
678
struct hashtab_info info ;
678
679
679
680
hashtab_stat (h , & info );
680
681
pr_debug (
681
- "SELinux: %s: %d entries and %d/%d buckets used, longest chain length %d, sum of chain length^2 %llu\n" ,
682
- hash_name , h -> nel , info .slots_used , h -> size , info .max_chain_len ,
682
+ "SELinux: %s%s%s: %d entries and %d/%d buckets used, longest chain length %d, sum of chain length^2 %llu\n" ,
683
+ hash_name , hash_details ? "@" : "" , hash_details ?: "" , h -> nel ,
684
+ info .slots_used , h -> size , info .max_chain_len ,
683
685
info .chain2_len_sum );
684
686
}
685
687
@@ -688,11 +690,12 @@ static void symtab_hash_eval(struct symtab *s)
688
690
int i ;
689
691
690
692
for (i = 0 ; i < SYM_NUM ; i ++ )
691
- hash_eval (& s [i ].table , symtab_name [i ]);
693
+ hash_eval (& s [i ].table , symtab_name [i ], NULL );
692
694
}
693
695
694
696
#else
695
- static inline void hash_eval (struct hashtab * h , const char * hash_name )
697
+ static inline void hash_eval (struct hashtab * h , const char * hash_name ,
698
+ const char * hash_details )
696
699
{
697
700
}
698
701
static inline void symtab_hash_eval (struct symtab * s )
@@ -1178,6 +1181,8 @@ static int common_read(struct policydb *p, struct symtab *s, void *fp)
1178
1181
goto bad ;
1179
1182
}
1180
1183
1184
+ hash_eval (& comdatum -> permissions .table , "common_permissions" , key );
1185
+
1181
1186
rc = symtab_insert (s , key , comdatum );
1182
1187
if (rc )
1183
1188
goto bad ;
@@ -1358,6 +1363,8 @@ static int class_read(struct policydb *p, struct symtab *s, void *fp)
1358
1363
goto bad ;
1359
1364
}
1360
1365
1366
+ hash_eval (& cladatum -> permissions .table , "class_permissions" , key );
1367
+
1361
1368
rc = read_cons_helper (p , & cladatum -> constraints , ncons , 0 , fp );
1362
1369
if (rc )
1363
1370
goto bad ;
@@ -1898,7 +1905,7 @@ static int range_read(struct policydb *p, void *fp)
1898
1905
rt = NULL ;
1899
1906
r = NULL ;
1900
1907
}
1901
- hash_eval (& p -> range_tr , "rangetr" );
1908
+ hash_eval (& p -> range_tr , "rangetr" , NULL );
1902
1909
rc = 0 ;
1903
1910
out :
1904
1911
kfree (rt );
@@ -2116,7 +2123,7 @@ static int filename_trans_read(struct policydb *p, void *fp)
2116
2123
return rc ;
2117
2124
}
2118
2125
}
2119
- hash_eval (& p -> filename_trans , "filenametr" );
2126
+ hash_eval (& p -> filename_trans , "filenametr" , NULL );
2120
2127
return 0 ;
2121
2128
}
2122
2129
@@ -2649,6 +2656,8 @@ int policydb_read(struct policydb *p, void *fp)
2649
2656
rtd = NULL ;
2650
2657
}
2651
2658
2659
+ hash_eval (& p -> role_tr , "roletr" , NULL );
2660
+
2652
2661
rc = next_entry (buf , fp , sizeof (u32 ));
2653
2662
if (rc )
2654
2663
goto bad ;
0 commit comments