All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] selinux: fix a couple of sparse warnings
@ 2010-02-07 23:14 James Morris
  2010-02-09  7:09 ` KaiGai Kohei
  0 siblings, 1 reply; 3+ messages in thread
From: James Morris @ 2010-02-07 23:14 UTC (permalink / raw)
  To: selinux; +Cc: linux-security-module, Stephen Smalley, KaiGai Kohei

Please review.

These warnings were introduced in commit 
44c2d9bdd7022ca7d240d5adc009296fc1c6ce08

----


    selinux: fix a couple of sparse warnings
    
    Fix a couple of sparse warnings for callers of
    context_struct_to_string, which takes a *u32, not an *int.
    
    These cases are harmless as the values are not used.
    
    Signed-off-by: James Morris <jmorris@namei.org>

diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 4e976f5..0e5c3a4 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -455,7 +455,8 @@ static void security_dump_masked_av(struct context *scontext,
 	char *scontext_name = NULL;
 	char *tcontext_name = NULL;
 	char *permission_names[32];
-	int index, length;
+	int index;
+	u32 length;
 	bool need_comma = false;
 
 	if (!permissions)
@@ -807,7 +808,7 @@ int security_bounded_transition(u32 old_sid, u32 new_sid)
 	if (rc) {
 		char *old_name = NULL;
 		char *new_name = NULL;
-		int length;
+		u32 length;
 
 		if (!context_struct_to_string(old_context,
 					      &old_name, &length) &&



-- 
James Morris
<jmorris@namei.org>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [PATCH][RFC] selinux: fix a couple of sparse warnings
  2010-02-07 23:14 [PATCH][RFC] selinux: fix a couple of sparse warnings James Morris
@ 2010-02-09  7:09 ` KaiGai Kohei
  2010-02-16  1:46   ` KaiGai Kohei
  0 siblings, 1 reply; 3+ messages in thread
From: KaiGai Kohei @ 2010-02-09  7:09 UTC (permalink / raw)
  To: James Morris
  Cc: selinux, linux-security-module, Stephen Smalley, KaiGai Kohei

(2010/02/08 8:14), James Morris wrote:
> Please review.
> 
> These warnings were introduced in commit
> 44c2d9bdd7022ca7d240d5adc009296fc1c6ce08

Please wait for a few days more.

It might be the right answer to revert this commit, not fixing
compiler warning.

http://marc.info/?l=selinux&m=126569829629708&w=2

> ----
> 
> 
>      selinux: fix a couple of sparse warnings
> 
>      Fix a couple of sparse warnings for callers of
>      context_struct_to_string, which takes a *u32, not an *int.
> 
>      These cases are harmless as the values are not used.
> 
>      Signed-off-by: James Morris<jmorris@namei.org>
> 
> diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
> index 4e976f5..0e5c3a4 100644
> --- a/security/selinux/ss/services.c
> +++ b/security/selinux/ss/services.c
> @@ -455,7 +455,8 @@ static void security_dump_masked_av(struct context *scontext,
>   	char *scontext_name = NULL;
>   	char *tcontext_name = NULL;
>   	char *permission_names[32];
> -	int index, length;
> +	int index;
> +	u32 length;
>   	bool need_comma = false;
> 
>   	if (!permissions)
> @@ -807,7 +808,7 @@ int security_bounded_transition(u32 old_sid, u32 new_sid)
>   	if (rc) {
>   		char *old_name = NULL;
>   		char *new_name = NULL;
> -		int length;
> +		u32 length;
> 
>   		if (!context_struct_to_string(old_context,
>   					&old_name,&length)&&
> 
> 
> 


-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [PATCH][RFC] selinux: fix a couple of sparse warnings
  2010-02-09  7:09 ` KaiGai Kohei
@ 2010-02-16  1:46   ` KaiGai Kohei
  0 siblings, 0 replies; 3+ messages in thread
From: KaiGai Kohei @ 2010-02-16  1:46 UTC (permalink / raw)
  To: James Morris
  Cc: selinux, linux-security-module, Stephen Smalley, KaiGai Kohei

(2010/02/09 16:09), KaiGai Kohei wrote:
> (2010/02/08 8:14), James Morris wrote:
>> Please review.
>>
>> These warnings were introduced in commit
>> 44c2d9bdd7022ca7d240d5adc009296fc1c6ce08
> 
> Please wait for a few days more.
> 
> It might be the right answer to revert this commit, not fixing
> compiler warning.
> 
> http://marc.info/?l=selinux&m=126569829629708&w=2

Sorry, I might be confused.
I misunderstood what we were talking about this commit:
  7d52a155e38d5a165759dbbee656455861bf7801

This cleanup is not related to the topic I pointed out above.
And, it seems to me fair enough.

Acked-by: KaiGai Kohei <kaigai@ak.jp.nec.com>


>> ----
>>
>>
>>       selinux: fix a couple of sparse warnings
>>
>>       Fix a couple of sparse warnings for callers of
>>       context_struct_to_string, which takes a *u32, not an *int.
>>
>>       These cases are harmless as the values are not used.
>>
>>       Signed-off-by: James Morris<jmorris@namei.org>
>>
>> diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
>> index 4e976f5..0e5c3a4 100644
>> --- a/security/selinux/ss/services.c
>> +++ b/security/selinux/ss/services.c
>> @@ -455,7 +455,8 @@ static void security_dump_masked_av(struct context *scontext,
>>    	char *scontext_name = NULL;
>>    	char *tcontext_name = NULL;
>>    	char *permission_names[32];
>> -	int index, length;
>> +	int index;
>> +	u32 length;
>>    	bool need_comma = false;
>>
>>    	if (!permissions)
>> @@ -807,7 +808,7 @@ int security_bounded_transition(u32 old_sid, u32 new_sid)
>>    	if (rc) {
>>    		char *old_name = NULL;
>>    		char *new_name = NULL;
>> -		int length;
>> +		u32 length;
>>
>>    		if (!context_struct_to_string(old_context,
>>    					&old_name,&length)&&
>>

-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2010-02-16  1:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-07 23:14 [PATCH][RFC] selinux: fix a couple of sparse warnings James Morris
2010-02-09  7:09 ` KaiGai Kohei
2010-02-16  1:46   ` KaiGai Kohei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.