Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 31 Oct 2018 00:15:46 +0200
From: Igor Stoppa <>
To: Andy Lutomirski <>
Cc: Matthew Wilcox <>, Tycho Andersen <>,
 Kees Cook <>, Peter Zijlstra <>,
 Mimi Zohar <>, Dave Chinner <>,
 James Morris <>, Michal Hocko <>,
 Kernel Hardening <>,
 linux-integrity <>,
 linux-security-module <>,
 Igor Stoppa <>,
 Dave Hansen <>, Jonathan Corbet <>,
 Laura Abbott <>, Randy Dunlap <>,
 Mike Rapoport <>,
 "open list:DOCUMENTATION" <>,
 LKML <>, Thomas Gleixner <>
Subject: Re: [PATCH 10/17] prmem: documentation

On 30/10/2018 23:02, Andy Lutomirski wrote:
>> On Oct 30, 2018, at 1:43 PM, Igor Stoppa <> wrote:

>> There is no need to process each of these tens of thousands allocations and initialization as write-rare.
>> Would it be possible to do the same here?
> I don’t see why not, although getting the API right will be a tad complicated.

yes, I have some first-hand experience with this :-/

>>>>> To subsequently modify q,
>>>>>     p = rare_modify(q);
>>>>>     q->a = y;
>>>> Do you mean
>>>>      p->a = y;
>>>> here? I assume the intent is that q isn't writable ever, but that's
>>>> the one we have in the structure at rest.
>>> Yes, that was my intent, thanks.
>>> To handle the list case that Igor has pointed out, you might want to
>>> do something like this:
>>>     list_for_each_entry(x, &xs, entry) {
>>>         struct foo *writable = rare_modify(entry);
>> Would this mapping be impossible to spoof by other cores?
> Indeed. Only the core with the special mm loaded could see it.
> But I dislike allowing regular writes in the protected region. We really only need four write primitives:
> 1. Just write one value.  Call at any time (except NMI).
> 2. Just copy some bytes. Same as (1) but any number of bytes.
> 3,4: Same as 1 and 2 but must be called inside a special rare write region. This is purely an optimization.

Atomic? RCU?

Yes, they are technically just memory writes, but shouldn't the "normal" 
operation be executed on the writable mapping?

It is possible to sandwich any call between a rare_modify/rare_protect, 
however isn't that pretty close to having a write-rare version of these 
plain function.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.