[openssl.org #3202] Request to remove _sparcv9_random

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[openssl.org #3202] Request to remove _sparcv9_random

Rich Salz via RT
Hi,

We don't have RNG instructions, and calling _sparcv9_random() causes
SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
loaded (at _init()).
% mdb `which openssl`
 > ::run
mdb: stop on SIGILL
mdb: target stopped at:
libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8


Without those debugging tools, it's very hard to do any debugging, and
we would like the call to be removed.

The following suggested fix seems to fix the problem we are having with
the debugging tools.


*--- sparc_arch.h.orig   Thu Dec 19 14:37:27 2013
+++ sparc_arch.h        Thu Dec 19 14:37:45 2013*
@@ -8,7 +8,6 @@
  #define        SPARCV9_FMADD           (1<<4)  /* reserved for SPARC64
V */
  #define        SPARCV9_BLK             (1<<5)  /* VIS1 block copy */
  #define        SPARCV9_VIS3            (1<<6)
-#define        SPARCV9_RANDOM          (1<<7)
  #define        SPARCV9_64BIT_STACK     (1<<8)

  /*

*--- sparccpuid.S.orig     Thu Dec 19 14:34:25 2013
+++ sparccpuid.S        Thu Dec 19 14:34:25 2013*
@@ -341,14 +341,6 @@
  .type  _sparcv9_vis3_probe,#function
  .size  _sparcv9_vis3_probe,.-_sparcv9_vis3_probe

-.global        _sparcv9_random
-.align 8
-_sparcv9_random:
-       retl
-       .word   0x91b002a0      !random %o0
-.type  _sparcv9_random,#function
-.size  _sparcv9_random,.-_sparcv9_vis3_probe
-
  .global        OPENSSL_cleanse
  .align 32
  OPENSSL_cleanse:

*--- sparcv9cap.c.orig     Thu Dec 19 14:34:25 2013
+++ sparcv9cap.c        Thu Dec 19 14:34:25 2013*
@@ -62,7 +62,6 @@
  void           _sparcv9_fmadd_probe(void);
  unsigned long  _sparcv9_rdcfr(void);
  void           _sparcv9_vis3_probe(void);
-unsigned long  _sparcv9_random(void);
  #ifndef _BOOT
  size_t         _sparcv9_vis1_instrument_bus(unsigned int *,size_t);
  size_t         _sparcv9_vis1_instrument_bus2(unsigned int
*,size_t,size_t);
@@ -305,12 +304,6 @@
                 OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3;
                 }

-       if (sigsetjmp(common_jmp,1) == 0)
-               {
-               (void)_sparcv9_random();
-               OPENSSL_sparcv9cap_P[0] |= SPARCV9_RANDOM;
-               }
-
         /*
          * In wait for better solution _sparcv9_rdcfr is masked by
          * VIS3 flag, because it goes to uninterruptable endless



Thank you

-- misaki


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

David Miller-13
From: "Misaki.Miyashita via RT" <[hidden email]>
Date: Fri, 20 Dec 2013 06:59:18 +0100

> Hi,
>
> We don't have RNG instructions, and calling _sparcv9_random() causes
> SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
> loaded (at _init()).
> % mdb `which openssl`
>  > ::run
> mdb: stop on SIGILL
> mdb: target stopped at:
> libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8

Do not do this, the instruction is valid and we'd like to detect
the presence of it on chips that actually have it.

We use SIGILL sequence to detect presence for all crypto instructions,
so if your logic would apply to all of the instructions we try to
detect.

This is the standard way that openssl probes for instruction
presence.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Rich Salz via RT
From: "Misaki.Miyashita via RT" <[hidden email]>
Date: Fri, 20 Dec 2013 06:59:18 +0100

> Hi,
>
> We don't have RNG instructions, and calling _sparcv9_random() causes
> SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
> loaded (at _init()).
> % mdb `which openssl`
>  > ::run
> mdb: stop on SIGILL
> mdb: target stopped at:
> libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8

Do not do this, the instruction is valid and we'd like to detect
the presence of it on chips that actually have it.

We use SIGILL sequence to detect presence for all crypto instructions,
so if your logic would apply to all of the instructions we try to
detect.

This is the standard way that openssl probes for instruction
presence.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Rich Salz via RT
In reply to this post by David Miller-13
On Fri, Dec 20, 2013 at 01:29:39PM -0500, David Miller wrote:

> From: "Misaki.Miyashita via RT" <[hidden email]>
> Date: Fri, 20 Dec 2013 06:59:18 +0100
>
> > Hi,
> >
> > We don't have RNG instructions, and calling _sparcv9_random() causes
> > SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
> > loaded (at _init()).
> > % mdb `which openssl`
> >  > ::run
> > mdb: stop on SIGILL
> > mdb: target stopped at:
> > libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8
>
> Do not do this, the instruction is valid and we'd like to detect
> the presence of it on chips that actually have it.
>
> We use SIGILL sequence to detect presence for all crypto instructions,
> so if your logic would apply to all of the instructions we try to
> detect.
>
> This is the standard way that openssl probes for instruction
> presence.

I keep running into people having this problem when trying to
debug something.  Maybe this should get added to the FAQ?


Kurt


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Dan Anderson-8
In reply to this post by David Miller-13
On 12/20/2013 10:29 AM, David Miller wrote:

> From: "Misaki.Miyashita via RT" <[hidden email]>
> Date: Fri, 20 Dec 2013 06:59:18 +0100
>
>> Hi,
>>
>> We don't have RNG instructions, and calling _sparcv9_random() causes
>> SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
>> loaded (at _init()).
>> % mdb `which openssl`
>>   > ::run
>> mdb: stop on SIGILL
>> mdb: target stopped at:
>> libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8
> Do not do this, the instruction is valid and we'd like to detect
> the presence of it on chips that actually have it.f

David,

I think we need to clarify why this should be done. The SPARC "random"
instruction was designed at Sun Microsystems (now Oracle Corporation)
for a never-released processor several years ago. For SPARC, randomness
is obtained by reading a special control register. The SPARC "random"
instruction was never implemented and never will be implemented. Please
remove code to detect this instruction. Thanks!

Dan


>
> We use SIGILL sequence to detect presence for all crypto instructions,
> so if your logic would apply to all of the instructions we try to
> detect.
>
> This is the standard way that openssl probes for instruction
> presence.
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [hidden email]
> Automated List Manager                           [hidden email]


--
uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1 858-526-9418

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Dan Anderson-8
On 12/21/2013 5:54 PM, Dan Anderson wrote:

> On 12/20/2013 10:29 AM, David Miller wrote:
>> From: "Misaki.Miyashita via RT" <[hidden email]>
>> Date: Fri, 20 Dec 2013 06:59:18 +0100
>>
>>> Hi,
>>>
>>> We don't have RNG instructions, and calling _sparcv9_random() causes
>>> SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
>>> loaded (at _init()).
>>> % mdb `which openssl`
>>>   > ::run
>>> mdb: stop on SIGILL
>>> mdb: target stopped at:
>>> libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8
>> Do not do this, the instruction is valid and we'd like to detect
>> the presence of it on chips that actually have it.f
>
> David,
>
> I think we need to clarify why this should be done. The SPARC "random"
> instruction was designed at Sun Microsystems (now Oracle Corporation)
> for a never-released processor several years ago. For SPARC,
> randomness is obtained by reading a special control register. The
> SPARC "random" instruction was never implemented and never will be
> implemented. Please remove code to detect this instruction. Thanks!
>
> Dan

P.S., as a separate issue, please consider using the Solaris getisax(2)
to determine SPARC processor features.

Dan

>
>
>>
>> We use SIGILL sequence to detect presence for all crypto instructions,
>> so if your logic would apply to all of the instructions we try to
>> detect.
>>
>> This is the standard way that openssl probes for instruction
>> presence.
>> ______________________________________________________________________
>> OpenSSL Project http://www.openssl.org
>> Development Mailing List [hidden email]
>> Automated List Manager [hidden email]
>
>


--
uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1 858-526-9418

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Rich Salz via RT
In reply to this post by Dan Anderson-8
On 12/20/2013 10:29 AM, David Miller wrote:

> From: "Misaki.Miyashita via RT" <[hidden email]>
> Date: Fri, 20 Dec 2013 06:59:18 +0100
>
>> Hi,
>>
>> We don't have RNG instructions, and calling _sparcv9_random() causes
>> SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
>> loaded (at _init()).
>> % mdb `which openssl`
>>   > ::run
>> mdb: stop on SIGILL
>> mdb: target stopped at:
>> libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8
> Do not do this, the instruction is valid and we'd like to detect
> the presence of it on chips that actually have it.f

David,

I think we need to clarify why this should be done. The SPARC "random"
instruction was designed at Sun Microsystems (now Oracle Corporation)
for a never-released processor several years ago. For SPARC, randomness
is obtained by reading a special control register. The SPARC "random"
instruction was never implemented and never will be implemented. Please
remove code to detect this instruction. Thanks!

Dan


>
> We use SIGILL sequence to detect presence for all crypto instructions,
> so if your logic would apply to all of the instructions we try to
> detect.
>
> This is the standard way that openssl probes for instruction
> presence.
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [hidden email]
> Automated List Manager                           [hidden email]


--
uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1 858-526-9418


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Rich Salz via RT
In reply to this post by Dan Anderson-8
On 12/21/2013 5:54 PM, Dan Anderson wrote:

> On 12/20/2013 10:29 AM, David Miller wrote:
>> From: "Misaki.Miyashita via RT" <[hidden email]>
>> Date: Fri, 20 Dec 2013 06:59:18 +0100
>>
>>> Hi,
>>>
>>> We don't have RNG instructions, and calling _sparcv9_random() causes
>>> SIGILL and debug tools (i.e. gdb and mdb) stops when libcrypto.so is
>>> loaded (at _init()).
>>> % mdb `which openssl`
>>>   > ::run
>>> mdb: stop on SIGILL
>>> mdb: target stopped at:
>>> libcrypto.so.1.0.0`_sparcv9_random+4:   random    %d8
>> Do not do this, the instruction is valid and we'd like to detect
>> the presence of it on chips that actually have it.f
>
> David,
>
> I think we need to clarify why this should be done. The SPARC "random"
> instruction was designed at Sun Microsystems (now Oracle Corporation)
> for a never-released processor several years ago. For SPARC,
> randomness is obtained by reading a special control register. The
> SPARC "random" instruction was never implemented and never will be
> implemented. Please remove code to detect this instruction. Thanks!
>
> Dan

P.S., as a separate issue, please consider using the Solaris getisax(2)
to determine SPARC processor features.

Dan

>
>
>>
>> We use SIGILL sequence to detect presence for all crypto instructions,
>> so if your logic would apply to all of the instructions we try to
>> detect.
>>
>> This is the standard way that openssl probes for instruction
>> presence.
>> ______________________________________________________________________
>> OpenSSL Project http://www.openssl.org
>> Development Mailing List [hidden email]
>> Automated List Manager [hidden email]
>
>


--
uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1 858-526-9418


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

David Miller-13
In reply to this post by Dan Anderson-8
From: Dan Anderson <[hidden email]>
Date: Sat, 21 Dec 2013 17:54:52 -0800

> I think we need to clarify why this should be done. The SPARC "random"
> instruction was designed at Sun Microsystems (now Oracle Corporation)
> for a never-released processor several years ago. For SPARC,
> randomness is obtained by reading a special control register. The
> SPARC "random" instruction was never implemented and never will be
> implemented. Please remove code to detect this instruction. Thanks!

The patch was presented as a way to get rid of SIGILL dropping the
application into the debugger.

The same problem is going to exist if people run this library on
chips without the crypto instructions, or other ones we check for.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Rich Salz via RT
From: Dan Anderson <[hidden email]>
Date: Sat, 21 Dec 2013 17:54:52 -0800

> I think we need to clarify why this should be done. The SPARC "random"
> instruction was designed at Sun Microsystems (now Oracle Corporation)
> for a never-released processor several years ago. For SPARC,
> randomness is obtained by reading a special control register. The
> SPARC "random" instruction was never implemented and never will be
> implemented. Please remove code to detect this instruction. Thanks!

The patch was presented as a way to get rid of SIGILL dropping the
application into the debugger.

The same problem is going to exist if people run this library on
chips without the crypto instructions, or other ones we check for.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

David Miller-13
In reply to this post by Dan Anderson-8
From: Dan Anderson <[hidden email]>
Date: Sat, 21 Dec 2013 17:57:02 -0800

> P.S., as a separate issue, please consider using the Solaris
> getisax(2) to determine SPARC processor features.

The SIGILL mechanism is portable and works on every OS, not
just Solaris.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Rich Salz via RT
From: Dan Anderson <[hidden email]>
Date: Sat, 21 Dec 2013 17:57:02 -0800

> P.S., as a separate issue, please consider using the Solaris
> getisax(2) to determine SPARC processor features.

The SIGILL mechanism is portable and works on every OS, not
just Solaris.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Dan Anderson-8
In reply to this post by Rich Salz via RT
On 12/21/2013 7:07 PM, David Miller via RT wrote:

> From: Dan Anderson <[hidden email]>
> Date: Sat, 21 Dec 2013 17:54:52 -0800
>
>> I think we need to clarify why this should be done. The SPARC "random"
>> instruction was designed at Sun Microsystems (now Oracle Corporation)
>> for a never-released processor several years ago. For SPARC,
>> randomness is obtained by reading a special control register. The
>> SPARC "random" instruction was never implemented and never will be
>> implemented. Please remove code to detect this instruction. Thanks!
> The patch was presented as a way to get rid of SIGILL dropping the
> application into the debugger.

True, but forget this for the sake of argument.

> The same problem is going to exist if people run this library on
> chips without the crypto instructions, or other ones we check for.

You are checking for a SPARC instruction that was never implemented, is
not on any SPARC processor, and never will exist.

All I'm suggesting is to not check for this instruction.

Dan

>
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [hidden email]
> Automated List Manager                           [hidden email]


--
uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1 858-526-9418

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Peter Waltenberg

FWIW. We have a similar problem on AIX with the capability probes there. The debugger has an 'ignore' option - which allows us to bypass the sigill traps.

I can understand the logic of not probing for an instruction that'll never exist, but some archictectures you WILL hit this problem as there's no other way to do capability probes in user space code. All you can do there is hope the debugger has some way of coping.

Peter 



-----[hidden email] wrote: -----
To: David Miller <[hidden email]>
From: Dan Anderson
Sent by: [hidden email]
Date: 12/22/2013 03:37PM
Cc: [hidden email]
Subject: Re: [openssl.org #3202] Request to remove _sparcv9_random

On 12/21/2013 7:07 PM, David Miller via RT wrote:

> From: Dan Anderson <[hidden email]>
> Date: Sat, 21 Dec 2013 17:54:52 -0800
>
>> I think we need to clarify why this should be done. The SPARC "random"
>> instruction was designed at Sun Microsystems (now Oracle Corporation)
>> for a never-released processor several years ago. For SPARC,
>> randomness is obtained by reading a special control register. The
>> SPARC "random" instruction was never implemented and never will be
>> implemented. Please remove code to detect this instruction. Thanks!
> The patch was presented as a way to get rid of SIGILL dropping the
> application into the debugger.

True, but forget this for the sake of argument.

> The same problem is going to exist if people run this library on
> chips without the crypto instructions, or other ones we check for.

You are checking for a SPARC instruction that was never implemented, is
not on any SPARC processor, and never will exist.

All I'm suggesting is to not check for this instruction.

Dan

>
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [hidden email]
> Automated List Manager                           [hidden email]


--
uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1 858-526-9418

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]

______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [hidden email] Automated List Manager [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Misaki Miyashita
In reply to this post by Rich Salz via RT
Sorry for the late reply.

Checking for chip capabilities by calling an invalid instruction causes an issue especially when people run debugger with an OpenSSL application.

That can be easily avoided by calling getisax(2) for SPARC, as Dan Anderson noted.

Please consider determining the chip capabilities for SPARC by calling getisax(2) instead of causing and catching SIGILL.
(For RNG, we'll never support the random instruction, and it can be just removed).

Thank you

-- misaki


----- [hidden email] wrote:

> On 12/21/2013 7:07 PM, David Miller via RT wrote:
> > From: Dan Anderson <[hidden email]>
> > Date: Sat, 21 Dec 2013 17:54:52 -0800
> >
> >> I think we need to clarify why this should be done. The SPARC
> "random"
> >> instruction was designed at Sun Microsystems (now Oracle
> Corporation)
> >> for a never-released processor several years ago. For SPARC,
> >> randomness is obtained by reading a special control register. The
> >> SPARC "random" instruction was never implemented and never will be
> >> implemented. Please remove code to detect this instruction.
> Thanks!
> > The patch was presented as a way to get rid of SIGILL dropping the
> > application into the debugger.
>
> True, but forget this for the sake of argument.
>
> > The same problem is going to exist if people run this library on
> > chips without the crypto instructions, or other ones we check for.
>
> You are checking for a SPARC instruction that was never implemented,
> is
> not on any SPARC processor, and never will exist.
>
> All I'm suggesting is to not check for this instruction.
>
> Dan
>
> >
> >
> >
> ______________________________________________________________________
> > OpenSSL Project                                
> http://www.openssl.org
> > Development Mailing List                      
> [hidden email]
> > Automated List Manager                          
> [hidden email]
>
>
> --
> uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1
> 858-526-9418
>
> ______________________________________________________________________
> OpenSSL Project                                
> http://www.openssl.org
> Development Mailing List                      
> [hidden email]
> Automated List Manager                           [hidden email]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

David Miller-13
From: Misaki Miyashita <[hidden email]>
Date: Thu, 26 Dec 2013 15:11:49 -0800 (PST)

> Checking for chip capabilities by calling an invalid instruction
> causes an issue especially when people run debugger with an OpenSSL
> application.

As has already been discussed in this thread, that's a debugger
problem.

> Please consider determining the chip capabilities for SPARC by
> calling getisax(2) instead of causing and catching SIGILL.  (For
> RNG, we'll never support the random instruction, and it can be just
> removed).

Again, as already discussed in this thread, the SIGILL technique
is portable across all operating systems, whereas getisax() is
not.

I really think you should work on getting the debugger to cope with
this SIGILL signal cleanly, rather than continuing to beat a dead
horse here.  This technique is quite common across libraries that
need to test for cpu instruction availability.

Thank you.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Valerie Anne Bubb Fenwick
On 12/26/13 3:29 PM, David Miller wrote:

> From: Misaki Miyashita <[hidden email]>
> Date: Thu, 26 Dec 2013 15:11:49 -0800 (PST)
>
>> Checking for chip capabilities by calling an invalid instruction
>> causes an issue especially when people run debugger with an OpenSSL
>> application.
>
> As has already been discussed in this thread, that's a debugger
> problem.
>
>> Please consider determining the chip capabilities for SPARC by
>> calling getisax(2) instead of causing and catching SIGILL.  (For
>> RNG, we'll never support the random instruction, and it can be just
>> removed).
>
> Again, as already discussed in this thread, the SIGILL technique
> is portable across all operating systems, whereas getisax() is
> not.
>
> I really think you should work on getting the debugger to cope with
> this SIGILL signal cleanly, rather than continuing to beat a dead
> horse here.  This technique is quite common across libraries that
> need to test for cpu instruction availability.

Hi David -

both Dan and Misaki have noted, though, that this specific SPARC
instruction OpenSSL is checking for never existed and will never
exist in any SPARC chipset that Sun/Oracle shipped.  Could we at
least remove that check?  That capability does not and will not
exist, so it seems a waste of cycles to check (and confuses users,
we get lots of questions about this specific instruction and
why it doesn't work or which platform it should work on)

Does that make sense?  thanks!


Valerie

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

David Miller-13
From: Valerie Anne Bubb Fenwick <[hidden email]>
Date: Thu, 26 Dec 2013 15:46:42 -0800

> both Dan and Misaki have noted, though, that this specific SPARC
> instruction OpenSSL is checking for never existed and will never
> exist in any SPARC chipset that Sun/Oracle shipped.  Could we at
> least remove that check?  That capability does not and will not
> exist, so it seems a waste of cycles to check (and confuses users,
> we get lots of questions about this specific instruction and
> why it doesn't work or which platform it should work on)
>
> Does that make sense?  thanks!

I'm against this on fundamental grounds, you are just pushing the
problem around rather than truly fixing the issue.

I know what you want, you want the SIGILL to not happen on the systems
you most care about, and this is how you're going to go about doing it
rather than solving this issue at it's core.  In the debugger.

That's really distasteful to me.  Please fix things properly, rather
than chase after a scarecrow like this random instruction.

Thank you.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Valerie Anne Bubb Fenwick
On 12/26/13 8:03 PM, David Miller wrote:

> From: Valerie Anne Bubb Fenwick <[hidden email]>
> Date: Thu, 26 Dec 2013 15:46:42 -0800
>
>> both Dan and Misaki have noted, though, that this specific SPARC
>> instruction OpenSSL is checking for never existed and will never
>> exist in any SPARC chipset that Sun/Oracle shipped.  Could we at
>> least remove that check?  That capability does not and will not
>> exist, so it seems a waste of cycles to check (and confuses users,
>> we get lots of questions about this specific instruction and
>> why it doesn't work or which platform it should work on)
>>
>> Does that make sense?  thanks!
>
> I'm against this on fundamental grounds, you are just pushing the
> problem around rather than truly fixing the issue.
>
> I know what you want, you want the SIGILL to not happen on the systems
> you most care about, and this is how you're going to go about doing it
> rather than solving this issue at it's core.  In the debugger.
>
> That's really distasteful to me.  Please fix things properly, rather
> than chase after a scarecrow like this random instruction.

Hi David -

I'm sorry, that is not my intent. We really do get frequent questions about
this and it confuses users (who on one occasion at least tried to add the
instruction to other programs that used this as an example). This has been
popping up more lately, not sure why. These things seem to come in waves.

We can of course file bugs against the known impacted debuggers as
well as we get reports.  Obviously, we don't control those source bases,
but we are happy to make suggestions and file bugs as we come across
issues.  I will make sure the bugs get filed.

I now understand your concerns with wanting keep the code portable
in the most straight forward way, thank you for taking the time
to explain that portion of our initial request.

I hope that makes more sense, I am sorry I was not more clear with my
first message.  Does that make more sense?

Valerie



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3202] Request to remove _sparcv9_random

Dan Anderson-8
In reply to this post by David Miller-13
On 12/26/13 08:03 PM, David Miller wrote:

> From: Valerie Anne Bubb Fenwick <[hidden email]>
> Date: Thu, 26 Dec 2013 15:46:42 -0800
>
>> both Dan and Misaki have noted, though, that this specific SPARC
>> instruction OpenSSL is checking for never existed and will never
>> exist in any SPARC chipset that Sun/Oracle shipped.  Could we at
>> least remove that check?  That capability does not and will not
>> exist, so it seems a waste of cycles to check (and confuses users,
>> we get lots of questions about this specific instruction and
>> why it doesn't work or which platform it should work on)
>>
>> Does that make sense?  thanks!
> I'm against this on fundamental grounds, you are just pushing the
> problem around rather than truly fixing the issue.
>
> I know what you want, you want the SIGILL to not happen on the systems
> you most care about, and this is how you're going to go about doing it
> rather than solving this issue at it's core.  In the debugger.
>
> That's really distasteful to me.  Please fix things properly, rather
> than chase after a scarecrow like this random instruction.
Hi David,

I really don't understand the desire to preserve dead, never-used code
in OpenSSL. The SPARC random instruction doesn't exist, OpenSSL never
used it and never can use it, but you don't want to remove the check for
it. It seems silly to me.

Dan




--
uosบǝpuɐ uɐp [hidden email], Oracle Solaris, San Diego, +1 858-526-9418



smime.p7s (5K) Download Attachment
12