From nobody Thu Aug 01 15:04:07 2024 X-Original-To: dev-commits-src-branches@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 4WZXL00JbNz5StnP; Thu, 01 Aug 2024 15:04:08 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXKz6x5Bz4QMT; Thu, 1 Aug 2024 15:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524648; 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=fgfl0exzEH0uqT6531klkkfU3qKatu+Xia4LJN80bX4=; b=nJ4RsI7RQynlblN1U+tMbocusobvOcQO2/buvU2MtbTs1n5Goe2SbOSNQBZ6321rqS7CR+ sVEw6yQAIrUP+JCrti9nDq4se0+w5/Wqz/RU4anzIR8YzZxe6u6Yq7nns6YWavi6sPIyOj kDBgZ66s1eZf2nPkZ8IcsFl+ECQScArAnnzoJRPfk+FTIRWBaXKKizRNmTW22m8wgjt5bW j4i2Q92NS6hoi3o8n+bCnFLX/GsnDZAJFoTC4dS6pnLnCW/FhM6SFKfbWab9fSLEtufR5R 8oPeCo5by0OK9wdWyg2hebUqsIZLrL7E2TG+7MMF41FIbKCnzjPwmmdyRQU9jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524648; a=rsa-sha256; cv=none; b=U88IzI3UNAFt/T+YqA1snfOdK5jERiz4AAIyKnmE4NdaDP7ehHgnEx14VT6TrV+16XilK5 V4BzWgBi/eRbolQe6OivG6QTWSXKWSpQpGO9+BMGUITMrsWzCFthhkG2LGb+E7ZFaPcqmp Z+aGuXKwmrbBJtFsVEAE+odAPUbRLj+al8velfSk2vQPdUKzEyG0krE789P25Rr1NSnEhv T9qmE7PR5maYx8Q0yJb3uosGaUB6qkJTqlz0djVKn7AaW73kJkqGPrpzI2885B0m4y4das vX8DIncfGuLrXO8X/lNdGk3o8/6kJcNeHDcyJNz9S+AK+/ZPytG2S9xXpKV6Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524648; 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=fgfl0exzEH0uqT6531klkkfU3qKatu+Xia4LJN80bX4=; b=WlWrIrh4D0dYg29YYZETAMz1nto+7nCJW8mtY345aFZWTHW8qu3WACz+dchYA9H1YyN/UB CJoADpOAjaZKbwEkNnF/hLYfT23aBViNhiMceS2BgNJUbvtQX9Xemn+gWOSZiK1umhbW3Z pzyb7g85VrrdKJ3FNit4PFFgGMIl9t3FfDPFSQgZrsqcwElD01qcJZIGaLexvsRal+n+tC BjQNAHgK6eswqXGJRaghVzBEtdqPXQMuscyxClxoMrjyv8bnLI7Voe43kTIkNTdUv25Kj1 Xk1IX8dmdkf35907T+bAif+rLX0DJC9s2wy6kQAf2grpt0XEBoVRsUDTl++yDw== 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 4WZXKz6Wp6zpLD; Thu, 1 Aug 2024 15:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471F47kc075047; Thu, 1 Aug 2024 15:04:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471F475l075044; Thu, 1 Aug 2024 15:04:07 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:04:07 GMT Message-Id: <202408011504.471F475l075044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 79853e40abd8 - stable/13 - OpenSSH: correct logic error in ObscureKeystrokeTiming List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 79853e40abd8a63bd53cbf4059032d7143c69300 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=79853e40abd8a63bd53cbf4059032d7143c69300 commit 79853e40abd8a63bd53cbf4059032d7143c69300 Author: Ed Maste AuthorDate: 2024-07-01 13:14:15 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:03:50 +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) (cherry picked from commit bf9a275b24f6655616cc691555fe1a36ed5e4338) --- 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++; }