selinux: convert type_val_to_struct to flex_array
authorEric Paris <eparis@redhat.com>
Mon, 29 Nov 2010 20:47:09 +0000 (15:47 -0500)
committerEric Paris <eparis@redhat.com>
Tue, 30 Nov 2010 22:28:57 +0000 (17:28 -0500)
commit23bdecb000c806cf4ec52764499a600f7200d7a9
treef13a523f6bec22c5e7ec58ea02a4988aefe7c8ac
parentc41ab6a1b9028de33e74101cb0aae13098a56fdb
selinux: convert type_val_to_struct to flex_array

In rawhide type_val_to_struct will allocate 26848 bytes, an order 3
allocations.  While this hasn't been seen to fail it isn't outside the
realm of possibiliy on systems with severe memory fragmentation.  Convert
to flex_array so no allocation will ever be bigger than PAGE_SIZE.

Signed-off-by: Eric Paris <eparis@redhat.com>
security/selinux/ss/policydb.c
security/selinux/ss/policydb.h
security/selinux/ss/services.c