From nobody Mon Feb 21 13:48:58 2022 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 3E9A7183A2EC; Mon, 21 Feb 2022 13:49:01 +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 4K2Nv02fyJz3Pnq; Mon, 21 Feb 2022 13:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645451340; 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=+phj6zQc/VUJP8LBkhpzg1FjM7YpNfFlOaqB0JnFFCk=; b=PAwiUo0+gaby+LpPnOaOMDKuYIbocU92Ydp8N4kjzVHS6gKcYmVN+LEjeNU5n4nyBHAtCh dLlDvD17MebBx5moElVS0+rqSH+T0Q3Mfydv3/ur+WXpp4jerojSjalmoL9r1ApyT0SpsO 0xjqhUhacJq1ZRASdzrOkRl+nZKvUBCavxe4jE3YRRCltoUq6+YyPGCc4rVJs6zoC0OJTB LUR43mlpwo+8C8KtoltbrwIguOg1KpfOBU02TA19Txo9/1XMw53ZVnXNlOgnW0h//BUCCs aX7fSnm0eEV2YJozaj6azbp4VG3TO+nAEAt+l0RoA+QVKMAdYvDhMl62O/bxzw== 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 DCA5D114C8; Mon, 21 Feb 2022 13:48:58 +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 21LDmwUG091995; Mon, 21 Feb 2022 13:48:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21LDmw1s091994; Mon, 21 Feb 2022 13:48:58 GMT (envelope-from git) Date: Mon, 21 Feb 2022 13:48:58 GMT Message-Id: <202202211348.21LDmw1s091994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 3b7841de78a3 - stable/13 - linux: Make PTRACE_GET_SYSCALL_INFO handle EJUSTRETURN 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: trasz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b7841de78a3347429426ae978affe42d3d8d6b4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645451340; 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=+phj6zQc/VUJP8LBkhpzg1FjM7YpNfFlOaqB0JnFFCk=; b=LJhyu8JvufvqreVa+9n98cZsN+yCsk2g6edT45Rd5GDPYautuieD9lHDlsGRFRoGKnv2G5 u4ZP5NsAPQL5bKKPNvN9FtF7VAPRvJbtKXUOXwSlNRrh1SZ8r8KaKdc6+pNg/sSnS5rpyy gmGoYJmXKXZFJDViv8Zh55RgIyKHB95rIXF5zYSmrRHeOQX4YBJGyQXsBXq1Wnz5M4N5gd 5CGij2puRmOFIEzFAeANTzaClT4zkWU95Pe+2gpOlKXwJcs5TilUN99AWLIJEIlyOaDra4 hyD2Uha2pWeW84aYwU+V0V5ZWla3BZb7+EUugkxJPbP8DfoP77rVtSAUlC5p9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645451340; a=rsa-sha256; cv=none; b=s9viXhNbkjuY8RtF9lo2CQhtMMRTaiN0uPIN/IyR7lC4O0Fnkimsshx8Km6ISuBjqlxw/X fPzcnUgLDf0ZKWWswAOYK3xUDaZ+InBOf/eyzxCBb6oVXR9rxc6ZzD4xyTlIq6g+OPl+ub NAdfWjsINUpOwxAI7gSBMYa/vYkyomaz1BTkhesLhrQFlamPTMtPXJXYNEHxq/xiQpAUdQ BSkLlAWka3xoKbJvM/KcWMiuYQBs/p8QQeq/bgif4WfabiEcIOr8mHD2evIhXtET5Wg60j Pa9kRL+l+RnqerbyZHDDO6vnLW1zlqJb/JT7Fbx5QOkdbmOARIch7HnciZq4jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=3b7841de78a3347429426ae978affe42d3d8d6b4 commit 3b7841de78a3347429426ae978affe42d3d8d6b4 Author: Edward Tomasz Napierala AuthorDate: 2021-10-23 17:56:29 +0000 Commit: Edward Tomasz Napierala CommitDate: 2022-02-21 13:35:30 +0000 linux: Make PTRACE_GET_SYSCALL_INFO handle EJUSTRETURN This fixes panic when trying to run strace(8) from Focal. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32355 (cherry picked from commit 2558bb8e9166395dce26afcfac91fc692621de7b) --- sys/amd64/linux/linux_ptrace.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 673d60d70a7f..e87e0a63f5b4 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -650,6 +650,15 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, if (sr.sr_error == 0) { si.exit.rval = sr.sr_retval[0]; si.exit.is_error = 0; + } else if (sr.sr_error == EJUSTRETURN) { + /* + * EJUSTRETURN means the actual value to return + * has already been put into td_frame; instead + * of extracting it and trying to determine whether + * it's an error or not just bail out and let + * the ptracing process fall back to another method. + */ + si.op = LINUX_PTRACE_SYSCALL_INFO_NONE; } else { si.exit.rval = bsd_to_linux_errno(sr.sr_error); si.exit.is_error = 1;