aboutsummaryrefslogtreecommitdiff
path: root/security/apparmor/match.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2016-06-02 02:37:02 -0700
committerMister Oyster <oysterized@gmail.com>2017-07-04 11:51:26 +0200
commit03cea3de8a79ffab1e631d5e877bfa5f97042a31 (patch)
treee7a04c57d617a3b5e0c8a447ae1dd72cc2674de6 /security/apparmor/match.c
parent84af56192f87a0cf3c69869f4fce4704a9677f32 (diff)
apparmor: add missing id bounds check on dfa verification
commit 15756178c6a65b261a080e21af4766f59cafc112 upstream. Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'security/apparmor/match.c')
-rw-r--r--security/apparmor/match.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 90971a8c3..630f325b8 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -45,6 +45,8 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
* it every time we use td_id as an index
*/
th.td_id = be16_to_cpu(*(u16 *) (blob)) - 1;
+ if (th.td_id > YYTD_ID_MAX)
+ goto out;
th.td_flags = be16_to_cpu(*(u16 *) (blob + 2));
th.td_lolen = be32_to_cpu(*(u32 *) (blob + 8));
blob += sizeof(struct table_header);