···322322 ((x & 0x60) << 19); /* SETOPT/GETOPT */323323}324324325325+static u32 map_xbits(u32 x)326326+{327327+ return ((x & 0x1) << 7) |328328+ ((x & 0x7e) << 9);329329+}330330+325331void aa_compute_perms(struct aa_dfa *dfa, unsigned int state,326332 struct aa_perms *perms)327333{334334+ /* This mapping is convulated due to history.335335+ * v1-v4: only file perms336336+ * v5: added policydb which dropped in perm user conditional to337337+ * gain new perm bits, but had to map around the xbits because338338+ * the userspace compiler was still munging them.339339+ * v9: adds using the xbits in policydb because the compiler now340340+ * supports treating policydb permission bits different.341341+ * Unfortunately there is not way to force auditing on the342342+ * perms represented by the xbits343343+ */328344 *perms = (struct aa_perms) {329329- .allow = dfa_user_allow(dfa, state),345345+ .allow = dfa_user_allow(dfa, state) |346346+ map_xbits(dfa_user_xbits(dfa, state)),330347 .audit = dfa_user_audit(dfa, state),331331- .quiet = dfa_user_quiet(dfa, state),348348+ .quiet = dfa_user_quiet(dfa, state) |349349+ map_xbits(dfa_other_xbits(dfa, state)),332350 };333351334334- /* for v5 perm mapping in the policydb, the other set is used352352+ /* for v5-v9 perm mapping in the policydb, the other set is used335353 * to extend the general perm set336354 */337355 perms->allow |= map_other(dfa_other_allow(dfa, state));338356 perms->audit |= map_other(dfa_other_audit(dfa, state));339357 perms->quiet |= map_other(dfa_other_quiet(dfa, state));340340-// perms->xindex = dfa_user_xindex(dfa, state);341358}342359343360/**