diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-02-01 16:18:38 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-02-01 16:18:38 -0800 |
commit | b7bd29b530b9e8c0456ef703e64e773830185724 (patch) | |
tree | 18dc768711f45a17923061863bcab3dbe64fd5e8 | |
parent | 5eeb63359b1ec4914d9898e24aa357ff930e6ee1 (diff) | |
parent | d6d478aee003e19ef90321176552a8ad2929a47f (diff) | |
download | lwn-b7bd29b530b9e8c0456ef703e64e773830185724.tar.gz lwn-b7bd29b530b9e8c0456ef703e64e773830185724.zip |
Merge tag 'apparmor-pr-2019-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor
Pull apparmor bug fixes from John Johansen:
"Two bug fixes for apparmor:
- Fix aa_label_build() error handling for failed merges
- Fix warning about unused function apparmor_ipv6_postroute"
* tag 'apparmor-pr-2019-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor:
apparmor: Fix aa_label_build() error handling for failed merges
apparmor: Fix warning about unused function apparmor_ipv6_postroute
-rw-r--r-- | security/apparmor/domain.c | 5 | ||||
-rw-r--r-- | security/apparmor/lsm.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 08c88de0ffda..11975ec8d566 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -1444,7 +1444,10 @@ check: new = aa_label_merge(label, target, GFP_KERNEL); if (IS_ERR_OR_NULL(new)) { info = "failed to build target label"; - error = PTR_ERR(new); + if (!new) + error = -ENOMEM; + else + error = PTR_ERR(new); new = NULL; perms.allow = 0; goto audit; diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 2c010874329f..8db1731d046a 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1599,12 +1599,14 @@ static unsigned int apparmor_ipv4_postroute(void *priv, return apparmor_ip_postroute(priv, skb, state); } +#if IS_ENABLED(CONFIG_IPV6) static unsigned int apparmor_ipv6_postroute(void *priv, struct sk_buff *skb, const struct nf_hook_state *state) { return apparmor_ip_postroute(priv, skb, state); } +#endif static const struct nf_hook_ops apparmor_nf_ops[] = { { |