Date: Tue, 25 Oct 2016 17:16:58 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r307941 - stable/9/sys/amd64/amd64 Message-ID: <201610251716.u9PHGwmG076599@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Tue Oct 25 17:16:58 2016 New Revision: 307941 URL: https://svnweb.freebsd.org/changeset/base/307941 Log: Merge r307936: The argument validation in r296956 was not enough to close all possible overflows in sysarch(2). Submitted by: Kun Yang <kun.yang chaitin.com> Patch by: kib Security: SA-16:15 Modified: stable/9/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/sys_machdep.c Tue Oct 25 17:16:08 2016 (r307940) +++ stable/9/sys/amd64/amd64/sys_machdep.c Tue Oct 25 17:16:58 2016 (r307941) @@ -612,6 +612,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)) @@ -624,7 +626,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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610251716.u9PHGwmG076599>