Bug 114610
Summary: | gcc 3.2.3-24 miscompiles sha256.c from linux 2.6 kernel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Richard Chan <rc556677> | ||||||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | |||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 3.0 | CC: | jmorris | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | i686 | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2004-05-12 03:40:21 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Richard Chan
2004-01-30 03:50:11 UTC
Created attachment 97356 [details]
sha256.c from kernel 2.6.2-rc2 compilable in userspace with -DMAIN
This file is taken from linux 2.6.2-rc2/crypto/sha256.c
I have edited it to be compilable in user space and included the test vectors
from tcrypt.h
Created attachment 97357 [details]
Test vectors header file
Created attachment 97358 [details]
typedef header file
I think http://gcc.gnu.org/ml/gcc-patches/2004-01/msg03233.html with http://gcc.gnu.org/ml/gcc-patches/2004-01/msg03272.html backported to gcc-3_2-rhl8-branch (and gcc-3_3-rhl-branch and gcc-3_4-branch) should fix it, but I'd like to give that patch a week or two testing on the mainline first. Likely http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01602.html needs to be backported as well. On the other side, sha256.c in the kernel should be fixed because it is unnecessary inefficient. Replacing const u8 padding[64] = { 0x80, }; with static const u8 padding[64] = { 0x80, }; should do the job. Without that, padding needs to be memset'ed every time the routine is run, not to mention that kernel should not waste precious kernel stack space. Thanks for the info on the padding, I'll submit that upstream and also look for any similar code. Source code patch (linux-kernel list) by jmorris does indeed workaround the problem for this file. But I guess the real fix will have to wait for the next 3ES update to the gcc package. Should be fixed in gcc-3.2.3-28. An errata has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2004-142.html |