aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-26 07:54:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-26 07:54:40 +0100
commita62d2d44902cf1222b5ac41ff1f61167a010cd6b (patch)
treefd3740b483e806c03896a59a6189e5959c899579 /security/selinux
parentf4b614adbf3aceaa4dab034665c379352777de39 (diff)
parent2e6e902d185027f8e3cb8b7305238f7e35d6a436 (diff)
downloadkernel_replicant_linux-a62d2d44902cf1222b5ac41ff1f61167a010cd6b.tar.gz
kernel_replicant_linux-a62d2d44902cf1222b5ac41ff1f61167a010cd6b.tar.bz2
kernel_replicant_linux-a62d2d44902cf1222b5ac41ff1f61167a010cd6b.zip
Merge 4.20-rc4 into usb-next
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c3
-rw-r--r--security/selinux/ss/mls.c10
2 files changed, 10 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 7ce683259357..a67459eb62d5 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -5318,6 +5318,9 @@ static int selinux_sctp_bind_connect(struct sock *sk, int optname,
addr_buf = address;
while (walk_size < addrlen) {
+ if (walk_size + sizeof(sa_family_t) > addrlen)
+ return -EINVAL;
+
addr = addr_buf;
switch (addr->sa_family) {
case AF_UNSPEC:
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index 2fe459df3c85..b7efa2296969 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -245,9 +245,13 @@ int mls_context_to_sid(struct policydb *pol,
char *rangep[2];
if (!pol->mls_enabled) {
- if ((def_sid != SECSID_NULL && oldc) || (*scontext) == '\0')
- return 0;
- return -EINVAL;
+ /*
+ * With no MLS, only return -EINVAL if there is a MLS field
+ * and it did not come from an xattr.
+ */
+ if (oldc && def_sid == SECSID_NULL)
+ return -EINVAL;
+ return 0;
}
/*