llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] selinux: use correct type for context length
@ 2022-02-17 14:21 Christian Göttsche
  2022-02-17 14:21 ` [PATCH 3/5] selinux: use consistent pointer types for boolean arrays Christian Göttsche
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Christian Göttsche @ 2022-02-17 14:21 UTC (permalink / raw)
  To: selinux
  Cc: Paul Moore, Stephen Smalley, Eric Paris, Nathan Chancellor,
	Nick Desaulniers, Ondrej Mosnacek, Austin Kim, Kees Cook,
	Yang Li, Casey Schaufler, linux-kernel, llvm

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 argument 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>
---
 security/selinux/xfrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c
index 90697317895f..c576832febc6 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;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-06-07 21:35 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 14:21 [PATCH 2/5] selinux: use correct type for context length Christian Göttsche
2022-02-17 14:21 ` [PATCH 3/5] selinux: use consistent pointer types for boolean arrays Christian Göttsche
2022-02-18 16:01   ` Paul Moore
2022-03-08 15:57     ` Christian Göttsche
2022-02-17 14:21 ` [PATCH 4/5] selinux: declare data arrays const Christian Göttsche
2022-02-18 16:13   ` Paul Moore
2022-02-18 17:24     ` Nick Desaulniers
2022-02-22 23:16       ` Paul Moore
2022-02-17 14:21 ` [PATCH 5/5] selinux: drop unnecessary NULL check Christian Göttsche
2022-02-18 16:22   ` Paul Moore
2022-02-18 17:31   ` Nick Desaulniers
2022-03-08 16:09     ` Christian Göttsche
2022-05-02 13:43       ` Christian Göttsche
2022-05-04 11:15         ` Ondrej Mosnacek
2022-06-07 21:22   ` Paul Moore
2022-06-07 21:26     ` Nick Desaulniers
2022-06-07 21:35       ` Paul Moore
2022-02-17 14:21 ` [PATCH 1/5] selinux: drop return statement at end of void functions Christian Göttsche
2022-02-18 15:44   ` Paul Moore
2022-02-18 15:47 ` [PATCH 2/5] selinux: use correct type for context length Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).