Bug 775 - patches for Cray systems
Summary: patches for Cray systems
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: Other Other
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-17 12:46 AEDT by wendy palm
Modified: 2011-09-06 15:32 AEST (History)
1 user (show)

See Also:


Attachments
bsd-cray.c, bsd-cray.h, configure.ac, deattack.c patches (7.25 KB, patch)
2003-12-17 12:47 AEDT, wendy palm
no flags Details | Diff
cray deattack patch (926 bytes, patch)
2005-01-27 18:01 AEDT, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wendy palm 2003-12-17 12:46:27 AEDT
here are patches for openbsd-compat/bsd-cray.c, openbsd-compat/bsd-cray.h and
configure.ac cleaning up problems from someone prettifying the cray files,
additional variables added to configure and a typo of mine from the past for
deattack.c.
Comment 1 wendy palm 2003-12-17 12:47:52 AEDT
Created attachment 514 [details]
bsd-cray.c, bsd-cray.h, configure.ac, deattack.c patches

patches created from openssh-SNAP-20031216.tar.gz
Comment 2 Darren Tucker 2004-01-29 20:53:41 AEDT
Patch applied, apart from the deattack.c change (which needs further consideration).
Comment 3 Damien Miller 2004-02-10 12:12:59 AEDT
Could someone explain the deattack.c change to me? (in this bug, for posterity)
Comment 4 Damien Miller 2004-12-20 10:59:42 AEDT
10 months, no reply == closed bug
Comment 5 Mark D Baushke 2004-12-20 11:55:39 AEDT
#define HASH_ENTRYSIZE	(sizeof(u_int16_t))

is probably to UNICOS 9 doing something like this:

% cat h.c
#include <stdio.h>
typedef unsigned short u_int16_t;

u_int16_t h[40];

int
main (int argc, char *argv[])
{
        printf ("sizeof(u_int16_t) = %d\n", sizeof(u_int16_t));
        printf ("sizeof(h) = %d\n", sizeof(h));
        return 0;
}
% cc -o h h.c
% ./h
sizeof(u_int16_t) = 8
sizeof(h) = 320
%

Assumptions that filling only two bytes of hash for an unsigned short type is a bad one on
a cray (or at least on a Y-MP EL which was used to give the above information).

The reason to avoid memset is less clear to me. It could be that assumptions are being made
in the OpenSSH code that the upper bytes of the h[] array are zero instead of 0xffff. I have not
looked closely at that part of the OpenSSH code.
Comment 6 Darren Tucker 2005-01-08 10:42:44 AEDT
OK, that makes sense: later in the code the hash values are compared directly with 
"h[i] != HASH_UNUSED", where HASH_UNUSED is defined as 0xffff.

If sizeof(u_int16) == 8 (whoa!) and the array is filled with memset then the
array values will be 0xffffffffffffffff instead of 0xffff, so that obviously
won't work.

I think it would be OK to commit, but with "#if (SIZEOF_SHORT_INT != 2)" instead
of #ifdef _UNICOS".
Comment 7 Darren Tucker 2005-01-27 18:01:04 AEDT
Created attachment 789 [details]
cray deattack patch

Could someone with access to a Cray please test try this patch?
Comment 8 Damien Miller 2011-06-03 12:49:13 AEST
6 years with no followup == no bug. I guess nobody cares?
Comment 9 Damien Miller 2011-09-06 15:32:50 AEST
close resolved bugs now that openssh-5.9 has been released