From nobody Mon Oct 09 03:43:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S3lHG5yhjz4wCHM; Mon, 9 Oct 2023 03:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S3lHG5Gf6z4FRr; Mon, 9 Oct 2023 03:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696822986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w47z03AxG48gVE3xji2j7+JUdSza0yclRKzcb7iALoM=; b=JacyBi5NdlN0G4q1RucBqjwhZ+bclEeR8aoOJa2gTrEoND5y7ZKUtgm19JYRuXk0GTCDsW zZKO3a7oXOjK7sJv0H6RQDOP02MhM1KfFAhvmJKBJLpxC3imhFt5PhezJ+nACF6vhntMvG ntlcYLAkXCCfOPBg/r9aUb8FEu4ZrrgDXiH4fszApSPygf9H7dF/Iv7UIlqBbXbGiJ3dqL +jwDoHmwQFcBFrBAHLM7hmryk/T04XPztOmCBGUuiXl0/M1gN5E/ZPQ4AllhO9/XdBWQTV fVEYdyXF+btTuJngCokkSDf9I3YRoMuLv72L0LzKXgv2Nsb5RSlfDY7PlPq6vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696822986; a=rsa-sha256; cv=none; b=ucG76ArkvquWvcvRSPLp8dXrQeNWWownxihOoxlY8raID9/SrKHjAOnyJKRuLG1ySXMLPp y/KQIurtgu1PQi0liCiTd1KVivKl/lgdgLr8RVQILveQvNb/uoHpGllnvcFdZwGEPnfdI+ NNjpdAmxY8BFx8AVhQWh3+uY6f2kpQ0ynA4diQQ8/qzAUQZULXXlrHSviha4r74lTlCG04 xFwSmepgurGL02UIxiMWK3vGNXNrh2KiBGQ0XD4RZpX/PERxL6OcES+xozEyY+jXgTXJwb OZDtguIVKsJFvyd2WP9YJWKCq74btMrLtQhYFwAVKA0hkd35IHXmefcyqSCxTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696822986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w47z03AxG48gVE3xji2j7+JUdSza0yclRKzcb7iALoM=; b=aA6bNEe1c26k41xTJbvLGWkdruAgXYZNpQ/g3JNN/HX4Bd7JJrvltp21cso+bC1EnesmsF 8BAzUcEqdU9SyXI1UCsOMvbOkHbjStYa4HdIsR/ya3qW6oHpPSIT5mdjXHlfitLJ6qk7Fd 5CM+TYq6rBVga/EKMOsifG2tF1O0g261pHoc9lpCMbnMoNg9XTPDGrFi6bzOOhYFZNiLJW 1XFplt4v07cTUH9REd45fbs80NCSZ9lHV4Lt5o/t2p0lPxTYvRcCRGH/6A+8zdxvshnkdu 4DDPQ4RmmBVSY0Uj3iSdP781lcZmjvDyL2Qv/RLobJNMOkog/Dm56K9WtREBCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S3lHG4FP1zgfm; Mon, 9 Oct 2023 03:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3993h6H7024108; Mon, 9 Oct 2023 03:43:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3993h6EM024105; Mon, 9 Oct 2023 03:43:06 GMT (envelope-from git) Date: Mon, 9 Oct 2023 03:43:06 GMT Message-Id: <202310090343.3993h6EM024105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7ac1c755d057 - stable/13 - sysentvec: add SV_SIGSYS flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ac1c755d05777620e47254d0526df82155df58e Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7ac1c755d05777620e47254d0526df82155df58e commit 7ac1c755d05777620e47254d0526df82155df58e Author: Konstantin Belousov AuthorDate: 2023-09-25 16:33:36 +0000 Commit: Konstantin Belousov CommitDate: 2023-10-09 03:42:17 +0000 sysentvec: add SV_SIGSYS flag (cherry picked from commit b82b4ae752501469053979393e33bbfa74fbc9d2) --- sys/amd64/amd64/elf_machdep.c | 6 ++++-- sys/arm/arm/elf_machdep.c | 2 +- sys/arm64/arm64/elf32_machdep.c | 2 +- sys/arm64/arm64/elf_machdep.c | 2 +- sys/compat/ia32/ia32_sysvec.c | 3 ++- sys/i386/i386/elf_machdep.c | 2 +- sys/kern/imgact_aout.c | 6 ++++-- sys/kern/kern_sig.c | 8 +++++--- sys/powerpc/powerpc/elf32_machdep.c | 2 +- sys/powerpc/powerpc/elf64_machdep.c | 4 ++-- sys/riscv/riscv/elf_machdep.c | 2 +- sys/sys/sysent.h | 1 + 12 files changed, 24 insertions(+), 16 deletions(-) diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c index 4cce1aa85970..6e966ec559f3 100644 --- a/sys/amd64/amd64/elf_machdep.c +++ b/sys/amd64/amd64/elf_machdep.c @@ -81,7 +81,8 @@ struct sysentvec elf64_freebsd_sysvec_la48 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP | - SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG, + SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG | + SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, @@ -124,7 +125,8 @@ struct sysentvec elf64_freebsd_sysvec_la57 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP | - SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG, + SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG | + SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c index a7de7deb73e1..0f31217d060e 100644 --- a/sys/arm/arm/elf_machdep.c +++ b/sys/arm/arm/elf_machdep.c @@ -88,7 +88,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_maxssiz = NULL, .sv_flags = SV_ASLR | SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | - SV_ABI_FREEBSD | SV_ILP32, + SV_ABI_FREEBSD | SV_ILP32 | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index edd285d8b482..c59571808cd3 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -105,7 +105,7 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_fixlimit = NULL, // XXX .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_TIMEKEEP | - SV_RNG_SEED_VER, + SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = freebsd32_set_syscall_retval, .sv_fetch_syscall_args = freebsd32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index f190316ae3ec..5ca289326df2 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -83,7 +83,7 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_SHP | SV_TIMEKEEP | SV_ABI_FREEBSD | SV_LP64 | - SV_ASLR | SV_RNG_SEED_VER, + SV_ASLR | SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c index 84e3c674ee41..62108cf86ab9 100644 --- a/sys/compat/ia32/ia32_sysvec.c +++ b/sys/compat/ia32/ia32_sysvec.c @@ -128,7 +128,8 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_fixlimit = ia32_fixlimit, .sv_maxssiz = &ia32_maxssiz, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_IA32 | SV_ILP32 | - SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG, + SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | + SV_DSO_SIG | SV_SIGSYS, .sv_set_syscall_retval = ia32_set_syscall_retval, .sv_fetch_syscall_args = ia32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c index c40b27462ab4..58f3c23dfcb0 100644 --- a/sys/i386/i386/elf_machdep.c +++ b/sys/i386/i386/elf_machdep.c @@ -76,7 +76,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_IA32 | SV_ILP32 | - SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER, + SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 002bee840379..23384d383e2c 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -92,7 +92,8 @@ struct sysentvec aout_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32, + .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32 | + SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, @@ -142,7 +143,8 @@ struct sysentvec aout_sysvec = { .sv_setregs = ia32_setregs, .sv_fixlimit = ia32_fixlimit, .sv_maxssiz = &ia32_maxssiz, - .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32, + .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32 | + SV_SIGSYS, .sv_set_syscall_retval = ia32_set_syscall_retval, .sv_fetch_syscall_args = ia32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 04ca12cc5d84..5dd56e0ec851 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -4128,9 +4128,11 @@ nosys(struct thread *td, struct nosys_args *args) p = td->td_proc; - PROC_LOCK(p); - tdsignal(td, SIGSYS); - PROC_UNLOCK(p); + if (SV_PROC_FLAG(p, SV_SIGSYS) != 0) { + PROC_LOCK(p); + tdsignal(td, SIGSYS); + PROC_UNLOCK(p); + } if (kern_lognosys == 1 || kern_lognosys == 3) { uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c index a689860b9a25..5611c18920ec 100644 --- a/sys/powerpc/powerpc/elf32_machdep.c +++ b/sys/powerpc/powerpc/elf32_machdep.c @@ -123,7 +123,7 @@ struct sysentvec elf32_freebsd_sysvec = { #endif .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_ASLR | - SV_TIMEKEEP | SV_RNG_SEED_VER, + SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_shared_page_base = FREEBSD32_SHAREDPAGE, diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c index 118dedda2a71..a1cf7d41e38a 100644 --- a/sys/powerpc/powerpc/elf64_machdep.c +++ b/sys/powerpc/powerpc/elf64_machdep.c @@ -85,7 +85,7 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR | - SV_TIMEKEEP | SV_RNG_SEED_VER, + SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, @@ -128,7 +128,7 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | - SV_TIMEKEEP | SV_RNG_SEED_VER, + SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, diff --git a/sys/riscv/riscv/elf_machdep.c b/sys/riscv/riscv/elf_machdep.c index 52e993a21abb..23d4ea885378 100644 --- a/sys/riscv/riscv/elf_machdep.c +++ b/sys/riscv/riscv/elf_machdep.c @@ -87,7 +87,7 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_TIMEKEEP | - SV_ASLR | SV_RNG_SEED_VER, + SV_ASLR | SV_RNG_SEED_VER | SV_SIGSYS, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 2d8631b94113..77f59b968346 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -172,6 +172,7 @@ struct sysentvec { #define SV_SIG_DISCIGN 0x200000 /* Do not discard ignored signals */ #define SV_SIG_WAITNDQ 0x400000 /* Wait does not dequeue SIGCHLD */ #define SV_DSO_SIG 0x800000 /* Signal trampoline packed in dso */ +#define SV_SIGSYS 0x1000000 /* SIGSYS for non-existing syscall. NOTE: different value from HEAD */ #define SV_ABI_MASK 0xff #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x))