From nobody Mon Jul 15 18:45:41 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 4WNB3T3Mqpz5RSDc; Mon, 15 Jul 2024 18:45:41 +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 4WNB3T2v78z4Q7N; Mon, 15 Jul 2024 18:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721069141; 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=LKXLZyxcmIlaq/41bjkKldpUvYzmuWaFM8c9v6fdA5A=; b=SgAvNfgffeHofxHiV1RFBqf4nI929CXvUmm0RPNej0d25AnIqfuiPQK9W1YO6jWX1Tgsa+ WeV+9uaGKJ8hbi+l2BMtkRuDlD3cbzbEaXQCoUdB4j49Mr1LNpyvVCOt6ReW4v0IB7osU7 8QS05Ommtw4UAg5a8/2d1MxAtnRhKCPDp9oeKULWKNp2aK2xvp9GFONmlgowW8o0uaPRs+ i+o0389aKTPIkL7JUjUoLVT6PSAjWlbXz3O0/fhyzv/4DGgIK/zkTbXi8ou/o3mw5aPrYy X8RgkVa4RzA4C1BN2P7boo10WUGrshbz85LWGVPsKZj4yfLqsfs8I6SOZBixVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721069141; a=rsa-sha256; cv=none; b=sriIMlnkJEmE0DiP99wDDuXYiIscfvGDDuPHwtRi7VvemOngBDFoGnG2r3fkqKJRdp6Lnu PBkvK3kK1zOs4E2Ei+AYxVhcWlYE4lzNcpXpYdUax7Wyu6ombp4lHWCCNzCWVjB6tWSNWR nmEB0fFxY5ZFdGP2O3Qw3FQ8qZDDYQMcfyUFa01LccCreXnW0X/+4hFWJ//AFrwQYS6bi+ Pmb+GTXMERKl9KDXq/xFU/YFSrzHk7LbpVB4ZVwDqiF7lQw8LlVs/XF4u9aLlQTLb+Zi0s L2jnhKvl+7qJgr9plBD9fxA+ZMsy408GtgkVPuHJ7tfdVdH0UPZqyW93vL1zHQ== 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=1721069141; 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=LKXLZyxcmIlaq/41bjkKldpUvYzmuWaFM8c9v6fdA5A=; b=Q3y/tOJcErCZKJZrhy7yM0axXZLOPTA9RqyTJ8QKt5dfaQY+3vjsrd6czdsYTLKHaXOrEv IVGP7IvxrGp38nVJuZTKchtgli1PfYyLNF2VuFySQ1xhE9eLuRwSYZODif1eiZ2sca5/A0 BHY9clhsyA7Q0hwhe1vgiFK3Bq6yWmThH0oAjmDYpwfePPzLQ13kfTcNhArEtxgKr+R+nH GbRfU08mgxroPec6vWf1y3Pa6vwsPIlmxOpKfMRZFRmB68t5iNzyoAmOVrVIsOAIhgG6wD YdH0kRPXuy5x3WTt1JPQprYIWLz50Wfc5GymuG0mBTilo5re7rZmq9gUEm5OKA== 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 4WNB3T2N7Kz13jl; Mon, 15 Jul 2024 18:45:41 +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 46FIjf47087293; Mon, 15 Jul 2024 18:45:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FIjfsB087290; Mon, 15 Jul 2024 18:45:41 GMT (envelope-from git) Date: Mon, 15 Jul 2024 18:45:41 GMT Message-Id: <202407151845.46FIjfsB087290@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: bf9a275b24f6 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: bf9a275b24f6655616cc691555fe1a36ed5e4338 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bf9a275b24f6655616cc691555fe1a36ed5e4338 commit bf9a275b24f6655616cc691555fe1a36ed5e4338 Author: Ed Maste AuthorDate: 2024-07-01 13:14:15 +0000 Commit: Ed Maste 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++; }