Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-13 Thread Michal Hocko
On Sun 12-07-20 09:22:28, Pavel Machek wrote: > On Tue 2020-07-07 12:00:41, Colm MacCarthaigh wrote: > > > > > > On 7 Jul 2020, at 9:37, Pavel Machek wrote: > > > Please go through the thread and try to understand it. > > > > > > You'd need syscalls per get_randomness(), not per migration. > >

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-12 Thread Pavel Machek
On Tue 2020-07-07 12:00:41, Colm MacCarthaigh wrote: > > > On 7 Jul 2020, at 9:37, Pavel Machek wrote: > > Please go through the thread and try to understand it. > > > > You'd need syscalls per get_randomness(), not per migration. > > I think one check per get_randomness() is sufficient,

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-07 Thread Pavel Machek
Hi! > > > > You can do it seqlock-style, kind of - you reserve the first byte of > > > > the page or so as a "is this page initialized" marker, and after every > > > > read from the page, you do a compiler barrier and check whether that > > > > byte has been cleared. > > > > > > This is

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-07 Thread Michal Hocko
On Tue 07-07-20 10:01:23, Alexander Graf wrote: > On 07.07.20 09:44, Michal Hocko wrote: > > On Mon 06-07-20 14:52:07, Jann Horn wrote: > > > On Mon, Jul 6, 2020 at 2:27 PM Alexander Graf wrote: > > > > Unless we create a vsyscall that returns both the PID as well as the > > > > epoch and thus

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-07 Thread Michal Hocko
On Tue 07-07-20 10:07:26, Pavel Machek wrote: > Hi! > > > > > > This patch adds logic to the kernel power code to zero out contents of > > > > > all MADV_WIPEONSUSPEND VMAs present in the system during its > > > > > transition > > > > > to any suspend state equal or greater/deeper than

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-07 Thread Pavel Machek
Hi! > > > > This patch adds logic to the kernel power code to zero out contents of > > > > all MADV_WIPEONSUSPEND VMAs present in the system during its transition > > > > to any suspend state equal or greater/deeper than Suspend-to-memory, > > > > known as S3. > > > > > > How does the application

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-07 Thread Michal Hocko
On Mon 06-07-20 14:52:07, Jann Horn wrote: > On Mon, Jul 6, 2020 at 2:27 PM Alexander Graf wrote: > > Unless we create a vsyscall that returns both the PID as well as the > > epoch and thus handles fork *and* suspend. I need to think about this a > > bit more :). > > You can't reliably detect

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-07 Thread Michal Hocko
On Fri 03-07-20 18:45:06, Colm MacCárthaigh wrote: > > > On 3 Jul 2020, at 4:30, Michal Hocko wrote: > > > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > > This patch adds logic to the kernel power code to zero out contents > > > of > > > all MADV_WIPEONSUSPEND VMAs present in the

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-07 Thread Michal Hocko
On Fri 03-07-20 15:29:22, Jann Horn wrote: > On Fri, Jul 3, 2020 at 1:30 PM Michal Hocko wrote: > > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > > This patch adds logic to the kernel power code to zero out contents of > > > all MADV_WIPEONSUSPEND VMAs present in the system during

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-06 Thread Jann Horn via Virtualization
On Mon, Jul 6, 2020 at 2:27 PM Alexander Graf wrote: > Unless we create a vsyscall that returns both the PID as well as the > epoch and thus handles fork *and* suspend. I need to think about this a > bit more :). You can't reliably detect forking by checking the PID if it is possible for

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-04 Thread Pavel Machek
Hi! > > > Cryptographic libraries carry pseudo random number generators to > > > quickly provide randomness when needed. If such a random pool gets > > > cloned, secrets may get revealed, as the same random number may get > > > used multiple times. For fork, this was fixed using the WIPEONFORK >

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Jann Horn via Virtualization
On Sat, Jul 4, 2020 at 12:44 AM Pavel Machek wrote: > > Cryptographic libraries carry pseudo random number generators to > > quickly provide randomness when needed. If such a random pool gets > > cloned, secrets may get revealed, as the same random number may get > > used multiple times. For

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Jann Horn via Virtualization
On Sat, Jul 4, 2020 at 12:34 AM Pavel Machek wrote: > On Fri 2020-07-03 15:29:22, Jann Horn wrote: > > On Fri, Jul 3, 2020 at 1:30 PM Michal Hocko wrote: > > > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > > > This patch adds logic to the kernel power code to zero out contents of

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Pavel Machek
On Fri 2020-07-03 14:17:50, Rafael J. Wysocki wrote: > On Fri, Jul 3, 2020 at 1:30 PM Michal Hocko wrote: > > > > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > > This patch adds logic to the kernel power code to zero out contents of > > > all MADV_WIPEONSUSPEND VMAs present in the

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Pavel Machek
On Fri 2020-07-03 15:29:22, Jann Horn wrote: > On Fri, Jul 3, 2020 at 1:30 PM Michal Hocko wrote: > > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > > This patch adds logic to the kernel power code to zero out contents of > > > all MADV_WIPEONSUSPEND VMAs present in the system

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Jann Horn via Virtualization
On Fri, Jul 3, 2020 at 1:30 PM Michal Hocko wrote: > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > This patch adds logic to the kernel power code to zero out contents of > > all MADV_WIPEONSUSPEND VMAs present in the system during its transition > > to any suspend state equal or

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Rafael J. Wysocki
On Fri, Jul 3, 2020 at 1:30 PM Michal Hocko wrote: > > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > This patch adds logic to the kernel power code to zero out contents of > > all MADV_WIPEONSUSPEND VMAs present in the system during its transition > > to any suspend state equal or

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Michal Hocko
On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > This patch adds logic to the kernel power code to zero out contents of > all MADV_WIPEONSUSPEND VMAs present in the system during its transition > to any suspend state equal or greater/deeper than Suspend-to-memory, > known as S3. How

Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND

2020-07-03 Thread Jann Horn via Virtualization
On Fri, Jul 3, 2020 at 12:34 PM Catangiu, Adrian Costin wrote: > Cryptographic libraries carry pseudo random number generators to > quickly provide randomness when needed. If such a random pool gets > cloned, secrets may get revealed, as the same random number may get > used multiple times. For