summaryrefslogtreecommitdiffstats
path: root/sys/amd64/linux32
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-10-22 21:23:58 +0000
committerjhb <jhb@FreeBSD.org>2015-10-22 21:23:58 +0000
commit2705fe5cc132ba44ee6bdb210ae3bff5be670722 (patch)
tree3b1af4dad4bb676910953bafe6ab6df89b86ec4b /sys/amd64/linux32
parentfebc1927cddec93d927a855936dfeba97f21707a (diff)
downloadFreeBSD-src-2705fe5cc132ba44ee6bdb210ae3bff5be670722.zip
FreeBSD-src-2705fe5cc132ba44ee6bdb210ae3bff5be670722.tar.gz
Merge r289055 to amd64/linux32:
linux: fix handling of out-of-bounds syscall attempts Due to an off by one the code would read an entry past the table, as opposed to the last entry which contains the nosys handler.
Diffstat (limited to 'sys/amd64/linux32')
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 4364438..250e16b 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -741,7 +741,7 @@ linux32_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
if (sa->code >= p->p_sysent->sv_size)
/* nosys */
- sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
+ sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1];
else
sa->callp = &p->p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;
OpenPOWER on IntegriCloud