SELinux: header generation may hit infinite loop
PATCH 1/1 SELinux: header generation may hit infinite loop
If a permission name is long enough the selinux class definition generation tool will go into a infinite loop. This is because it's macro max() is fooled into thinking it is dealing with unsigned numbers. This patch makes sure the macro always uses signed number so 1 > -1.
---
scripts/selinux/genheaders/genheaders.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/selinux/genheaders/genheaders.c +1 -1
@@ -13,7 +13,7 @@ struct security_class_mapping {#include "classmap.h" #include "initial_sid_to_string.h" -#define max (x, y) ((x > y) ? x : y) +#define max (x, y) (((int)(x) > (int)(y)) ? x : y)const char *progname;
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 6 lines · Eric Paris
If a permission name is long enough the selinux class definition generation tool will go into a infinite loop. This is because it's macro
max()is fooled into thinking it is dealing with unsigned numbers. This patch makes sure the macro always uses signed number so 1 > -1.Signed-off-by Eric Paris <[email protected]>
Applied togit://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next
Quoted 19 lines
---
scripts/selinux/genheaders/genheaders.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)scripts/selinux/genheaders/genheaders.c +1
-1@@ -13,7 +13,7 @@ struct security_class_mapping {#include "classmap.h" #include "initial_sid_to_string.h" -#define max (x, y) ((x > y) ? x : y) +#define max (x, y) (((int)(x) > (int)(y)) ? x : y)const char *progname;
Signature · 7 lines
James Morris <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.