Subject: Re: [PATCH net] bpf: disable broken write protection on i386

From: Daniel Borkmann <[email-masked]>
Date: Wed, 08 Mar 2017 22:21:00 +0100

On 03/08/2017 07:40 PM, Kees Cook wrote:
> On Mon, Mar 6, 2017 at 10:11 AM, Kees Cook <[email-masked]> wrote:
>> On Fri, Mar 3, 2017 at 7:23 PM, Daniel Borkmann <[email-masked]> wrote:
>>> Latter shows that memory protecting the kernel seems not working either
>>> on i386 (!). Test suite output:
>>>
>>>    [...]
>>>    [   12.692836] Write protecting the kernel text: 13416k
>>>    [   12.693309] Write protecting the kernel read-only data: 5292k
>>>    [   12.693802] rodata_test: test data was not read only
>>>    [...]
>>>
>>> Work-around to not enable ARCH_HAS_SET_MEMORY for i386 is not optimal
>>> as it doesn't fix the issue in presumably broken set_memory_*(), but
>>> it at least avoids people avoid having to deal with random corruptions
>>> that are hard to track down for the time being until a real fix can
>>> be found.
>>
>> Wow. Uhm, so, something must be _really_ broken. i386 should have no
>> problem with using the set_memory_*() functions. The fact that
>> DEBUG_RODATA_TEST failed is also pretty crazy, but may be unrelated
>> (that test was just refactored too).
>
> I'm not able to reproduce this. I built Linus's tree and rodata_test
> passes for me on i386. I tried the .config from Fengguang (with
> RODATA_TEST=y added), but it still passes for me:
> https://lkml.org/lkml/2017/3/1/344
>
> I wonder if something change changed already in the tree? Can you
> still reproduce this?

I'll answer in a bit an will move the discussion over to the other
thread on the same topic ("[net/bpf] 3051bf36c2 BUG: unable to handle
kernel paging request at 0000a7cf" [1]) with you, Laura and Dave in
Cc as well.

   [1] https://lkml.org/lkml/2017/3/8/620