From nobody Fri Jan 19 14:25:37 2024 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 4TGhjY3WM6z56bR4; Fri, 19 Jan 2024 14:25: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 4TGhjY2wCzz4tnf; Fri, 19 Jan 2024 14:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705674337; 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=dsaowdmHE8aAYNc78bPhxiDN8Xjzcd/cvJAczve6IJM=; b=uH9hv63fmqa1XUjsnOqrx0Y7mQ5cQXsX4pWmf20qqqfUER2XxtHwwLuN78Rj+jvwLsA64b c6F1M+O8wL3jRJgIWzLKl9HcI+9bkyh22DfGOn6YtOhin+oTF3AaWtLuUZaPbKDKP17LA2 qBEBa7mz30cbaJejKRSOTPk0Wh7rYDMXwZi07BeGq+GykY1j60DEPVVMKCvC7NuZZiPcme AiZa6wBoDmAFkYztAThQhqMGbhxTb25cF6GdLmJsCe358UfT4YyTfA8MImdmsxipBCdPGZ +4eP88W7Dnaap1vnVCdPS+R8nnlqeSUj6FrxQUjeeMWYvkiQLFm6RtTRfJsRrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705674337; 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=dsaowdmHE8aAYNc78bPhxiDN8Xjzcd/cvJAczve6IJM=; b=yschCpaM/LisI1TIYfFXsTr3NqFhwxkA60fqKUyRffEi+PtHfwLJlxsNboX0Go0QXoFyGQ SiSGqkQSJlmLmFAft/CQnztt1HMSMt2QEutmko9f3p89VY7xIFZZSINrH2NseZoSXvy0hr Zvrxgzgx2RP1UgC/gyesNRxDO+tPNdigSsmIYOiRoomP2SBqh8ZelaEBAUACcAep7qysR7 TNjtAjCLbwkM70oZoK+pUPhl61mdVOiGv7DY6o8LlRebbcrCIJEFSeWDcLECQFZoWDKPQK 5uU6QQ0SZXj2wo3uCynUX7iP0I2KBiCFPvAwprsF3hutez207PeRGhCUcSCS/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705674337; a=rsa-sha256; cv=none; b=DR0ODk1hvIcj7YWNGTl+Z7z0AveOowIIAoFaw1IWNcB7xrOTAblZi3XX/OCsN/6k+Xqc0J RF2uuGj2FtX3xWcU+fBTSaPt15A+gcqgjiBo3vz9I02lZiHwwf7sq7IHyhxlza88lcg6oc HjfSuzeETlh/+3FRAa9HwhQCiEMoTLvfsPNnm9RuJDAxgfTzM92S211Pdisrzn5pXh2NZu l25YcrgO5mIinjes2AH1nz/Vx53IdOM5Prdqi0+xZB+1evLtcMsuB7lIUd4y9QlbOP7tvg 2OjNQjQii+MxVC1f3PgfhdCOwTsCzE1hCpzII5Fu7B60iL7UvR6a3liCKdeLZQ== 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 4TGhjY1p9Qztsf; Fri, 19 Jan 2024 14:25:37 +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 40JEPbHB005259; Fri, 19 Jan 2024 14:25:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JEPbVc005256; Fri, 19 Jan 2024 14:25:37 GMT (envelope-from git) Date: Fri, 19 Jan 2024 14:25:37 GMT Message-Id: <202401191425.40JEPbVc005256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f2ad8d3a1397 - stable/14 - mail: add volatile in grabh() 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2ad8d3a1397660127f22ba9c0785ef4122a8ba5 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f2ad8d3a1397660127f22ba9c0785ef4122a8ba5 commit f2ad8d3a1397660127f22ba9c0785ef4122a8ba5 Author: Lexi Winter AuthorDate: 2024-01-04 22:34:58 +0000 Commit: Mark Johnston CommitDate: 2024-01-19 14:25:05 +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 (cherry picked from commit 6c951b37170f1fb2ae8b4827070743e61b6eaed2) --- 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 92cec3c6865c..37797db645c6 100644 --- a/usr.bin/mail/tty.c +++ b/usr.bin/mail/tty.c @@ -60,7 +60,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;