qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC] sanitize memory on system reset
Date: Thu, 13 Jun 2013 11:33:40 +0200	[thread overview]
Message-ID: <51B991F4.5000405@kamp.de> (raw)
In-Reply-To: <51B98F70.3070009@suse.de>

On 13.06.2013 11:22, Andreas Färber wrote:
> Hi,
>
> Am 13.06.2013 08:09, schrieb Peter Lieven:
>> I was thinking if it would be a good idea to zeroize all memory
>> resources on system reset and
>> madvise dontneed them afterwards.
> The current way of not zeroing memory has led to discovery of some
> firmware bugs that we wouldn't have found if QEMU defaulted to zeroing.
The memory is zero at the start due to the use of mmap. Maybe
we need to add an option to add an initialization value anyway
because I am unsure if PERTURB works with mmap?!
>
>> This would avoid system reset attacks
>> in case the attacker
>> has only access to the console of a vServer but not on the physical host
>> and it would shrink
>> RSS size of the vServer siginificantly.
> Apart from the guest issue Stefan brought up (so far by definition we do
> a hard reset, so guests cannot assume soft reset semantics, but we
> should keep our options open), would not zeroing while marking pages as
> unused be an option? E.g., -reset-memory=DEADBEEF or some other
> command-line-specifiable pattern, absence would mean current behavior.
This would overwrite all contents with 0xdeadbeaf avoiding information
leak, but it would unnecessarily keep the memory alocated. So what
about an option -mem-sanitize with an optional parameter to write
a initialization value.

option missing -> no change
-mem-sanitize -> zeroize and madv_dontneed
-mem-sanitze=deadbeaf -> fill memory with 0xdeadbeaf

Where is the right postion to add this hook. qemu_system_reset() ?

Peter
>
> Regards,
> Andreas
>


-- 

Mit freundlichen Grüßen

Peter Lieven

...........................................................

   KAMP Netzwerkdienste GmbH
   Vestische Str. 89-91 | 46117 Oberhausen
   Tel: +49 (0) 208.89 402-50 | Fax: +49 (0) 208.89 402-40
   pl@kamp.de | http://www.kamp.de

   Geschäftsführer: Heiner Lante | Michael Lante
   Amtsgericht Duisburg | HRB Nr. 12154
   USt-Id-Nr.: DE 120607556

...........................................................

      reply	other threads:[~2013-06-13  9:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-13  6:09 [Qemu-devel] [RFC] sanitize memory on system reset Peter Lieven
2013-06-13  8:40 ` Stefan Hajnoczi
2013-06-13  8:46   ` Peter Lieven
2013-06-14 11:06     ` Stefan Hajnoczi
2013-06-13  8:51   ` Peter Lieven
2013-06-13 10:55     ` Markus Armbruster
2013-06-13 11:56       ` Anthony Liguori
2013-06-13 12:30         ` Paolo Bonzini
2013-06-14  6:56         ` Christian Borntraeger
2013-06-14  9:44           ` Alexander Graf
2013-06-14 13:43             ` Paolo Bonzini
2013-06-17  7:18               ` Peter Lieven
2013-06-14 16:14             ` H. Peter Anvin
2013-06-13 14:23       ` Peter Lieven
2013-06-13 15:51         ` Markus Armbruster
2013-06-13 19:20           ` Peter Lieven
2013-06-13  9:22 ` Andreas Färber
2013-06-13  9:33   ` Peter Lieven [this message]

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=51B991F4.5000405@kamp.de \
    --to=pl@kamp.de \
    --cc=afaerber@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 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 NNTP newsgroup(s).