[PATCH] selinux: fix Null pointer deference at sidtab_convert_hashtable()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Handle the case where SID (Security Identifier) being looked up was
not found in the SID-to-Domain mapping table.

Fixes: 66f8e2f03c02 ("selinux: sidtab reverse lookup hash table")
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@xxxxxxxxxx>
---
This error was found through static analysis tool and has only been
compile tested.
---
 security/selinux/ss/sidtab.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c
index c8848cbba81f..b1fbdeaa8817 100644
--- a/security/selinux/ss/sidtab.c
+++ b/security/selinux/ss/sidtab.c
@@ -367,6 +367,8 @@ static void sidtab_convert_hashtable(struct sidtab *s, u32 count)
 
 	for (i = 0; i < count; i++) {
 		entry = sidtab_do_lookup(s, i, 0);
+		if (!entry)
+			continue;
 		entry->sid = index_to_sid(i);
 		entry->hash = context_compute_hash(&entry->context);
 
-- 
2.45.2





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux