From: Christian Göttsche Date: Thu, 17 Feb 2022 14:21:25 +0000 (+0100) Subject: selinux: use correct type for context length X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=15bb7a467b2b859448be6af3efd58fc52e5e1255;p=linux.git selinux: use correct type for context length [ Upstream commit b97df7c098c531010e445da88d02b7bf7bf59ef6 ] security_sid_to_context() expects a pointer to an u32 as the address where to store the length of the computed context. Reported by sparse: security/selinux/xfrm.c:359:39: warning: incorrect type in arg 4 (different signedness) security/selinux/xfrm.c:359:39: expected unsigned int [usertype] *scontext_len security/selinux/xfrm.c:359:39: got int * Signed-off-by: Christian Göttsche [PM: wrapped commit description] Signed-off-by: Paul Moore Signed-off-by: Sasha Levin --- diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c index be83e5ce4469c..debe15207d2bf 100644 --- a/security/selinux/xfrm.c +++ b/security/selinux/xfrm.c @@ -347,7 +347,7 @@ int selinux_xfrm_state_alloc_acquire(struct xfrm_state *x, int rc; struct xfrm_sec_ctx *ctx; char *ctx_str = NULL; - int str_len; + u32 str_len; if (!polsec) return 0;