diff options
author | jhb <jhb@FreeBSD.org> | 2015-10-22 21:23:58 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-10-22 21:23:58 +0000 |
commit | 2705fe5cc132ba44ee6bdb210ae3bff5be670722 (patch) | |
tree | 3b1af4dad4bb676910953bafe6ab6df89b86ec4b /sys/amd64 | |
parent | febc1927cddec93d927a855936dfeba97f21707a (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/amd64/linux32/linux32_sysvec.c | 2 |
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; |