Re: mmap, the language go, problems with the linux kernel

From: Florian Weimer
Date: Wed Feb 16 2011 - 15:51:46 EST


* Ted Ts'o:

>> The odd thing is that prot==0 does *not* count against the
>> vm.overcommit_memory=2 limit, only against ulimit -v. The limit is
>> only enforced for the parts on which mprotect is called. I think this
>> should really be part of the public API (I'm not sure if it is right
>> now, it could well be an accident), to avoid the problems you
>> describe.
>
> The overcommit_memory logic does not include any pages which are
> mapped read-only.

A colleague tells me that according to his tests, this depends on the
history of the page, as expected.

> Technically that's not quite enough --- in theory you could have a
> debugging attach to every single read-only text page and set
> breakpoints on every single page.

Those cases do not matter because setting a breakpoint can fail with
ENOMEM. You only have to take into account possibly future operations
which cannot fail with ENOMEM.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/