13 #include <linux/types.h>
14 #include <linux/slab.h>
16 #include <linux/sched.h>
55 static u32 smack_next_secid = 10;
94 list_for_each_entry_rcu(srp, rule_list,
list) {
130 if (subject_label == smack_known_star.
smk_known) {
139 if (object_label == smack_known_web.
smk_known ||
140 subject_label == smack_known_web.
smk_known)
145 if (object_label == smack_known_star.
smk_known)
151 if (subject_label == object_label)
158 if (object_label == smack_known_floor.
smk_known)
160 if (subject_label == smack_known_hat.
smk_known)
175 if (may > 0 && (request & may) == request)
182 smack_log(subject_label, object_label, request, rc, a);
201 char *
sp = smk_of_task(tsp);
217 if ((mode & may) == mode)
244 static inline void smack_str_from_perm(
char *
string,
int access)
264 static void smack_log_callback(
struct audit_buffer *ab,
void *
a)
269 ad->smack_audit_data->function,
270 sad->
result ?
"denied" :
"granted");
302 sad = a->smack_audit_data;
308 smack_str_from_perm(request_buffer, request);
310 sad->
object = object_label;
317 void smack_log(
char *subject_label,
char *object_label,
int request,
364 if (
string[0] ==
'-')
367 for (i = 0; i < len; i++)
368 if (
string[i] >
'~' ||
string[i] <=
' ' ||
string[i] ==
'/' ||
369 string[i] ==
'"' ||
string[i] ==
'\\' ||
string[i] ==
'\'')
403 sap->
attr.mls.cat->startbit = 0;
405 for (cat = 1, cp = catset, byte = 0; byte < len; cp++, byte++)
406 for (m = 0x80; m != 0; m >>= 1, cat++) {
412 netlbl_secattr_catmap_free(sap->
attr.mls.cat);
502 if (
string[0] ==
'-')