From nobody Fri Jan 19 14:27:00 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 4TGhl8390Hz56c6y; Fri, 19 Jan 2024 14:27:00 +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 4TGhl82LNvz4vNB; Fri, 19 Jan 2024 14:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705674420; 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=haCid6Fwk3onHOgVFq1T12JXR/lTBVrTwlR4KsTeEXM=; b=bUUOYD5o5ehj73kdzC11Z+V+11BxLqXKxpKmcqVnbywXctzuU8Pqj2y8LDZMkVqxqE9TvK 5av7GO0r+2Mz2bazjMOFctEt99JzLfaOINdbZMoJ5bKwDGtfWfvRewl3C2S1GAss+utPot lFfwZxGGp8p47qjBUMMuoJU6xf86Mcqy7XIK/GD1ridGHJfAGGWhZxNtiHUzRPWwBuRmJ8 aQtRtqN7o9Z70cLF0vjJXGr/YHR7qbUfk1jE+A8QEGwPGEUAAS4snvUSK7LXQ937EQPWG9 3w2Xug22AGmFqbc83x2wW7EGBoKDMBT01aFfSHrs+iMp0iO4ih6d+rTu3vGKXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705674420; 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=haCid6Fwk3onHOgVFq1T12JXR/lTBVrTwlR4KsTeEXM=; b=tEYTB515fh5uBaYWRbnWumIX1Sgtx4szVjfHBUigJFQNVWC0Em1V8bt4cabBp/dAxqKGPC +slLU2uXc8k49xAVEDsfpdF6SLPrz2XFTH9dryIMAsmRn33+ufi8hSZsI24YSU8P72z0Gi Q/yxuAyBfNI3wMOLF7Ro6zr7RcR35Wf56Y6UVYvasPGUoor+/FHsKeIY7ilpciNjLXCOxz 2c6fgfX1E3hKcX4bcG1G0my+MBhzp3QJREr5ZJEHxt+lvLn0zO9YI9uNAYT5DBSKo4z2U5 tmIfGpHgEiDcwunTrA1VL+QribQRB2x49r5A6JDRZitSFRtCpLq8/LeL8dBMIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705674420; a=rsa-sha256; cv=none; b=W283Yu32sx2MARppzs643ApWFDJHk+Al2A/QeY5uKmBq0Me7kxnz7ad0DeXJc31qgkytOl zsHnfc5o/Rtt+Bs2OaKZu8hhyaE4wkQioHllGt5D6SM2WQi4XHsDlEM4eSRonR53UJ+MOp X0HzhyucLQ5D4fCNtJR9eC8kU890A5qRx6aq5V9ZGS/StUzTu2ofOOI9KXhjg3FyfGz+BS I/oXHgAmfL1ocJcCiqbMQTo82VmDXyBhX6y+N7J5NT9SrOdSlGpsr0uxfcwP+H4wzWO9LI RSrS0CwdZJd3M+tcw7UYxkY3BzmK07NEsmmnQlHpxyE1zPcZBSLXWTDvNbwWIg== 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 4TGhl81KmVzvHP; Fri, 19 Jan 2024 14:27:00 +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 40JER0jF005575; Fri, 19 Jan 2024 14:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JER0ne005572; Fri, 19 Jan 2024 14:27:00 GMT (envelope-from git) Date: Fri, 19 Jan 2024 14:27:00 GMT Message-Id: <202401191427.40JER0ne005572@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: 6d78f3a6310d - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 6d78f3a6310d0f873a8515541e6fbf62ef7237d6 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6d78f3a6310d0f873a8515541e6fbf62ef7237d6 commit 6d78f3a6310d0f873a8515541e6fbf62ef7237d6 Author: Lexi Winter AuthorDate: 2024-01-04 22:34:58 +0000 Commit: Mark Johnston CommitDate: 2024-01-19 14:26: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 (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 62f42fc43e5d..f7e2aa148dc2 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;