From nobody Sun May 14 21:31:07 2023 X-Original-To: dev-commits-src-main@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 4QKFzv58WPz499nJ; Sun, 14 May 2023 21:31:07 +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 4QKFzv4d4zz3wgM; Sun, 14 May 2023 21:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684099867; 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=8JeoPkUD8QO6Ko0gTcVpU4iqcTgYLdZnACjG7MqF47w=; b=saYxEqQ8fh2QTLVCb7CFvLMJSu9xt0KCxfm5dwLtiP80W37SqG8l6TAAkr5TWJ/CHabazJ bOPTJY/xNI8hX6Dxu6Xn+BbRwvSZHFxojlTImNM4R8JLs4fm/jHK+uFUb03h++/JCzfj+s vGS927zE9gXGV29vIvhtRqXaAmyVPDM7cF42M6/FU3X3Aa8n9BS8BJdCLRRe0hQjpRr10s Yo12wY9J/ZB8/oBO6v89Qjn34X8b6pI2XZDd/6vEbmeCflulaZBOFKxaSHG3lzEZclH68+ IunEOeF1riOvNrTkYcAeGy6oTRJkppAQvo4hMIyW6QBr4+A3S0UJl6Jo72i1oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684099867; 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=8JeoPkUD8QO6Ko0gTcVpU4iqcTgYLdZnACjG7MqF47w=; b=wKPanwofET8rC4YNctiii3GlV/ImwZmxUWvCimA/f9qfh9DQfT1o4uo9fvuwhLSznOk1Rn LygOzx3DwpLNZQjJ7C++KXgqsdWk9DlGJqQ75Urrg4hDgZOlmIRAHEAHo8yoGcXsXxjFyN Z5W33ZYP+jady9pj8WAYb4pdLBRS4TNjkFAgnjfnTunKN9YiM2/aig3ovxlBGqS0ty1EVT BAWB1licdKYJP3eGyQ7Xpcwkpw0JRbVBh8sCwFQc2juLGJ93t4DAny61LyITZlYInVQQW8 0vnqWT1giQqMZGIEGviBP2/fNj0tk8fG18WkUPt8UGyh4ihug8OBTEQn60g+bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684099867; a=rsa-sha256; cv=none; b=jfiEq+aRBpNSoVLdsxZsr9mXJkvskWRqHVCZ0wwcgB0SFFHSeh1G0w7an3JhuduMi45Z6X jxER/kXDZP8W6m3QgSsjN5kqnrfkdIgiTFKy9v7QexvzgTJHz8SfaPdzRVcwlLR9Y7TzY7 N3ikpU7PHsEH3Et3D3Iw9oklRfYCsTe40T8aftpcyXzD7uCBJLF1uC70cbAYJxU0eVdaN5 CTCzsSnCV9ME8497uOGk/1ejxLx7IA2fhYbzmS9XcwSDdPigYrFxzhhmHXdWuSzH6Ko15i 1/dBS1KCSJCpIs8G3GjqWl6f8ZWTwXozIrLRx7Cp7k+JZ0f0OQ4GPwWMIn5gGQ== 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 4QKFzv3S0tzF7w; Sun, 14 May 2023 21:31:07 +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 34ELV7QV074057; Sun, 14 May 2023 21:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ELV7rM074056; Sun, 14 May 2023 21:31:07 GMT (envelope-from git) Date: Sun, 14 May 2023 21:31:07 GMT Message-Id: <202305142131.34ELV7rM074056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 2cdeb89e5700 - main - linux(4): Fix stack unwinding on arm64 [2/2] List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cdeb89e57008e9299c1665783359141868f387e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2cdeb89e57008e9299c1665783359141868f387e commit 2cdeb89e57008e9299c1665783359141868f387e Author: Dmitry Chagin AuthorDate: 2023-05-14 21:25:57 +0000 Commit: Dmitry Chagin CommitDate: 2023-05-14 21:25:57 +0000 linux(4): Fix stack unwinding on arm64 [2/2] To allow unwinders to go througth a previous to sigreturn frame we should properly emulate the trampoline frame record which should points to the previous frame and set the trampoline frame pointer to the emulated frame before calling signal handler. MFC after: 1 week --- sys/arm64/linux/linux_sysvec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index b2853d8e8359..8337bdfe0eb2 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -301,7 +301,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Stack frame for unwinding */ frame->fp = tf->tf_x[29]; - frame->lr = tf->tf_lr; + frame->lr = tf->tf_elr; /* Translate the signal. */ sig = bsd_to_linux_signal(sig); @@ -352,6 +352,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) tf->tf_x[1] = 0; tf->tf_x[2] = 0; } + tf->tf_x[29] = (register_t)&fp->fp; tf->tf_x[8] = (register_t)catcher; tf->tf_sp = (register_t)fp; tf->tf_elr = (register_t)linux_vdso_sigcode;