BACKPORT: Smack: IPv6 casting error fix for 3.11
authorCasey Schaufler <casey@schaufler-ca.com>
Mon, 5 Aug 2013 20:21:22 +0000 (13:21 -0700)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 30 Jun 2016 12:57:27 +0000 (14:57 +0200)
commit6d141d06a35d85befc154e975a35cd770f87b4d9
tree0fb1bd4cca3e134a3ab6fcbd7841149589f6dbd8
parentf7af5a4d3c2a20e8522d404511278d0231fd38e6
BACKPORT: Smack: IPv6 casting error fix for 3.11

The original implementation of the Smack IPv6 port based
local controls works most of the time using a sockaddr as
a temporary variable, but not always as it overflows in
some circumstances. The correct data is a sockaddr_in6.
A struct sockaddr isn't as large as a struct sockaddr_in6.
There would need to be casting one way or the other. This
patch gets it the right way.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
(cherry-picked from upstream 6ea062475a9a2ea6e1394487fa0e51b3459957d1)
security/smack/smack_lsm.c