commit:     fdc9882838209d6a427031ad87a79fa18a443851
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  7 04:54:04 2016 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Sep  7 04:54:23 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdc98828

net-misc/openssh: Add a workaround to HPN for the OSX threading implemntation

The MT AES-CTR has a section of code that compares the currently running 
thread's
thread id with the first thread created. It seems on OSX, the first thread will
sometimes run before the thread ID is filled in (hence is zero), so this test
will fail, and the initialization code does not get run. This makes the test
also check if the thread ID of the first thread is 0, and run the initialization
code in that case as well.

Package-Manager: portage-2.3.0

 net-misc/openssh/files/openssh-7.3_p1-hpn-update.patch | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/net-misc/openssh/files/openssh-7.3_p1-hpn-update.patch 
b/net-misc/openssh/files/openssh-7.3_p1-hpn-update.patch
index 980a666..8ae29e1 100644
--- a/net-misc/openssh/files/openssh-7.3_p1-hpn-update.patch
+++ b/net-misc/openssh/files/openssh-7.3_p1-hpn-update.patch
@@ -1,5 +1,5 @@
 --- openssh-7_2_P2-hpn-14.10.diff.orig 2016-09-01 10:34:05.905112131 -0700
-+++ openssh-7_2_P2-hpn-14.10.diff      2016-09-06 19:35:24.308215237 -0700
++++ openssh-7_2_P2-hpn-14.10.diff      2016-09-06 21:49:35.583704017 -0700
 @@ -156,145 +156,6 @@
        compat.o crc32.o deattack.o fatal.o hostfile.o \
        log.o match.o md-sha256.o moduli.o nchan.o packet.o opacket.o \
@@ -155,6 +155,15 @@
  +/*
  + * OpenSSH Multi-threaded AES-CTR Cipher
  + *
+@@ -737,7 +598,7 @@
+ +      * Handle the special case of startup, one thread must fill
+ +      * the first KQ then mark it as draining. Lock held throughout.
+ +      */
+-+     if (pthread_equal(pthread_self(), c->tid[0])) {
+++     if (pthread_equal(pthread_self(), c->tid[0]) || c->tid[0] == 0) {
+ +             q = &c->q[0];
+ +             pthread_mutex_lock(&q->lock);
+ +             if (q->qstate == KQINIT) {
 @@ -790,6 +651,7 @@
  +              * can see that it's being filled.
  +              */

Reply via email to