summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2016-10-25 17:11:07 +0000
committerglebius <glebius@FreeBSD.org>2016-10-25 17:11:07 +0000
commit4e7694ab4354a20dda74ed7f4285e256e6ba9558 (patch)
tree38371bc1e461f66a56e911bdca534bad6df06424
parentac3a196c01f30fc6af95f66f3c7d5b7762d7f77e (diff)
downloadFreeBSD-src-4e7694ab4354a20dda74ed7f4285e256e6ba9558.zip
FreeBSD-src-4e7694ab4354a20dda74ed7f4285e256e6ba9558.tar.gz
Revised SA-16:15. The initial patch didn't cover all possible overflows
based on passing incorrect parameters to sysarch(2). Security: SA-16:15 Approved by: so
-rw-r--r--UPDATING4
-rw-r--r--sys/amd64/amd64/sys_machdep.c5
-rw-r--r--sys/conf/newvers.sh2
3 files changed, 9 insertions, 2 deletions
diff --git a/UPDATING b/UPDATING
index 6fa760e..3f1b57d 100644
--- a/UPDATING
+++ b/UPDATING
@@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
stable/10, and then rebuild without this option. The bootstrap process from
older version of current is a bit fragile.
+20161025 p41 FreeBSD-SA-16:15.sysarch [revised]
+
+ Fix incorrect argument validation in sysarch(2). [SA-16:15]
+
20161010 p40 FreeBSD-SA-16:29.bspatch
FreeBSD-SA-16:30.portsnap
FreeBSD-SA-16:31.libarchive
diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c
index 330e8a4..0e1328c 100644
--- a/sys/amd64/amd64/sys_machdep.c
+++ b/sys/amd64/amd64/sys_machdep.c
@@ -617,6 +617,8 @@ amd64_set_ldt(td, uap, descs)
largest_ld = uap->start + uap->num;
if (largest_ld > max_ldt_segment)
largest_ld = max_ldt_segment;
+ if (largest_ld < uap->start)
+ return (EINVAL);
i = largest_ld - uap->start;
mtx_lock(&dt_lock);
bzero(&((struct user_segment_descriptor *)(pldt->ldt_base))
@@ -629,7 +631,8 @@ amd64_set_ldt(td, uap, descs)
/* verify range of descriptors to modify */
largest_ld = uap->start + uap->num;
if (uap->start >= max_ldt_segment ||
- largest_ld > max_ldt_segment)
+ largest_ld > max_ldt_segment ||
+ largest_ld < uap->start)
return (EINVAL);
}
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 634f64a..f8a5fa4 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -32,7 +32,7 @@
TYPE="FreeBSD"
REVISION="10.1"
-BRANCH="RELEASE-p40"
+BRANCH="RELEASE-p41"
if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
fi
OpenPOWER on IntegriCloud