From nobody Fri Jun 17 19:32:06 2022 X-Original-To: dev-commits-src-branches@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 3E3CA853D29; Fri, 17 Jun 2022 19:32: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 4LPq1L23RFz3KMB; Fri, 17 Jun 2022 19:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494326; 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=N0CYIW537A8jIAxKw3a0u9wRLXP7Odq7uxTfD22+Rno=; b=WB/zjSiT30gPLaUJp3wjkPMjM2+1VBxo4VAh5QE1wj+Am0N/WBb/cxg9WKj6eTBm4687am xy2MYWVQhg+N9UraTrf3WIiomYKm0vMZww7M5O/9RAcNY6HbS41GHM90BOmcZe4Lre1BEj KPogYenFmJT5xUYJBbYKYitflrMvBeUwOwr4E0tmEds1vI9q/9hVYw1cRmqbBGsf3gedQP qCyv12Aw8gjr1qWlYzCNlz7x/CfLPeVzO0zySL526qoX4ur4VVQwCvRdMAFMR603YsvIms BPGH98sMHbvCdo/XYzqDQdZ+YeaSX27ZJDRSVK/X08ta5e6bj8Mv4ISHtiozCg== 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 1CDB525A21; Fri, 17 Jun 2022 19:32:06 +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 25HJW6sp008011; Fri, 17 Jun 2022 19:32:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJW60K008010; Fri, 17 Jun 2022 19:32:06 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:32:06 GMT Message-Id: <202206171932.25HJW60K008010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: b0774c8b9040 - stable/13 - linux: fix sigaltstack on amd64 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: b0774c8b904096f1bc28e9a94b764a75eb6fb4ff Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494326; 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=N0CYIW537A8jIAxKw3a0u9wRLXP7Odq7uxTfD22+Rno=; b=UKxDcpc41ZSzUhc0qcy8lRm3AdMLmXV9qKi22ZAtZnPDv9uf+d1wD59Le7L/kG+b2PYUmW pJvu+J10OKTCYjXlylDJ+5VJgJN6E1ddmCSvjbzap+Y+GCJkbnCgMC010UDkPZM1ESGiSQ Y+14RuK+VMckL85I+CUY19sDJi10V42bbUPo3cTnZ88mIGCMI3Tra20dwpzwh3ZEjcTSab tv7ECN0yADOucOUnaxMkZNLCjQ9+CqgECGOS6lrZilCOp5WBpb5UbScUkCrx/12mboPk23 GsqiKtzuA5cDNqyRUDLH418LE2yO+KCnt5A66TuTM8Mp0Fi7Km70wm4inkaDPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494326; a=rsa-sha256; cv=none; b=lNtEBBfUE3vYMm3CNmSoFfC2T1cQcs6X1dxZoBD2XTlIEHpAjkRcA2PJ1sE1mUp5q5L9oP kcOWto/aYtgtww9STwi6x/p8opB8j8JQNN4kcX1Tkg/d3Ly2cIZviUgI8MTRLcIB2GKnEw HNG9zrA41FsLd+BoUGKi33iOrxK+OgXRf5237JyiuTkwk0xxjE2RB+Q6ryVWRXLhH/Asp8 vnfinSI8Ndj1npUF8NbMMLInt8qxUSWFxgtTmJORBDlgVjiu+IfGv2YT6oJ+zGPpri7Zxq 94OrYpQKhenF66jIS+bzfdnNQFppgQQUiH74ysUooWLWge/l3UwR9qrbS+Vg8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b0774c8b904096f1bc28e9a94b764a75eb6fb4ff commit b0774c8b904096f1bc28e9a94b764a75eb6fb4ff Author: Edward Tomasz Napierala AuthorDate: 2021-07-26 10:57:47 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:30:21 +0000 linux: fix sigaltstack on amd64 To determine whether to use alternate signal stack or not, we need to use the native signal number, not the one translated with bsd_to_linux_signal(). In practical terms, this fixes golang. Reviewed By: dchagin Fixes: 135dd0cab51 Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D31298 (cherry picked from commit b54838003cd43845576764dbad8f587d8f8b291d) --- sys/amd64/linux/linux_sysvec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 4a85f0469804..e6bbed4ba836 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -604,9 +604,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) LINUX_CTR4(rt_sendsig, "%p, %d, %p, %u", catcher, sig, mask, code); - /* Translate the signal. */ - sig = bsd_to_linux_signal(sig); - /* Save user context. */ bzero(&sf, sizeof(sf)); bsd_to_linux_sigset(mask, &sf.sf_sc.uc_sigmask); @@ -650,6 +647,9 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Align to 16 bytes. */ sfp = (struct l_rt_sigframe *)((unsigned long)sp & ~0xFul); + /* Translate the signal. */ + sig = bsd_to_linux_signal(sig); + /* Build the argument list for the signal handler. */ regs->tf_rdi = sig; /* arg 1 in %rdi */ regs->tf_rax = 0;