Skip to content

Commit 44fbeeb

Browse files
ColinIanKingjrjohansen
authored andcommitted
apparmor: Fix incorrect profile->signal range check
The check on profile->signal is always false, the value can never be less than 1 *and* greater than MAXMAPPED_SIG. Fix this by replacing the logical operator && with ||. Fixes: 84c455d ("apparmor: add support for profiles to define the kill signal") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent e9ed1eb commit 44fbeeb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

security/apparmor/policy_unpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
919919

920920
/* optional */
921921
(void) aa_unpack_u32(e, &profile->signal, "kill");
922-
if (profile->signal < 1 && profile->signal > MAXMAPPED_SIG) {
922+
if (profile->signal < 1 || profile->signal > MAXMAPPED_SIG) {
923923
info = "profile kill.signal invalid value";
924924
goto fail;
925925
}

0 commit comments

Comments
 (0)