From nobody Fri Jan 05 02:41:10 2024 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 4T5nlB6Bcwz55yfc; Fri, 5 Jan 2024 02:41:10 +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 4T5nlB5ll9z41pQ; Fri, 5 Jan 2024 02:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704422470; 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=y9jiaQ1VtCbCDpPLY99JuN3u8Mmok3BEWF4bv9c/75s=; b=iR9A/O6seJZJCI+RmlD4oBR/zyd0ATSEWbXVgsRZOSxc+ao72FgA7dzjhtEQnYcGNOG+NG szUaM2UqvFwvpC0GbU+lZaBlr79rp+r+3bEOymvVcX8lAP/AUv3zeAePUvycfqeAJOVUEr ddWf8jrmk3L/4wLRCnVde+fhMBzQD3iJDJ5cjeRHRt7QkQdcfcn85lM3LQR/KoWFpShJcz Rn1ix+4sB4vZUTyXqXJK27LEFt5XYbmAgDqNmH6mC+PRMivoYPyNSyqb+UbSQY+UyWcfxV 68uvLu8QuAOa1G2EU2KVcRC4yCt2JlPfcO+oEO3PkZX/UMkeNF3XAUMoeTny9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704422470; 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=y9jiaQ1VtCbCDpPLY99JuN3u8Mmok3BEWF4bv9c/75s=; b=uLlKD6E+yXExG8lK3kpfkUoI6tE6BiYobOGD9mTX75zDXvA6xqNPnp2Q1HOFqSI2stXuQg 22dDD+zo1fR6eBORSrJlKwpnQbyin+QLM7oplXHOvMildFwvCeh7zrxPkuqNHpd1OMrSu/ nqlhjPJDZkccjv5EJORh6qy6VbUZHzwLVRovrpSrPuE0AaqbICzMXrsmbVSwAw1RqbUqOe bVyDWuHBYJ3fcdEC6QJiGPH3z3lH6Z35/yVTJFHy7XD5TTNEG4dtaY0yewwuVVPYuwWBYi lghfLP5a3UkxHjiJv6tQMjP/v2MH4wCj0ZGrpegXtT1Gw8CSHQ/dWLha4MwGfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704422470; a=rsa-sha256; cv=none; b=vwM6ihqE4tQXc5d4kKl7WfXI6WN4S8YcOvbIKD1uIcKiDw6iJc3qJNUAaagVNPMmIsULle n3cJ2fdNi1287dTfeRVP7w7SRQkR4+ilFzf4Bq6l57rld+Qpe5bPXF9aS14LW7ssDJIEUq gM+yQ+03zCd7LXxidtaUjnLF8WTT0NBYkmInXyBT+qYPo0syLBQ5/YG5BuC+htLut4175n Z8+A9ceshCQmN2m/yVDZA99oe4JrNrMzaAttkbSgopv58eHXP4A2j7MVV3k7X7FfPhhe2x 1ACehfTAy+rEEAoiz3cf4XTJd5/1YR6HRRVOHsjLBtSNS/t++jI/i0oiuaOWMQ== 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 4T5nlB4rwGzfwV; Fri, 5 Jan 2024 02:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4052fA0V054291; Fri, 5 Jan 2024 02:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4052fAVs054288; Fri, 5 Jan 2024 02:41:10 GMT (envelope-from git) Date: Fri, 5 Jan 2024 02:41:10 GMT Message-Id: <202401050241.4052fAVs054288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6c951b37170f - main - mail: add volatile in grabh() 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c951b37170f1fb2ae8b4827070743e61b6eaed2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6c951b37170f1fb2ae8b4827070743e61b6eaed2 commit 6c951b37170f1fb2ae8b4827070743e61b6eaed2 Author: Lexi Winter AuthorDate: 2024-01-04 22:34:58 +0000 Commit: Mark Johnston CommitDate: 2024-01-05 02:40:53 +0000 mail: add volatile in grabh() setjmp() requires that any stack variables modified between the setjmp call and the longjmp() must be volatile. This means that 'saveint' in grabh() must be volatile, since it's modified after the setjmp(). Otherwise, the signal handler is not properly restored, resulting in a crash (SIGBUS) if ^C is typed twice while composing. PR: 276119 Reported by: Christopher Davidson MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/993 --- usr.bin/mail/tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/mail/tty.c b/usr.bin/mail/tty.c index 9921c8cbd209..937a43bb3789 100644 --- a/usr.bin/mail/tty.c +++ b/usr.bin/mail/tty.c @@ -54,7 +54,7 @@ int grabh(struct header *hp, int gflags) { struct termios ttybuf; - sig_t saveint; + volatile sig_t saveint; sig_t savetstp; sig_t savettou; sig_t savettin;