size = vfs_getxattr_alloc(&init_user_ns, d, profile->xattrs[i],
&value, value_size, GFP_KERNEL);
if (size >= 0) {
- u32 perm;
+ u32 index, perm;
/*
* Check the xattr presence before value. This ensure
/* Check xattr value */
state = aa_dfa_match_len(profile->xmatch.dfa, state,
value, size);
- perm = profile->xmatch.perms[state].allow;
+ index = ACCEPT_TABLE(profile->xmatch.dfa)[state];
+ perm = profile->xmatch.perms[index].allow;
if (!(perm & MAY_EXEC)) {
ret = -EINVAL;
goto out;
*/
if (profile->xmatch.dfa) {
unsigned int state, count;
- u32 perm;
+ u32 index, perm;
state = aa_dfa_leftmatch(profile->xmatch.dfa,
profile->xmatch.start[AA_CLASS_XMATCH],
name, &count);
- perm = profile->xmatch.perms[state].allow;
+ index = ACCEPT_TABLE(profile->xmatch.dfa)[state];
+ perm = profile->xmatch.perms[index].allow;
/* any accepting state means a valid match. */
if (perm & MAY_EXEC) {
int ret = 0;