Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selinux: conditional expression type validation was off-by-one

expr_isvalid() in conditional.c was off-by-one and allowed
invalid expression type COND_LAST. However, it is this header file
that needs to be fixed. That way the if-statement's disjunction's
second component reads more naturally, "if expr type is greater than
the last allowed value" ( rather than using ">=" in conditional.c):

if (expr->expr_type <= 0 || expr->expr_type > COND_LAST)

Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi>
Signed-off-by: James Morris <jmorris@namei.org>

authored by

Vesa-Matti Kari and committed by
James Morris
421fae06 15446235

+1 -1
+1 -1
security/selinux/ss/conditional.h
··· 28 28 #define COND_XOR 5 /* bool ^ bool */ 29 29 #define COND_EQ 6 /* bool == bool */ 30 30 #define COND_NEQ 7 /* bool != bool */ 31 - #define COND_LAST 8 31 + #define COND_LAST COND_NEQ 32 32 __u32 expr_type; 33 33 __u32 bool; 34 34 struct cond_expr *next;