apparmor: ensure that dfa state tables have entries
authorJohn Johansen <john.johansen@canonical.com>
Tue, 31 Mar 2020 06:37:54 +0000 (23:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:12 +0000 (09:34 +0200)
commite1753e3d3bd1c738a660d5a37f30dc86c4fc5e99
treeb1b82857bd86b276bbbf9f4e782a4c8dcbfaa2d1
parent0e54b8db0ceb27cd22c175b21f8b190a488a516d
apparmor: ensure that dfa state tables have entries

commit c27c6bd2c4d6b6bb779f9b722d5607993e1d5e5c upstream.

Currently it is possible to specify a state machine table with 0 length,
this is not valid as optional tables are specified by not defining
the table as present. Further this allows by-passing the base tables
range check against the next/check tables.

Fixes: d901d6a298dc ("apparmor: dfa split verification of table headers")
Reported-by: Mike Salvatore <mike.salvatore@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/apparmor/match.c