lkml.org 
[lkml]   [2005]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Understanding Linux addr space, malloc, and heap
Date
On Oct 23, 2005, at 06:44:47, Arjan van de Ven wrote:
>> But even if Vincend makes the next malloc/free/whatever to be
>> fubar, or if he made the world explode, mprotect is still required
>> to report an error if the requested action failed.
>
> but.. there's no proof yet that it failed...

Precisely. The only code sample he's sent that exhibits this
"problem" is buggy because it checks the wrong addresses for
protected status. In any case, if you _were_ going to try to change
protection bits on malloc()ed memory, you would need to make
_damn_sure_ that you didn't change the protection bits on internal
data structures that malloc uses to keep track of allocations. If
you remove read or write privs on malloc-internal linked-list
pointers, an attempt to malloc() or free() memory might (and probably
will) crash.

Cheers,
Kyle Moffett

--
I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.
-- Poul Anderson



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-23 23:32    [W:1.401 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site