NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-sparc/42273: SHA512_CTX struct not properly aligned
>Number: 42273
>Category: port-sparc
>Synopsis: SHA512_CTX struct not properly aligned
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: port-sparc-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Fri Nov 06 02:00:00 +0000 2009
>Originator: jon%bullers.net@localhost
>Release: NetBSD current (as of Oct 30, 2009)
>Organization:
>Environment:
System: NetBSD sparc release built on amd64 system, kernel 5.99.15
test code run in chroot area populated with a native built
release from sources checked out on Oct 30, 2009.
Architecture: sparc
Machine: sparc
>Description:
pkg_admin gets a bus error when downloading the vulnerabilities
file. gdb shows crash occured in SHA512_Final() Small test
case (near verbatim to example in man page) duplicates problem.
martin@ tracked the test case down to an alignment problem in
the SHA512_CTX struct allocation and usage. pkg_admin code
appears to allocate the struct exactly like the test case.
>How-To-Repeat:
#include <stdio.h>
#include <sys/types.h>
#include <sha1.h>
int main (int argc, char *argv[]) {
SHA1_CTX ctx;
uint8_t buf[27] = "abcdefghijklmnopqrstuvwxyz";
uint8_t result[20];
int i;
SHA1Init (&ctx);
SHA1Update (&ctx, buf, sizeof(buf));
SHA1Final (result, &ctx);
for (i = 0; i < 20; i++) {
printf ("%2.2x", result[i]);
}
printf ("\n");
}
>Fix:
martin@ said joerg@ has a fix for this ready, and to assign
this PR to joerg (if pr-bug people don't do it for me first)
Home |
Main Index |
Thread Index |
Old Index