]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: add #ifdef checks for secmark filtering
authorArnd Bergmann <arnd@arndb.de>
Fri, 5 Oct 2018 16:11:47 +0000 (18:11 +0200)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 13 Oct 2018 00:09:56 +0000 (17:09 -0700)
commit4da40738d4e9fcd97ccc6e8f5fe9e609412d247e
treeb05e03c84febe4c0f0967b6260abb7c06677cc23
parentdcf58c9eb8130b0b10eeb13b828c15f2818669e4
apparmor: add #ifdef checks for secmark filtering

The newly added code fails to build when either SECMARK or
NETFILTER are disabled:

security/apparmor/lsm.c: In function 'apparmor_socket_sock_rcv_skb':
security/apparmor/lsm.c:1138:12: error: 'struct sk_buff' has no member named 'secmark'; did you mean 'mark'?

security/apparmor/lsm.c:1671:21: error: 'struct nf_hook_state' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

Add a set of #ifdef checks around it to only enable the code that
we can compile and that makes sense in that configuration.

Fixes: 8c0000cd6869 ("apparmor: Allow filtering based on secmark policy")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c
security/apparmor/net.c