From c606b10c1cb7ad58e129ab34de3b9d81b072f3bb Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Wed, 6 Mar 2024 19:49:15 +0100 Subject: [PATCH] UBUNTU: SAUCE: apparmor4.0.0: LSM stacking v39: fix build error with CONFIG_SECURITY=n When CONFIG_SECURITY=n we are not initializing lsmblob correctly in security_cred_getlsmblob(). Fix by calling lsmblob_init() properly. Fixes: 4d652c1a90a7 ("UBUNTU: SAUCE: apparmor4.0.0 [13/87]: LSM stacking v39: LSM: Create new security_cred_getlsmblob LSM hook") Reported-by: Emil Renner Berthing Signed-off-by: Andrea Righi --- include/linux/security.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/security.h b/include/linux/security.h index fb60dc9f9498..3df8d69b3925 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1171,7 +1171,7 @@ static inline void security_cred_getsecid(const struct cred *c, u32 *secid) static inline void security_cred_getlsmblob(const struct cred *c, struct lsmblob *blob) { - *secid = 0; + lsmblob_init(blob); } static inline int security_kernel_act_as(struct cred *cred, u32 secid)