From nobody Fri Apr 15 15:05:10 2022 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 6B6ED5D206B; Fri, 15 Apr 2022 15:05:10 +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 4Kg04Q2Z2jz585J; Fri, 15 Apr 2022 15:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650035110; 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=bmQytfSnWx3q8kk8CoCfsMrqP3u/xfxTQhN5sKDX1Qo=; b=JMHSXyh0OxTJMdcamcLbCWlO/4B3lmK5Wc7yNyJWlri6S9MR1kw1UHJ7IVdJXKeYOx9CFi slTKk/GB6AjO+PzizeaZfu5POu2QNubZcvVSJ5OKgi+TfGB7bocKfnsDiAJEYlsv/i7MVF FzR5hNE+ydGcQ6+prU1kJ2ZU4vMWzjYy5jbrdHoC5cQ3tiF2nUOHTGCyzcKf+wdUwqJZgy Zb+g/eKpXOdPmX5EjPV9R6TPxWlFXvx4BECBeQUTd4EDiL3hcTx1SOX56J6i0bJeqdoS6p Z7r10j6+taZ4dfLyc6Uz+sLdTUg0+DHZ9LPtQVv+m51QD1/H7v51dzRHHir+Pg== 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 38C1A174C7; Fri, 15 Apr 2022 15:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23FF5ACC017701; Fri, 15 Apr 2022 15:05:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23FF5AxQ017700; Fri, 15 Apr 2022 15:05:10 GMT (envelope-from git) Date: Fri, 15 Apr 2022 15:05:10 GMT Message-Id: <202204151505.23FF5AxQ017700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9fce8d414037 - main - ssh: apply post-release patch from V_9_0 branch 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fce8d4140370ca8bc03d6a5668fb64a040c00fc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650035110; 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=bmQytfSnWx3q8kk8CoCfsMrqP3u/xfxTQhN5sKDX1Qo=; b=qqqewTa66d+U00kKRnUdfREQRDlBjNHc6ty6kpzG1skW7vpvHNidaUXP9Zvdf9qFfA8pDn 1PAhqIBHpeFKZarC5JN7169U5LG+zEWl5dZu26jpdQmcLWaALdlpwGoNaR0Q7ijQT+6h25 bf/yjJQJ0VVPCbVAnlOg5TzqEoFGE9QTKYHCrwIuNzL+/heKgpdwtOIZdG2J0sHuGtVUJJ i/XJ9TkRUHSuLhtx+8KJnxeG6UzlGZjQVygg8Px6PcwLhNWU9+XFTrIlsKW6Nz1Cvbu2s6 JXirKcViIysWUOUfx4xanJLSFULsZ8xAvwi1Km37LcanQwL8yIrM82cZJVigMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650035110; a=rsa-sha256; cv=none; b=s/g0Np7a6dq6zbFH3+LGsaynfHSGvybVKOlflk1UDY5w985Z2tsybTW/7k36/7l5rULffk UGCuAE+BHNjWIq0NYF1IhcxmmK9SKoBx2CAeAnPGOaYxNwkUMvEa2ImV1td8bkkLhnhote sLe3p5gjJYRZ7FJvj3Ak8ZF18REO/zAxmInOhb9U/9yiL8JEG/GLdh7kxs7lUvETQNWcXR sdxWJutu7nM3PqWfNMU2aDEkCcY7Gl0RY/TPSWHKPZbt7xdh6VYKm9UWC2rCcaGx+ejdTK s8TT4LiEfuB537IjG4sgb27UI5tZTHBshWQ7al4DjDb7QCq92Nvx3I3297IbnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9fce8d4140370ca8bc03d6a5668fb64a040c00fc commit 9fce8d4140370ca8bc03d6a5668fb64a040c00fc Author: Ed Maste AuthorDate: 2022-04-15 15:03:08 +0000 Commit: Ed Maste CommitDate: 2022-04-15 15:04:54 +0000 ssh: apply post-release patch from V_9_0 branch upstream: clear io_want/io_ready flags at start of poll() cycle; avoids plausible spin during rekeying if channel io_want flags are reused across cycles. ok markus@ deraadt@ --- crypto/openssh/channels.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/channels.c b/crypto/openssh/channels.c index ee3c787922fb..d47af7911f04 100644 --- a/crypto/openssh/channels.c +++ b/crypto/openssh/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.415 2022/03/30 21:10:25 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.416 2022/04/11 22:52:08 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2601,7 +2601,12 @@ channel_prepare_poll(struct ssh *ssh, struct pollfd **pfdp, u_int *npfd_allocp, u_int i, oalloc, p, npfd = npfd_reserved; channel_before_prepare_io(ssh); /* might create a new channel */ - + /* clear out I/O flags from last poll */ + for (i = 0; i < sc->channels_alloc; i++) { + if (sc->channels[i] == NULL) + continue; + sc->channels[i]->io_want = sc->channels[i]->io_ready = 0; + } /* Allocate 4x pollfd for each channel (rfd, wfd, efd, sock) */ if (sc->channels_alloc >= (INT_MAX / 4) - npfd_reserved) fatal_f("too many channels"); /* shouldn't happen */