Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2024 18:45:41 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: bf9a275b24f6 - stable/14 - OpenSSH: correct logic error in ObscureKeystrokeTiming
Message-ID:  <202407151845.46FIjfsB087290@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=bf9a275b24f6655616cc691555fe1a36ed5e4338

commit bf9a275b24f6655616cc691555fe1a36ed5e4338
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-07-01 13:14:15 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-07-15 18:45:16 +0000

    OpenSSH: correct logic error in ObscureKeystrokeTiming
    
    Cherry-pick fix:
    upstream: when sending ObscureKeystrokeTiming chaff packets, we
    can't rely on channel_did_enqueue to tell that there is data to send. This
    flag indicates that the channels code enqueued a packet on _this_ ppoll()
    iteration, not that data was enqueued in _any_ ppoll() iteration in the
    timeslice. ok markus@
    
    OpenBSD-Commit-ID: 009b74fd2769b36b5284a0188ade182f00564136
    
    Obtained from:  openssh-portable 146c420d29d0
    Reviewed by:    gordon
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D45823
    
    (cherry picked from commit b81424adf7181d816c10b1345aaa3305ab0ec304)
---
 crypto/openssh/clientloop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crypto/openssh/clientloop.c b/crypto/openssh/clientloop.c
index 8ec36af94b3f..6dcd6c8535aa 100644
--- a/crypto/openssh/clientloop.c
+++ b/crypto/openssh/clientloop.c
@@ -608,8 +608,9 @@ obfuscate_keystroke_timing(struct ssh *ssh, struct timespec *timeout,
 		if (timespeccmp(&now, &chaff_until, >=)) {
 			/* Stop if there have been no keystrokes for a while */
 			stop_reason = "chaff time expired";
-		} else if (timespeccmp(&now, &next_interval, >=)) {
-			/* Otherwise if we were due to send, then send chaff */
+		} else if (timespeccmp(&now, &next_interval, >=) &&
+		    !ssh_packet_have_data_to_write(ssh)) {
+			/* If due to send but have no data, then send chaff */
 			if (send_chaff(ssh))
 				nchaff++;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407151845.46FIjfsB087290>