All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas K. Huettel" <dilfridge@gentoo.org>
To: libc-alpha@sourceware.org
Cc: Zdenek Kabelac <zkabelac@redhat.com>,
	Ondrej Kozina <okozina@redhat.com>,
	Milan Broz <gmazyland@gmail.com>,
	dm-devel@lists.linux.dev, Mikulas Patocka <mpatocka@redhat.com>
Subject: Re: memcpy is leaking secret data through ZMM vector registers
Date: Sun, 21 Apr 2024 12:20:20 +1100	[thread overview]
Message-ID: <4900476.GXAFRqVoOG@noumea> (raw)
In-Reply-To: <a139443-d6de-7be1-c59b-c099b0b32884@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]

> We have a test "dmsecuretest.sh" that loads cryptographic keys into the 
> kernel, dumps a core, the core file is analyzed and if it contains the 
> key, the test fails.
> 
> This test fails on AMD Zen 4 - the reason for the failure is that the 
> "memcpy" function uses ZMM registers for data copying. When memcpy exits, 
> the encryption key is present in the ZMM registers and the key remains 
> there even after both source and destination buffers of memcpy were 
> cleared.
> 
> When we perform dynamic symbol lookup, the ZMM registers are spilled on 
> the stack and they remain there forever - this is the reason why the core 
> file contains the encryption key and the test fails.

So let me ask a few obvious questions, as someone with not (yet) deep
insights into the problem.

* Shouldn't this be treated as a security issue?

* Are the expectations on where the (key) data may end up defined 
  somewhere?

* If yes, which component behaves faulty?

* If no, who needs to be involved in making the specs?


-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer 
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2024-04-21  1:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 14:07 memcpy is leaking secret data through ZMM vector registers Mikulas Patocka
2024-04-19 14:19 ` H.J. Lu
2024-04-19 14:24   ` Mikulas Patocka
2024-04-19 14:37     ` H.J. Lu
2024-04-19 18:04       ` Mikulas Patocka
2024-04-19 18:45         ` Paul Eggert
2024-04-19 18:47           ` Zack Weinberg
2024-04-19 18:53             ` Alexander Monakov
2024-04-19 19:11               ` Zack Weinberg
2024-04-19 20:15                 ` Mikulas Patocka
2024-04-19 20:31                   ` Zack Weinberg
2024-04-19 21:11                     ` Mikulas Patocka
2024-04-19 23:27                       ` Florian Weimer
2024-04-20  3:29                         ` Zack Weinberg
2024-04-21  1:20 ` Andreas K. Huettel [this message]
2024-04-22  9:33 ` Szabolcs Nagy

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=4900476.GXAFRqVoOG@noumea \
    --to=dilfridge@gentoo.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=gmazyland@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=mpatocka@redhat.com \
    --cc=okozina@redhat.com \
    --cc=zkabelac@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.