]> 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)
commitd5082c6242b83b1d27d2ac3188ca8f292b149f64
tree9ce322841e592dae220139d91d5e48e555987a70
parentd7f43a3f95cb4723dee8ff43c8caef0581371297
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: 256ed659a7f6 ("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