Skip to content

Commit b7bd29b

Browse files
committed
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
2 parents 5eeb633 + d6d478a commit b7bd29b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

security/apparmor/domain.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,10 @@ int aa_change_profile(const char *fqname, int flags)
14441444
new = aa_label_merge(label, target, GFP_KERNEL);
14451445
if (IS_ERR_OR_NULL(new)) {
14461446
info = "failed to build target label";
1447-
error = PTR_ERR(new);
1447+
if (!new)
1448+
error = -ENOMEM;
1449+
else
1450+
error = PTR_ERR(new);
14481451
new = NULL;
14491452
perms.allow = 0;
14501453
goto audit;

security/apparmor/lsm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,12 +1599,14 @@ static unsigned int apparmor_ipv4_postroute(void *priv,
15991599
return apparmor_ip_postroute(priv, skb, state);
16001600
}
16011601

1602+
#if IS_ENABLED(CONFIG_IPV6)
16021603
static unsigned int apparmor_ipv6_postroute(void *priv,
16031604
struct sk_buff *skb,
16041605
const struct nf_hook_state *state)
16051606
{
16061607
return apparmor_ip_postroute(priv, skb, state);
16071608
}
1609+
#endif
16081610

16091611
static const struct nf_hook_ops apparmor_nf_ops[] = {
16101612
{

0 commit comments

Comments
 (0)