From nobody Tue Jan 04 14:39:36 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 22512192AF53; Tue, 4 Jan 2022 14:39:37 +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 4JSwHX697Dz3QTs; Tue, 4 Jan 2022 14:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B42781AA5B; Tue, 4 Jan 2022 14:39:36 +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 204Eda2d043953; Tue, 4 Jan 2022 14:39:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 204Edapg043952; Tue, 4 Jan 2022 14:39:36 GMT (envelope-from git) Date: Tue, 4 Jan 2022 14:39:36 GMT Message-Id: <202201041439.204Edapg043952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: f7b04c53de46 - main - linux(4): Reduce diffs between linux_rt_sendsig() and sendsig() 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/main X-Git-Reftype: branch X-Git-Commit: f7b04c53de46b18785a153d9812e64ca1a9a8c8d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641307176; 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=CXTLpr/m0sYqy25vrfcwxPISC4KBwYkAxoeu6MVVyLs=; b=mf4/ftRMvxhNOEdTyKzahRhz6upz0lnOGJGwJ6zD63MEZT5JmLtRd5U4e+ifFASHvfSevE IX8Vhd+egRFKgOOFvETwzZRVfzoFc2jDDw8Kv791GvtXOPpuJzzqbDEqQPEffcFcoDaXlO P2J41izyVD6bEFJdO5P1LVHMC7+VEorM9+CUkFlbSDbNlH8wZ7r3J1KGJrLUwdE/JrKZ/k SVzpx55rpeq5woL9RyyhSPcLSNORfO6n4fvNo7+4V5/Qm0usz9JfvLopPhKttll0DMsnp4 Iwa38spIK1298EN0owgy3JdCuzobQ/AQqMmVz8s6xfKIsjCSDritmQWjjMdNEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641307176; a=rsa-sha256; cv=none; b=PwJUuMRnZMgA1P9XdUpAKZb2VvsMbA7F4fbu9AERDlf68QEILJbyRFyIQ1bt0UuWy2VkX4 Pt0X7zGQ/OZGHsjXxyl9Y2WBji774sapuDm1UPj6GMwP/V/ie7wu7aAwHvDscptafsiJMa WAllV08Gd7yWDvDlau5xBnHj184qvdfFgkFB078GUhv5JSV8u6yomPMpELd8APt8x9ZtmF dgE2TximDf3jxLjQxVYy+89QS/5WQehhqwzh8BZUnvsDXqn91U6t5Dc5GxxwUeqEv/yQ/R wfRY0Hyun3mDaaRonI7oOouSkTMALRSkhMJnSbFrfdMIxKGgB9RxOjelkgAA4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f7b04c53de46b18785a153d9812e64ca1a9a8c8d commit f7b04c53de46b18785a153d9812e64ca1a9a8c8d Author: Edward Tomasz Napierala AuthorDate: 2022-01-04 14:13:03 +0000 Commit: Edward Tomasz Napierala CommitDate: 2022-01-04 14:39:19 +0000 linux(4): Reduce diffs between linux_rt_sendsig() and sendsig() No functional changes (except for the uprintf). Discussed With: kib Sponsored By: EPSRC --- sys/amd64/linux/linux_sysvec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 52757848cb98..cec765608f87 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -670,10 +670,10 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - - sizeof(struct l_rt_sigframe); + sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; } else - sp = (caddr_t)regs->tf_rsp - sizeof(struct l_rt_sigframe) - 128; + sp = (caddr_t)regs->tf_rsp - 128; + sp -= sizeof(struct l_rt_sigframe); /* Align to 16 bytes. */ sfp = (struct l_rt_sigframe *)((unsigned long)sp & ~0xFul); @@ -695,6 +695,8 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Copy the sigframe out to the user's stack. */ if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { + uprintf("pid %d comm %s has trashed its stack, killing\n", + p->p_pid, p->p_comm); PROC_LOCK(p); sigexit(td, SIGILL); }