Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets
authorPiotr Sawicki <p.sawicki2@partner.samsung.com>
Thu, 19 Jul 2018 09:42:58 +0000 (11:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:03 +0000 (08:38 +0200)
commitbff663136d76ca017acc3fec1e2c108751429ffd
treec9e115220431b91c7a5ac850cedbd201877b0a6f
parent2b7844ed3c7a6939090260eec43309035ed44a57
Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets

[ Upstream commit 129a99890936766f4b69b9da7ed88366313a9210 ]

A socket which has sk_family set to PF_INET6 is able to receive not
only IPv6 but also IPv4 traffic (IPv4-mapped IPv6 addresses).

Prior to this patch, the smk_skb_to_addr_ipv6() could have been
called for socket buffers containing IPv4 packets, in result such
traffic was allowed.

Signed-off-by: Piotr Sawicki <p.sawicki2@partner.samsung.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/smack/smack_lsm.c