[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190424192812.GG19031@bombadil.infradead.org>
Date: Wed, 24 Apr 2019 12:28:12 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Matthew Garrett <matthewgarrett@...gle.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Matthew Garrett <mjg59@...gle.com>
Subject: Re: [PATCH] mm: Allow userland to request that the kernel clear
memory on release
On Wed, Apr 24, 2019 at 12:14:40PM -0700, Matthew Garrett wrote:
> Unfortunately, if an application exits uncleanly, its secrets may still be
> present in RAM. This can't be easily fixed in userland (eg, if the OOM
> killer decides to kill a process holding secrets, we're not going to be able
> to avoid that), so this patch adds a new flag to madvise() to allow userland
> to request that the kernel clear the covered pages whenever the page
> reference count hits zero. Since vm_flags is already full on 32-bit, it
> will only work on 64-bit systems.
Your request seems reasonable to me.
> +++ b/include/linux/page-flags.h
> @@ -118,6 +118,7 @@ enum pageflags {
> PG_reclaim, /* To be reclaimed asap */
> PG_swapbacked, /* Page is backed by RAM/swap */
> PG_unevictable, /* Page is "unevictable" */
> + PG_wipeonrelease,
But you can't have a new PageFlag. Can you instead zero the memory in
unmap_single_vma() where we call uprobe_munmap() and untrack_pfn() today?
Powered by blists - more mailing lists