]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selinux: use correct type for context length
authorChristian Göttsche <cgzones@googlemail.com>
Thu, 17 Feb 2022 14:21:25 +0000 (15:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:33 +0000 (14:06 +0200)
commit63ff236354f45182ce69783f6cda738f16b016fc
tree7a10f66878fb41cc4f5c903bc7dcf98c83898846
parent87fdfe8589d43e471dffb4c60f75eeb6f37afc4c
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 <cgzones@googlemail.com>
[PM: wrapped commit description]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/selinux/xfrm.c