From nobody Fri Jan 20 03:23:46 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 4NylFv14kzz30vrC; Fri, 20 Jan 2023 03:23:47 +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 4NylFt45B4z3njD; Fri, 20 Jan 2023 03:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185026; 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=C0vVx04fdAbUnWEora5S4Mzb6yxq8ph5fAfChjgdHGA=; b=PD1rFBzJMd1Q/D7o9jZe+arTlvNS+8YtrnStPv5YOW5Ej2ShUSisq4RajL7UAh9oVI+nyX Tt+kmVLLrPqIS7bPaK5Hs4ONJzWNlrhRyyP5PXM9Zdfg5vYKvotvZTUHYFcpOTUSqZIWJW xQ08HQTcryIepLF5Ju0YDMXcAKZv52fASRsqYzjjx3edzSWHDWxYxgvzjLRXDdDSt4SaXv cU5oxaY4KzKwSwkTF5DN7uq3hrs+bHHPQJR25NZUZZ5scUnahvN3qAQ74oUfLYijiw77X7 85Msr8nAefI3Lc+/tM1KaDbPCFUYgzj73LYa23MYN9ih2M09fdR4NMXcXjuwCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185026; 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=C0vVx04fdAbUnWEora5S4Mzb6yxq8ph5fAfChjgdHGA=; b=pRHtLI/g4qdeE2bBg6il7y52yY6ZCmPCdixZY7lCu/lwX8DmZ5sU7cYcknZlYFH3LSOByI Bqr82qTi81vGNhYi1bURilWsBWxPR53JCYVozebvuvFj4RSUVRlHAtqPAVuT41CriCADjM +hBuI8XAlqWUy/UrDkMEF3IXUKqIrZQ8vyagk3MSiQvkiJZg9kRlRS30Z6zXmlDQnusBwf DYWREGbzgNgHcOKTksrnovzYvPKunekpEJgZYcuHYVVx48SPU8JSPiHjzCChkXoPpbgdEd 7ppTdCDau8izPjMfRXXJ+yhNMfNO57gkzeDggE27zBFnLVB+3hzPkekk8ldlWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185026; a=rsa-sha256; cv=none; b=OPOa6f+7VbXqeWJZt0fp9H9IXyLPQprl7ZHXDLUt4r5f6hGnjtRqT+6QRSWH3vt3wG8+OP kYBE0vyzKLolfeCHwPEmLoLXkmKctAJlTvg+4TFrslEdp02VBXkthpbQ77AaxHwBEFAm9b J7j93e6sS1hfQCFtLUybpsEPgbSR/wk/y7Ztt6bN0zLKPyKd+oZgbDZ5VsDzpN2LyN+bTf ILvrHPl4XdmaajXtkMxT7JP9S2oy0o00vkvXadx5jUIm2jEq13ha0VWyaQ1YhQdS96G9MH KIhiJricb3B9AE/brcH068uwSkfxks+XMeZoNVjIju1DltY4DvaPvmIhXIAuZA== 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 4NylFt2CpnzGKf; Fri, 20 Jan 2023 03:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NkYF042613; Fri, 20 Jan 2023 03:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NkDr042612; Fri, 20 Jan 2023 03:23:46 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:46 GMT Message-Id: <202301200323.30K3NkDr042612@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: 287fe4003e2b - stable/13 - Fixes for ptrace_syscallreq() 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: 287fe4003e2b05bfbbe40996a927a420addded77 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=287fe4003e2b05bfbbe40996a927a420addded77 commit 287fe4003e2b05bfbbe40996a927a420addded77 Author: Konstantin Belousov AuthorDate: 2022-12-22 23:51:34 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:59 +0000 Fixes for ptrace_syscallreq() Tested by: pho (cherry picked from commit 974be51b3f6070f9aae02e115ea6099f90bc9175) --- sys/kern/kern_sig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 970c756d4a8e..63d73cf7a909 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2595,6 +2595,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p, sc = tsr->ts_sa.code; if (sc == SYS_syscall || sc == SYS___syscall) { + sc = tsr->ts_sa.args[0]; memmove(&tsr->ts_sa.args[0], &tsr->ts_sa.args[1], sizeof(register_t) * (tsr->ts_nargs - 1)); } @@ -2615,7 +2616,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p, #endif sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; - audited = AUDIT_SYSCALL_ENTER(tsr->ts_syscall, td) != 0; + audited = AUDIT_SYSCALL_ENTER(sc, td) != 0; if (!sy_thr_static) { error = syscall_thread_enter(td, se); @@ -2639,7 +2640,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p, #ifdef KDTRACE_HOOKS if (se->sy_return != 0) (*systrace_probe_func)(&tsr->ts_sa, SYSTRACE_RETURN, - tsr->ts_ret->sr_error != 0 ? -1 : td->td_retval[0]); + tsr->ts_ret.sr_error != 0 ? -1 : td->td_retval[0]); #endif tsr->ts_ret.sr_retval[0] = td->td_retval[0];