]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: fix off-by-one comparison on MAXMAPPED_SIG
authorJohn Johansen <john.johansen@canonical.com>
Wed, 8 Nov 2017 16:09:52 +0000 (08:09 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 Nov 2017 18:56:22 +0000 (10:56 -0800)
commit2bb8060ac8194a091007ce55048bec3c0cae2540
tree9ce322841e592dae220139d91d5e48e555987a70
parentd7a9768a8726f38ce9648aa77dcb30b6e428e7ea
apparmor: fix off-by-one comparison on MAXMAPPED_SIG

This came in yesterday, and I have verified our regression tests
were missing this and it can cause an oops. Please apply.

There is a an off-by-one comparision on sig against MAXMAPPED_SIG
that can lead to a read outside the sig_map array if sig
is MAXMAPPED_SIG. Fix this.

Verified that the check is an out of bounds case that can cause an oops.

Revised: add comparison fix to second case
Fixes: 5539670c80d9 ("apparmor: add the ability to mediate signals")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
security/apparmor/ipc.c