Mailinglist Archive: opensuse-kernel (78 mails)

< Previous Next >
Re: [opensuse-kernel] AppArmor not compiling for omap2plus config (ARM)
  • From: Guillaume Gardet <guillaume.gardet@xxxxxxx>
  • Date: Tue, 10 Apr 2012 14:29:51 +0200
  • Message-id: <4F8427BF.4060706@free.fr>
Hi,

thanks. I did not used the openSUSE gcc for this cross-compilation but an old
4.3.3, so it should be fine with the openSUSE GCC (4.6?) from build service.

So, no need to apply this patch for ARM I think.

Regards,

Guillaume



Le 10/04/2012 14:15, Tetsuo Handa a écrit :
Guillaume Gardet wrote:
Apparmor is not compiling with kernel 3.4-rc2 (omap2plus) from git repo:

CC security/apparmor/net.o
security/apparmor/net.c: In function 'audit_net':
security/apparmor/net.c:80: error: unknown field 'net' specified in
initializer
security/apparmor/net.c:80: warning: braces around scalar initializer
security/apparmor/net.c:80: warning: (near initialization for
'apparmor_audit_data.type')
security/apparmor/net.c:81: error: field name not in record or union
initializer
security/apparmor/net.c:81: error: (near initialization for
'apparmor_audit_data.type')
security/apparmor/net.c:82: error: field name not in record or union
initializer
security/apparmor/net.c:82: error: (near initialization for
'apparmor_audit_data.type')
security/apparmor/net.c:82: warning: excess elements in scalar initializer
security/apparmor/net.c:82: warning: (near initialization for
'apparmor_audit_data.type')


Maybe there is a better place to report that kind of bug?
Maybe gcc version dependent problem. I got same error with gcc 4.4.6 on
CentOS6.
----------------------------------------
[PATCH] AppArmor: Fix build error.

Some compilers cannot handle nested initialization.

Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
--
diff --git a/security/apparmor/net.c b/security/apparmor/net.c
index 8de679a..854d61e 100644
--- a/security/apparmor/net.c
+++ b/security/apparmor/net.c
@@ -76,20 +76,18 @@ static int audit_net(struct aa_profile *profile, int op,
u16 family, int type,
struct common_audit_data sa;

struct apparmor_audit_data aad = {
.op = op,
- .net = {
- .type = type,
- .protocol = protocol,
- },
.error = error
};

struct lsm_network_audit net = {
.family = family,
.sk = sk,
};

+ aad.net.type = type;
+ aad.net.protocol = protocol;

if (sk) {
COMMON_AUDIT_DATA_INIT(&sa, NET);
} else {

--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-kernel+owner@xxxxxxxxxxxx

< Previous Next >