git: 0c69982252b8 - stable/13 - linuxolator: fix nosys() to not send SIGSYS

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 09 Oct 2023 03:43:08 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=0c69982252b82dfcd176604507df7e735edce565

commit 0c69982252b82dfcd176604507df7e735edce565
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-09-25 16:39:48 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-10-09 03:42:17 +0000

    linuxolator: fix nosys() to not send SIGSYS
    
    (cherry picked from commit 7acc4240ce00af540093b47ad00be0508310b515)
---
 sys/amd64/linux/linux_sysvec.c     | 2 +-
 sys/amd64/linux32/linux32_sysvec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index 8a2fcf8caa7b..c8dc40ea0a29 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -164,7 +164,7 @@ linux_fetch_syscall_args(struct thread *td)
 
 	if (sa->code >= p->p_sysent->sv_size)
 		/* nosys */
-		sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1];
+		sa->callp = &nosys_sysent;
 	else
 		sa->callp = &p->p_sysent->sv_table[sa->code];
 
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index b30077b01b77..fb817ea2b1ab 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -536,7 +536,7 @@ linux32_fetch_syscall_args(struct thread *td)
 
 	if (sa->code >= p->p_sysent->sv_size)
 		/* nosys */
-		sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1];
+		sa->callp = &nosys_sysent;
 	else
 		sa->callp = &p->p_sysent->sv_table[sa->code];