Skip to content

Commit 783d8b2

Browse files
authored
Merge pull request #83 from rapier1/release_candidates
Official Release of 18.4.1
2 parents 4aa6f04 + bd7ad03 commit 783d8b2

21 files changed

+107
-167
lines changed

.github/workflows/cifuzz.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
name: CIFuzz
22
on:
33
push:
4-
branches: [master, pre-stage]
4+
branches: [master, dev_minor, dev_major, release_candidates]
55
paths: [ '**.c', '**.h', '**.m4', '**.sh', '.github/**', '**/Makefile.in', 'configure.ac' ]
66
pull_request:
77
paths: [ '**.c', '**.h', '**.m4', '**.sh', '.github/**', '**/Makefile.in', 'configure.ac' ]
88

99
jobs:
1010
Fuzzing:
11-
if: github.repository != 'rapier1/openssh-portable-selfhosted'
11+
if: github.repository != 'rapier1/hpn-ssh-selfhosted'
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Build Fuzzers
1515
id: build
1616
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
1717
with:
18-
oss-fuzz-project-name: 'openssh'
18+
oss-fuzz-project-name: 'hpn-ssh'
1919
dry-run: false
2020
language: c++
2121
- name: Run Fuzzers
2222
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
2323
with:
24-
oss-fuzz-project-name: 'openssh'
24+
oss-fuzz-project-name: 'hpn-ssh'
2525
fuzz-seconds: 600
2626
dry-run: false
2727
language: c++
@@ -30,4 +30,4 @@ jobs:
3030
if: failure() && steps.build.outcome == 'success'
3131
with:
3232
name: artifacts
33-
path: ./out/artifacts
33+
path: ./out/artifacts

channels.c

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,16 @@ channel_new(struct ssh *ssh, char *ctype, int type, int rfd, int wfd, int efd,
534534
(c->output = sshbuf_new()) == NULL ||
535535
(c->extended = sshbuf_new()) == NULL)
536536
fatal_f("sshbuf_new failed");
537+
538+
/* these buffers are important in terms of tracking channel
539+
* buffer usage so label and type them with descriptive names */
537540
sshbuf_relabel(c->input, "channel input");
541+
sshbuf_type(c->input, BUF_CHANNEL_INPUT);
538542
sshbuf_relabel(c->output, "channel output");
543+
sshbuf_type(c->output, BUF_CHANNEL_OUTPUT);
539544
sshbuf_relabel(c->extended, "channel extended");
545+
sshbuf_type(c->extended, BUF_CHANNEL_EXTENDED);
546+
540547
if ((r = sshbuf_set_max_size(c->input, CHAN_INPUT_MAX)) != 0)
541548
fatal_fr(r, "sshbuf_set_max_size");
542549
c->ostate = CHAN_OUTPUT_OPEN;
@@ -2401,40 +2408,20 @@ channel_check_window(struct ssh *ssh, Channel *c)
24012408
{
24022409
int r;
24032410

2404-
/* going back to a set denominator of 2. Prior versions had a
2405-
* dynamic denominator based on the size of the buffer. This may
2406-
* have been helpful in some situations but it isn't helping in
2407-
* the general case -cjr 6/30/23 */
24082411
if (c->type == SSH_CHANNEL_OPEN &&
24092412
!(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) &&
24102413
((c->local_window_max - c->local_window > c->local_maxpacket*3) ||
24112414
c->local_window < c->local_window_max/2) &&
24122415
c->local_consumed > 0) {
2413-
u_int addition = 0;
2416+
int addition = 0;
24142417
u_int32_t tcpwinsz = channel_tcpwinsz(ssh);
24152418
/* adjust max window size if we are in a dynamic environment
24162419
* and the tcp receive buffer is larger than the ssh window */
24172420
if (c->dynamic_window && (tcpwinsz > c->local_window_max)) {
2418-
if (c->hpn_buffer_limit) {
2419-
/* limit window growth to prevent buffer issues
2420-
* still not sure what is causing the buffer issues
2421-
* but it may be an issue with c->local_consumed not being
2422-
* handled properly in the cases of bottenecked IO to the
2423-
* wfd endpoint. This does have an impact on throughput
2424-
* as we're essentially maxing out local_window_max to
2425-
* half of the window size */
2426-
addition = (tcpwinsz/2 - c->local_window_max);
2427-
}
2428-
else {
2429-
/* aggressively grow the window */
2430-
addition = tcpwinsz - c->local_window_max;
2431-
}
2421+
/* aggressively grow the window */
2422+
addition = tcpwinsz - c->local_window_max;
24322423
c->local_window_max += addition;
2433-
/* doesn't look like we need these
2434-
* sshbuf_set_window_max(c->output, c->local_window_max);
2435-
* sshbuf_set_window_max(c->input, c->local_window_max);
2436-
*/
2437-
debug("Channel %d: Window growth to %d by %d bytes",c->self,
2424+
debug_f("Channel %d: Window growth to %d by %d bytes",c->self,
24382425
c->local_window_max, addition);
24392426
}
24402427
if (!c->have_remote_id)

channels.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ struct Channel {
175175
u_int local_consumed;
176176
u_int local_maxpacket;
177177
int dynamic_window;
178-
int hpn_buffer_limit;
179178
int extended_usage;
180179
int single_connection;
181180
/* u_int tcpwinsz; */

clientloop.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,11 +2911,6 @@ client_session2_setup(struct ssh *ssh, int id, int want_tty, int want_subsystem,
29112911
if ((c = channel_lookup(ssh, id)) == NULL)
29122912
fatal_f("channel %d: unknown channel", id);
29132913

2914-
if (options.hpn_buffer_limit) {
2915-
debug_f("Limiting receive buffer size");
2916-
c->hpn_buffer_limit = 1;
2917-
}
2918-
29192914
ssh_packet_set_interactive(ssh, want_tty,
29202915
options.ip_qos_interactive, options.ip_qos_bulk);
29212916

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,12 +2883,12 @@ if test "x$openssl" = "xyes" ; then
28832883
*) ;; # Assume all other versions are good.
28842884
esac
28852885
;;
2886-
300*)
2886+
300*|301*|302*|303*)
28872887
# OpenSSL 3; we use the 1.1x API
28882888
CPPFLAGS="$CPPFLAGS -DOPENSSL_API_COMPAT=0x10100000L"
28892889
AC_DEFINE([WITH_OPENSSL3], [1], [With OpenSSL3])
28902890
;;
2891-
301*|302*|303*)
2891+
304*)
28922892
# OpenSSL development branch; request 1.1x API
28932893
CPPFLAGS="$CPPFLAGS -DOPENSSL_API_COMPAT=0x10100000L"
28942894
AC_DEFINE([WITH_OPENSSL3], [1], [With OpenSSL3])

hpnssh.1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ For full details of the options listed below, and their possible values, see
555555
.It HostKeyAlias
556556
.It Hostname
557557
.It HPNDisabled*
558-
.It HPNBufferLimit*
559558
.It IdentitiesOnly
560559
.It IdentityAgent
561560
.It IdentityFile

hpnssh_config.5

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,15 +1081,6 @@ In some situations, such as transfers on a local area network, the impact
10811081
of the HPN code produces a net decrease in performance. In these cases it is
10821082
helpful to disable the HPN functionality. By default HPNDisabled is set to
10831083
.Cm no. HPNSSH only.
1084-
.It Cm HPNBufferLimit
1085-
This option will force the hpnssh receive buffer to grow more slowly and limits
1086-
the growth to one half of the TCP receive buffer. This option can prove useful
1087-
in situation where a high speed path with larger RTTs are writing to a slower
1088-
device or file system. Enabling this option will reduce performance but may provide
1089-
a more stable connection. The option only impacts the receiving side of the connection.
1090-
For example, a client receiving data from a server but not a client sending data.
1091-
By default this option is set to
1092-
.Cm no. HPNSSH only.
10931084
.It Cm IdentitiesOnly
10941085
Specifies that
10951086
.Xr ssh 1

hpnsshd_config.5

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -890,16 +890,6 @@ In some situations, such as transfers on a local area network, the impact
890890
of the HPN code produces a net decrease in performance. In these cases it is
891891
helpful to disable the HPN functionality. By default HPNDisabled is set to
892892
.CM no.
893-
.It Cm HPNBufferLimit
894-
This option will force the hpnssh receive buffer to grow more slowly and limits
895-
the growth to one half of the TCP receive buffer. This option can prove useful
896-
in situation where a high speed path with larger RTTs are writing to a slower
897-
device or file system. Enabling this option will reduce performance but may provide
898-
a more stable connection. The option only impacts the receiving side of the connection.
899-
For example, a client receiving data from a server but not a client sending data. If
900-
enabled on a server this will impact all incoming connections.
901-
By default this option is set to
902-
.Cm no. HPNSSH only.
903893
.It Cm IgnoreRhosts
904894
Specifies whether to ignore per-user
905895
.Pa .rhosts

kex.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,9 +1041,11 @@ patch_list(char * orig)
10411041
int
10421042
kex_ready(struct ssh *ssh, char *proposal[PROPOSAL_MAX])
10431043
{
1044-
int r;
1044+
int r = 0;
10451045

10461046
#ifdef WITH_OPENSSL
1047+
char * orig_ctos = proposal[PROPOSAL_ENC_ALGS_CTOS];
1048+
char * orig_stoc = proposal[PROPOSAL_ENC_ALGS_STOC];
10471049
proposal[PROPOSAL_ENC_ALGS_CTOS] =
10481050
patch_list(proposal[PROPOSAL_ENC_ALGS_CTOS]);
10491051
proposal[PROPOSAL_ENC_ALGS_STOC] =
@@ -1057,11 +1059,18 @@ kex_ready(struct ssh *ssh, char *proposal[PROPOSAL_MAX])
10571059
#endif
10581060

10591061
if ((r = kex_prop2buf(ssh->kex->my, proposal)) != 0)
1060-
return r;
1062+
goto restoreProposal;
10611063
ssh->kex->flags = KEX_INITIAL;
10621064
kex_reset_dispatch(ssh);
10631065
ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_input_kexinit);
1064-
return 0;
1066+
restoreProposal:
1067+
#ifdef WITH_OPENSSL
1068+
free(proposal[PROPOSAL_ENC_ALGS_CTOS]);
1069+
free(proposal[PROPOSAL_ENC_ALGS_STOC]);
1070+
proposal[PROPOSAL_ENC_ALGS_CTOS] = orig_ctos;
1071+
proposal[PROPOSAL_ENC_ALGS_STOC] = orig_stoc;
1072+
#endif
1073+
return r;
10651074
}
10661075

10671076
int

packet.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,15 @@ ssh_alloc_session_state(void)
257257
(state->incoming_packet = sshbuf_new()) == NULL)
258258
goto fail;
259259
/* these buffers are important in terms of tracking buffer usage
260-
* so we explicitly label them with descriptive names */
260+
* so we explicitly label and type them with descriptive names */
261261
sshbuf_relabel(state->input, "input");
262+
sshbuf_type(state->input, BUF_PACKET_INPUT);
262263
sshbuf_relabel(state->incoming_packet, "inpacket");
264+
sshbuf_type(state->incoming_packet, BUF_PACKET_INCOMING);
263265
sshbuf_relabel(state->output, "output");
266+
sshbuf_type(state->output, BUF_PACKET_OUTPUT);
264267
sshbuf_relabel(state->outgoing_packet, "outpacket");
268+
sshbuf_type(state->outgoing_packet, BUF_PACKET_OUTGOING);
265269

266270
TAILQ_INIT(&state->outgoing);
267271
TAILQ_INIT(&ssh->private_keys);

0 commit comments

Comments
 (0)