selinux: always return a secid from the network caches if we find one
authorPaul Moore <paul@paul-moore.com>
Thu, 1 Aug 2019 21:55:06 +0000 (17:55 -0400)
committerPaul Moore <paul@paul-moore.com>
Mon, 5 Aug 2019 20:49:55 +0000 (16:49 -0400)
commit9b80c36353ed4cce324af21244a65984db21991b
tree31d6e45a4b934139eb50d51f76477ee38f5dbb28
parentf07ea1d4eda2574c6b0f99576db61c86ec27ff5b
selinux: always return a secid from the network caches if we find one

Previously if we couldn't find an entry in the cache and we failed to
allocate memory for a new cache entry we would fail the network object
label lookup; this is obviously not ideal.  This patch fixes this so
that we return the object label even if we can't cache the object at
this point in time due to memory pressure.

The GitHub issue tracker is below:
 * https://github.com/SELinuxProject/selinux-kernel/issues/3

Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/netif.c
security/selinux/netnode.c
security/selinux/netport.c