Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-19 Thread Konstantin Khlebnikov
On 19.03.2015 16:04, Vlastimil Babka wrote: On 03/18/2015 12:41 PM, Konstantin Khlebnikov wrote: On 18.03.2015 12:57, Kirill A. Shutemov wrote: I don't think it worth it. The only right way to fix the problem is ECC memory. ECC seems good protection until somebody figure out how to break

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-19 Thread Vlastimil Babka
On 03/18/2015 12:41 PM, Konstantin Khlebnikov wrote: > On 18.03.2015 12:57, Kirill A. Shutemov wrote: >> >> I don't think it worth it. The only right way to fix the problem is ECC >> memory. >> > > ECC seems good protection until somebody figure out how to break it too. I doubt that kind of

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-19 Thread Konstantin Khlebnikov
On 19.03.2015 16:04, Vlastimil Babka wrote: On 03/18/2015 12:41 PM, Konstantin Khlebnikov wrote: On 18.03.2015 12:57, Kirill A. Shutemov wrote: I don't think it worth it. The only right way to fix the problem is ECC memory. ECC seems good protection until somebody figure out how to break

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-19 Thread Vlastimil Babka
On 03/18/2015 12:41 PM, Konstantin Khlebnikov wrote: On 18.03.2015 12:57, Kirill A. Shutemov wrote: I don't think it worth it. The only right way to fix the problem is ECC memory. ECC seems good protection until somebody figure out how to break it too. I doubt that kind of attitude can

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Dave Hansen
On 03/18/2015 08:08 AM, Konstantin Khlebnikov wrote: > It seems the only option is memory zoning: kernel should allocate all > normal memory for userspace from isolated area which is kept far far > away from important data. Yeah, except that the kernel has a pretty hard time telling which data is

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Konstantin Khlebnikov
On Wed, Mar 18, 2015 at 5:11 PM, Dave Hansen wrote: > On 03/18/2015 01:30 AM, Konstantin Khlebnikov wrote: >> + /* >> + * Read-only SUID/SGID binares are mapped as copy-on-read >> + * this protects them against exploiting with Rowhammer. >> + */

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Dave Hansen
On 03/18/2015 01:30 AM, Konstantin Khlebnikov wrote: > + /* > + * Read-only SUID/SGID binares are mapped as copy-on-read > + * this protects them against exploiting with Rowhammer. > + */ > + if (!(file->f_mode & FMODE_WRITE) && > +

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Konstantin Khlebnikov
On 18.03.2015 12:57, Kirill A. Shutemov wrote: On Wed, Mar 18, 2015 at 11:30:40AM +0300, Konstantin Khlebnikov wrote: From: Konstantin Khlebnikov Each user gets private copy of the code thus nobody will be able to exploit pages in the page cache. This works for statically-linked binaries.

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Kirill A. Shutemov
On Wed, Mar 18, 2015 at 11:30:40AM +0300, Konstantin Khlebnikov wrote: > From: Konstantin Khlebnikov > > Each user gets private copy of the code thus nobody will be able to exploit > pages in the page cache. This works for statically-linked binaries. Shared > libraries are still vulnerable, but

[PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov Each user gets private copy of the code thus nobody will be able to exploit pages in the page cache. This works for statically-linked binaries. Shared libraries are still vulnerable, but setting suid bit will protect them too. [1]

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Kirill A. Shutemov
On Wed, Mar 18, 2015 at 11:30:40AM +0300, Konstantin Khlebnikov wrote: From: Konstantin Khlebnikov khlebni...@yandex-team.ru Each user gets private copy of the code thus nobody will be able to exploit pages in the page cache. This works for statically-linked binaries. Shared libraries are

[PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov khlebni...@yandex-team.ru Each user gets private copy of the code thus nobody will be able to exploit pages in the page cache. This works for statically-linked binaries. Shared libraries are still vulnerable, but setting suid bit will protect them too. [1]

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Konstantin Khlebnikov
On 18.03.2015 12:57, Kirill A. Shutemov wrote: On Wed, Mar 18, 2015 at 11:30:40AM +0300, Konstantin Khlebnikov wrote: From: Konstantin Khlebnikov khlebni...@yandex-team.ru Each user gets private copy of the code thus nobody will be able to exploit pages in the page cache. This works for

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Konstantin Khlebnikov
On Wed, Mar 18, 2015 at 5:11 PM, Dave Hansen dave.han...@intel.com wrote: On 03/18/2015 01:30 AM, Konstantin Khlebnikov wrote: + /* + * Read-only SUID/SGID binares are mapped as copy-on-read + * this protects them against exploiting with Rowhammer. +

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Dave Hansen
On 03/18/2015 01:30 AM, Konstantin Khlebnikov wrote: + /* + * Read-only SUID/SGID binares are mapped as copy-on-read + * this protects them against exploiting with Rowhammer. + */ + if (!(file-f_mode FMODE_WRITE) +

Re: [PATCH RFC] mm: protect suid binaries against rowhammer with copy-on-read mappings

2015-03-18 Thread Dave Hansen
On 03/18/2015 08:08 AM, Konstantin Khlebnikov wrote: It seems the only option is memory zoning: kernel should allocate all normal memory for userspace from isolated area which is kept far far away from important data. Yeah, except that the kernel has a pretty hard time telling which data is