Skip to contentSkip to conversation

Mapping to 0x0

DISCUSSION Robert Hancock 1 participant 1 message Feb 24, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 6 lines · Jan Engelhardt

The mmap() usually succeeds and maps something at address 0x00000000. Now what if the kernel would try to execute this (of course badly programmed) code in the context of this very process?

    int (*callback)(int xyz) = NULL;
    callback();

Would not be the badcode be executed with kernel privileges?

I'm not sure, but I would suspect it might, yes, at least on some platforms and configurations. However, this unlikely to be a serious problem, since any kernel code that executed a callback method which could be a NULL without checking for that would blow up the system in the vast majority of cases where nothing was mapped at address 0.

Signature · 3 lines
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/