diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c index 395f62284e..bf6c3e68be 100644 --- a/checkpolicy/policy_define.c +++ b/checkpolicy/policy_define.c @@ -2147,7 +2147,7 @@ int define_te_avtab_xperms_helper(int which, avrule_t ** rule) /* index of the u32 containing the permission */ #define XPERM_IDX(x) (x >> 5) /* set bits 0 through x-1 within the u32 */ -#define XPERM_SETBITS(x) ((1 << (x & 0x1f)) - 1) +#define XPERM_SETBITS(x) ((1U << (x & 0x1f)) - 1) /* low value for this u32 */ #define XPERM_LOW(x) (x << 5) /* high value for this u32 */ diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c index 36720eda45..e417c5c28b 100644 --- a/libsepol/cil/src/cil_binary.c +++ b/libsepol/cil/src/cil_binary.c @@ -1526,7 +1526,7 @@ int cil_avrule_to_policydb(policydb_t *pdb, const struct cil_db *db, struct cil_ /* index of the u32 containing the permission */ #define XPERM_IDX(x) (x >> 5) /* set bits 0 through x-1 within the u32 */ -#define XPERM_SETBITS(x) ((1 << (x & 0x1f)) - 1) +#define XPERM_SETBITS(x) ((1U << (x & 0x1f)) - 1) /* low value for this u32 */ #define XPERM_LOW(x) (x << 5) /* high value for this u32 */