]> git.karo-electronics.de Git - linux-beck.git/commitdiff
apparmor: do not expose kernel stack
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 10 Jun 2016 21:34:26 +0000 (23:34 +0200)
committerJohn Johansen <john.johansen@canonical.com>
Tue, 12 Jul 2016 15:43:10 +0000 (08:43 -0700)
Do not copy uninitalized fields th.td_hilen, th.td_data.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/match.c

index 32b72eb3d988ee551c21fe6c8b7da55170efcea0..3f900fcca8fb583b64e90ca7e52e451a600828b1 100644 (file)
@@ -63,7 +63,9 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
 
        table = kvzalloc(tsize);
        if (table) {
-               *table = th;
+               table->td_id = th.td_id;
+               table->td_flags = th.td_flags;
+               table->td_lolen = th.td_lolen;
                if (th.td_flags == YYTD_DATA8)
                        UNPACK_ARRAY(table->td_data, blob, th.td_lolen,
                                     u8, byte_to_byte);