summaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-11-15 12:26:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-11-15 12:26:09 -0500
commitda5322e65940e4e8426613a8ff3d99a08b350a52 (patch)
tree5e0b8036ee4a8646bd868cfc256908f87bc2f281 /security/selinux/hooks.c
parent282fd2a2adb487e97ef9cd757848b2112d7b8d0c (diff)
parent877181a8d9dc663f7a73f77f50af714d7888ec3b (diff)
Merge tag 'selinux-pr-20181115' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull SELinux fixes from Paul Moore: "Two small SELinux fixes for v4.20. Ondrej's patch adds a check on user input, and my patch ensures we don't look past the end of a buffer. Both patches are quite small and pass the selinux-testsuite" * tag 'selinux-pr-20181115' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: fix non-MLS handling in mls_context_to_sid() selinux: check length properly in SCTP bind hook
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c3
1 files changed, 3 insertions, 0 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,
5318 addr_buf = address; 5318 addr_buf = address;
5319 5319
5320 while (walk_size < addrlen) { 5320 while (walk_size < addrlen) {
5321 if (walk_size + sizeof(sa_family_t) > addrlen)
5322 return -EINVAL;
5323
5321 addr = addr_buf; 5324 addr = addr_buf;
5322 switch (addr->sa_family) { 5325 switch (addr->sa_family) {
5323 case AF_UNSPEC: 5326 case AF_UNSPEC: