[PATCH 1/2] UBUNTU: SAUCE: AppArmor: Set error code after structure initialization.
John Johansen
john.johansen at canonical.com
Thu Oct 8 20:45:10 UTC 2009
BugLink: http://bugs.launchpad.net/bugs/427948
The net audit structure error field was being set before the audit
structure was cleared. Move the assignment to after the audit
structure is cleared.
Signed-off-by: John Johansen <john.johansen at canonical.com>
---
ubuntu/apparmor/net.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/ubuntu/apparmor/net.c b/ubuntu/apparmor/net.c
index b236d14..20f921b 100644
--- a/ubuntu/apparmor/net.c
+++ b/ubuntu/apparmor/net.c
@@ -110,9 +110,8 @@ int aa_net_perm(struct aa_profile *profile, char *operation,
family_mask = profile->net.allowed[family];
- sa.base.error = (family_mask & (1 << type)) ? 0 : -EACCES;
-
memset(&sa, 0, sizeof(sa));
+ sa.base.error = (family_mask & (1 << type)) ? 0 : -EACCES;
sa.base.operation = operation;
sa.base.gfp_mask = GFP_KERNEL;
sa.family = family;
--
1.6.3.3
More information about the kernel-team
mailing list