SELinux: silence build warning when !CONFIG_BUG
PATCH 1/2 SELinux: silence build warning when !CONFIG_BUG
If one builds a kernel without CONFIG_BUG there are a number of 'may be used uninitialized' warnings. Silence these by returning after the BUG().
---
security/selinux/hooks.c | 2 ++ security/selinux/netnode.c | 1 + 2 files changed, 3 insertions(+), 0 deletions(-)
security/selinux/hooks.c +2 -0
@@ -992,6 +992,7 @@ static void selinux_write_opts(struct seq_file *m,continue ;default :BUG (); +return ; };/* we need a comma before each option */ seq_putc (m,',' );
@@ -1445,6 +1446,7 @@ static int task_has_capability(struct task_struct *tsk,printk (KERN_ERR "SELinux: out of range capability %d\n" , cap);BUG (); +return -EINVAL ; } rc =avc_has_perm_noaudit (sid, sid, sclass, av,0 , &avd);
security/selinux/netnode.c +1 -0
@@ -141,6 +141,7 @@ static struct sel_netnode *sel_netnode_find(const void *addr, u16 family)break ;default :BUG (); +return NULL ; }list_for_each_entry_rcu (node, &sel_netnode_hash[idx].list, list)
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
PATCH 2/2 SELinux: security_read_policy should take a size_t not ssize_t
The len should be an size_t but is a ssize_t. Easy enough fix to silence build warnings. We have no need for signed-ness.
---
security/selinux/include/security.h | 2 +- security/selinux/ss/services.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
security/selinux/include/security.h +1 -1
@@ -86,7 +86,7 @@ extern int selinux_policycap_openperm;int security_mls_enabled (void );int security_load_policy (void *data,size_t len); -int security_read_policy (void **data,ssize_t *len); +int security_read_policy (void **data,size_t *len);size_t security_policydb_len (void );int security_policycap_supported (unsigned int req_cap);
security/selinux/ss/services.c +1 -1
@@ -3189,7 +3189,7 @@ out:* @len: length of data in bytes * */ -int security_read_policy (void **data,ssize_t *len) +int security_read_policy (void **data,size_t *len) {int rc;struct policy_file fp;
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Re: [PATCH 2/2] SELinux: security_read_policy should take a size_t not ssize_t
Quoted 4 lines · Eric Paris
The len should be an
size_tbut is assize_t. Easy enough fix to silence build warnings. We have no need for signed-ness.Signed-off-by Eric Paris <[email protected]>
Signature · 7 lines
James Morris <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Eric Paris
If one builds a kernel without
CONFIG_BUGthere are a number of 'may be used uninitialized' warnings. Silence these by returning after theBUG().Signed-off-by Eric Paris <[email protected]>
Signature · 7 lines
James Morris <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.