diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2022-01-25 15:14:14 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2022-01-26 15:13:58 -0500 |
commit | 9e2fe574c02bde46307255467a5e4291f65227fe (patch) | |
tree | 5a94795947835f92fe02bbcf9a93ee369c0ddbfc /security/selinux/include | |
parent | d3b1161f29cf479b86d4c3c6f200a8eb27254877 (diff) | |
download | linux-9e2fe574c02bde46307255467a5e4291f65227fe.tar.gz linux-9e2fe574c02bde46307255467a5e4291f65227fe.tar.bz2 linux-9e2fe574c02bde46307255467a5e4291f65227fe.zip |
selinux: enclose macro arguments in parenthesis
Enclose the macro arguments in parenthesis to avoid potential evaluation
order issues.
Note the xperm and ebitmap macros are still not side-effect safe due to
double evaluation.
Reported by clang-tidy [bugprone-macro-parentheses]
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/include')
-rw-r--r-- | security/selinux/include/security.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index 6482e0efb368..d91a5672de99 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h @@ -254,8 +254,8 @@ struct av_decision { #define XPERMS_AUDITALLOW 2 #define XPERMS_DONTAUDIT 4 -#define security_xperm_set(perms, x) (perms[x >> 5] |= 1 << (x & 0x1f)) -#define security_xperm_test(perms, x) (1 & (perms[x >> 5] >> (x & 0x1f))) +#define security_xperm_set(perms, x) ((perms)[(x) >> 5] |= 1 << ((x) & 0x1f)) +#define security_xperm_test(perms, x) (1 & ((perms)[(x) >> 5] >> ((x) & 0x1f))) struct extended_perms_data { u32 p[8]; }; |