lkml.org 
[lkml]   [2014]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectselinux: fix uninitalised stack variable read in sel_netport_init
After the removal of the avc_add_callback() in commit 615e51fdda6
("selinux: reduce the number of calls to synchronize_net() when flushing caches"),
ret is never set to anything, but we return uninitialized stack data on success.

Given the absense of other failure paths, just explicitly return 0.

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/security/selinux/netport.c b/security/selinux/netport.c
index 73ac6784d091..3311cc393cb4 100644
--- a/security/selinux/netport.c
+++ b/security/selinux/netport.c
@@ -237,7 +237,6 @@ void sel_netport_flush(void)
static __init int sel_netport_init(void)
{
int iter;
- int ret;

if (!selinux_enabled)
return 0;
@@ -247,7 +246,7 @@ static __init int sel_netport_init(void)
sel_netport_hash[iter].size = 0;
}

- return ret;
+ return 0;
}

__initcall(sel_netport_init);

\
 
 \ /
  Last update: 2014-08-07 19:01    [W:0.056 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site