public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: R Chan <rspchan@starhub.net.sg>
To: Dave Paris <dparis@w3works.com>
Cc: linux-kernel@vger.kernel.org, jmorris@redhat.com
Subject: Re: [CRYPTO]: Miscompiling sha256.c by gcc 3.2.3 and arch pentium3,4
Date: Fri, 30 Jan 2004 23:24:15 +0800	[thread overview]
Message-ID: <401A771F.7060300@starhub.net.sg> (raw)
In-Reply-To: <PLEIIGNDLGEDDKABPLHBAECPCHAA.dparis@w3works.com>

I've narrowed the problem - it seems to be a specific optimisation bug with
gcc-3.2.3-24 that comes with RedHat 3ES. The problem is not kernel 
related (sorry!)
as the guts of the file exhibits the same problem when compiled in user 
space.
(All the non-sha256 test vectors in tcrypt.ko pass BTW.)

The older gcc32 that comes with Fedora Cora 1 and the gcc33 there get it 
right.

For the actual files please check bug #114610 in 
https://bugzilla.redhat.com.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=114610
 - the bug report includes sha256.c, tcrypt.c, and types.h necessary to 
demonstrate
the problem in user space.





Dave Paris wrote:

>Has this been demonstrated on *any* system/arch using GCC 3.2.3 (or other
>3.2 series) or is it limited in scope to the description below?  Does it
>seem to do this with other implementations (other than sha256.c) or other
>kernels?  Just trying to get an idea if this is a complier optimization bug
>or something much more limited in scope.
>
>My personal lab is currently being unboxed and I won't be able to run my own
>tests for another week or so.  (apologies in advance)
>
>In any case, this is *extremely* serious from a number of angles.
>
>Kind Regards,
>-dsp
>
>-----Original Message-----
>From: linux-kernel-owner@vger.kernel.org
>[mailto:linux-kernel-owner@vger.kernel.org]On Behalf Of James Morris
>Sent: Friday, January 30, 2004 9:40 AM
>To: R CHAN
>Cc: linux-kernel@vger.kernel.org; David S. Miller
>Subject: Re: [CRYPTO]: Miscompiling sha256.c by gcc 3.2.3 and arch
>pentium3,4
>
>
>On Fri, 30 Jan 2004, R CHAN wrote:
>
>  
>
>>2.6.2-rc2 sha256.c is miscompiled with gcc 3.2.3.
>>(User space is RedHat 3ES.)
>>
>>Just an observation:
>>
>>gcc 3.2.3 is miscompiling sha256.c when using
>>-O2 -march=pentium3
>>or pentium4.
>>
>>gcc 3.3.x is ok, or the problem disappears
>>if I use arch=i686 or reduce the optimisation level to -O2.
>>
>>Sympthoms are all the sha256 test vectors fail.
>>If I extract the guts of the file to compile in user space
>>the same problem occurs.
>>    
>>
>
>Have you noticed if this happens for any of the other crypto algorithms?
>
>
>
>- James
>--
>James Morris
><jmorris@redhat.com>
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>
>
>
>
>  
>


  reply	other threads:[~2004-01-30 15:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-30  3:21 [CRYPTO]: Miscompiling sha256.c by gcc 3.2.3 and arch pentium3,4 R CHAN
2004-01-30 14:39 ` James Morris
2004-01-30 15:04   ` Dave Paris
2004-01-30 15:24     ` R Chan [this message]
2004-01-30 15:28     ` Jakub Jelinek
2004-01-30 16:35       ` James Morris
2004-01-30 17:14         ` Andy Isaacson
2004-01-30 19:49           ` Jakub Jelinek
2004-02-01 21:17             ` Bill Davidsen
2004-01-30 21:14         ` David S. Miller
2004-02-01 21:18           ` Bill Davidsen
2004-02-01 23:22             ` David S. Miller
2004-02-02  1:00             ` Linus Torvalds
2004-02-02 18:55               ` Bill Davidsen
2004-01-30 17:26       ` Jean-Luc Cooke
  -- strict thread matches above, loose matches on Subject: below --
2004-01-30 15:43 Arnd Bergmann
2004-01-30 16:57 ` James Morris
2004-01-30 18:02   ` Randy.Dunlap
2004-01-30 18:35     ` James Morris
2004-01-30 18:53       ` James Morris
2004-02-02  4:08 linux
2004-02-05 19:40 ` Jean-Luc Cooke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=401A771F.7060300@starhub.net.sg \
    --to=rspchan@starhub.net.sg \
    --cc=dparis@w3works.com \
    --cc=jmorris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox