BACKPORT: Smack: network label match fix
authorCasey Schaufler <casey@schaufler-ca.com>
Fri, 28 Jun 2013 20:47:07 +0000 (13:47 -0700)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 30 Jun 2016 12:57:27 +0000 (14:57 +0200)
commitf7af5a4d3c2a20e8522d404511278d0231fd38e6
treeefda84f51292735bcc0b73c0b387ae1536c0f15b
parentceffd2cb37d70a4a3de063e14767a3fd1635d296
BACKPORT: Smack: network label match fix

The Smack code that matches incoming CIPSO tags with Smack labels
reaches through the NetLabel interfaces and compares the network
data with the CIPSO header associated with a Smack label. This was
done in a ill advised attempt to optimize performance. It works
so long as the categories fit in a single capset, but this isn't
always the case.

This patch changes the Smack code to use the appropriate NetLabel
interfaces to compare the incoming CIPSO header with the CIPSO
header associated with a label. It will always match the CIPSO
headers correctly.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
(cherry-picked from upstream 677264e8fb73ea35a508700e19ce76c527576d1c)
security/smack/smack.h
security/smack/smack_lsm.c
security/smack/smackfs.c