public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101276] New: [i386] Keylocker output should be cleared when instruction reports runtime error.
@ 2021-07-01  3:24 wwwhhhyyy333 at gmail dot com
  2021-07-01  4:48 ` [Bug target/101276] " crazylht at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2021-07-01  3:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101276

            Bug ID: 101276
           Summary: [i386] Keylocker output should be cleared when
                    instruction reports runtime error.
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wwwhhhyyy333 at gmail dot com
  Target Milestone: ---

Some keylocker instruction will set ZF when runtime occurs, and the output data
should be invalid. 

Current intrinsic just copy the input data to output regardless of the ZF, like

 movdqa  k2(%rip), %xmm0
 aesdec128kl     h1(%rip), %xmm0
 sete    %al
 movups  %xmm0, k1(%rip)

It could bring safety issue that return the unencrypted data when runtime error
occurs. So the code should be like

        movdqa  k2(%rip), %xmm0
        aesdec128kl     h1(%rip), %xmm0
        je      .L4
.L2:
        sete    %al
        movups  %xmm0, k1(%rip)
        ret
.L4:
        pxor    %xmm0, %xmm0
        jmp     .L2

To clear the output data.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-02  7:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01  3:24 [Bug target/101276] New: [i386] Keylocker output should be cleared when instruction reports runtime error wwwhhhyyy333 at gmail dot com
2021-07-01  4:48 ` [Bug target/101276] " crazylht at gmail dot com
2021-07-01  7:19 ` rguenth at gcc dot gnu.org
2021-07-01  7:34 ` crazylht at gmail dot com
2021-07-02  7:30 ` wwwhhhyyy333 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).