SELinux: security_load_policy: Silence frame-larger-than warning
authorTim Gardner <tim.gardner@canonical.com>
Thu, 14 Nov 2013 22:04:51 +0000 (15:04 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 19 Mar 2018 18:58:23 +0000 (18:58 +0000)
commiteddcc749a80691e3232143d85b05804ae3a325ac
tree8ed871c51af9035c12a990959a884cb9c417918b
parent7103d294f2063d427c07e0db71a4efcd62cd6251
SELinux: security_load_policy: Silence frame-larger-than warning

commit b5495b4217d3fa64deac479db83dbede149af7d8 upstream.

Dynamically allocate a couple of the larger stack variables in order to
reduce the stack footprint below 1024. gcc-4.8

security/selinux/ss/services.c: In function 'security_load_policy':
security/selinux/ss/services.c:1964:1: warning: the frame size of 1104 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }

Also silence a couple of checkpatch warnings at the same time.

WARNING: sizeof policydb should be sizeof(policydb)
+ memcpy(oldpolicydb, &policydb, sizeof policydb);

WARNING: sizeof policydb should be sizeof(policydb)
+ memcpy(&policydb, newpolicydb, sizeof policydb);

Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Eric Paris <eparis@parisplace.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
security/selinux/ss/services.c