summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-13 14:10:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-13 14:10:42 -0400
commitfa3d493f7a573b4e4e2538486e912093a0161c1b (patch)
tree18c0b7273bfdf269a5f926bd3f851b5d1a0b8606 /security
parent8636b1dbce854363cd98922b3e4b49a603c4d5fd (diff)
parent3815a245b50124f0865415dcb606a034e97494d4 (diff)
Merge tag 'selinux-pr-20190312' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux fixes from Paul Moore: "Two small fixes for SELinux in v5.1: one adds a buffer length check to the SELinux SCTP code, the other ensures that the SELinux labeling for a NFS mount is not disabled if the filesystem is mounted twice" * tag 'selinux-pr-20190312' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: security/selinux: fix SECURITY_LSM_NATIVE_LABELS on reused superblock selinux: add the missing walk_size + len check in selinux_sctp_bind_connect
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index c5363f0c67ef..1d0b37af2444 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -939,8 +939,11 @@ static int selinux_sb_clone_mnt_opts(const struct super_block *oldsb,
939 BUG_ON(!(oldsbsec->flags & SE_SBINITIALIZED)); 939 BUG_ON(!(oldsbsec->flags & SE_SBINITIALIZED));
940 940
941 /* if fs is reusing a sb, make sure that the contexts match */ 941 /* if fs is reusing a sb, make sure that the contexts match */
942 if (newsbsec->flags & SE_SBINITIALIZED) 942 if (newsbsec->flags & SE_SBINITIALIZED) {
943 if ((kern_flags & SECURITY_LSM_NATIVE_LABELS) && !set_context)
944 *set_kern_flags |= SECURITY_LSM_NATIVE_LABELS;
943 return selinux_cmp_sb_context(oldsb, newsb); 945 return selinux_cmp_sb_context(oldsb, newsb);
946 }
944 947
945 mutex_lock(&newsbsec->lock); 948 mutex_lock(&newsbsec->lock);
946 949
@@ -5134,6 +5137,9 @@ static int selinux_sctp_bind_connect(struct sock *sk, int optname,
5134 return -EINVAL; 5137 return -EINVAL;
5135 } 5138 }
5136 5139
5140 if (walk_size + len > addrlen)
5141 return -EINVAL;
5142
5137 err = -EINVAL; 5143 err = -EINVAL;
5138 switch (optname) { 5144 switch (optname) {
5139 /* Bind checks */ 5145 /* Bind checks */