Discussion:
MMU related code
Carter Cheng
2018-10-28 16:08:12 UTC
Permalink
Hi,

Where do I find the code in the kernel related to the MMU and resolving
memory addresses? I am trying to understand what the implications are if
code like this has bugs and the impact on the various functions that return
chunks of memory for use via pointers (either as pages or kmalloc chunks)
etc.

Regards,

Carter
v***@vt.edu
2018-10-29 01:49:06 UTC
Permalink
Post by Carter Cheng
Where do I find the code in the kernel related to the MMU and resolving
memory addresses? I am trying to understand what the implications are if
code like this has bugs and the impact on the various functions that return
chunks of memory for use via pointers (either as pages or kmalloc chunks)
etc.
The results are easy enough to predict even without looking at the code. If your
memory allocations are buggy, you get random memory overlays and corruption,
attempts to access non-mapped physical or virtual memory addresses, and so on.

Basically, all the same sorts of issues beginning C programmers encounter before
they understand pointers.
SeyedAlireza Sanaee
2018-10-29 02:44:38 UTC
Permalink
Hi,

A BUGGY MMU may also have some security implications, like flawed
protection of one process against another one. MMU may work fine without
any performance or functionality issue. But it might reveal one's address
space to the others.

I'm not sure if what I have told is true but let me know if it is wrong pls!

Thanks
Post by Carter Cheng
Post by Carter Cheng
Where do I find the code in the kernel related to the MMU and resolving
memory addresses? I am trying to understand what the implications are if
code like this has bugs and the impact on the various functions that
return
Post by Carter Cheng
chunks of memory for use via pointers (either as pages or kmalloc chunks)
etc.
The results are easy enough to predict even without looking at the code.
If your
memory allocations are buggy, you get random memory overlays and corruption,
attempts to access non-mapped physical or virtual memory addresses, and so on.
Basically, all the same sorts of issues beginning C programmers encounter before
they understand pointers.
_______________________________________________
Kernelnewbies mailing list
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Carter Cheng
2018-10-29 07:33:02 UTC
Permalink
Is the /mm directory the correct place to look? It seems to contain memory
related code but from what little I have read it seems at a higher level
building in some cases at least on kmalloc. I am just curious about a point
raised by the SVA dissertation(by John Criswell). Another point he does
raise but I am uncertain about how true it is in general is that to do
static analysis/dynamic instrumentation properly on the kernel one needs
some method to assess what the inline assembly fragments do and to deal
with this particular problem he replaced all this code with custom bitcode
instructions.
Steffen Vogel
2018-10-29 07:45:15 UTC
Permalink
Hi Carter,
Post by Carter Cheng
Is the /mm directory the correct place to look? It seems to contain memory
related code but from what little I have read it seems at a higher level
building in some cases at least on kmalloc.
Most if the paging/MMU code is also architecture specific which means
that it resides in the arch/mm subfolders.

I saw that there was a MM 101 presentation last week at the Open Source
Summit [1], Unfortunatetly, it is quite high-level and most likelt
uninterestting to you.

But there is also a huge subsection in the official kernel documentation
which has many references to the mm/ and arch/mm code [2].

Cheers,
Steffen


[1] https://events.linuxfoundation.org/wp-content/uploads/2017/12/MM-101-Introduction-to-Linux-Memory-Management-Christoph-Lameter-Jump-Trading-LLC.pdf
[2] https://www.kernel.org/doc/html/latest/vm/index.html
Carter Cheng
2018-10-29 08:01:02 UTC
Permalink
Thanks, I'll check it out.
Post by Steffen Vogel
Hi Carter,
Post by Carter Cheng
Is the /mm directory the correct place to look? It seems to contain
memory
Post by Carter Cheng
related code but from what little I have read it seems at a higher level
building in some cases at least on kmalloc.
Most if the paging/MMU code is also architecture specific which means
that it resides in the arch/mm subfolders.
I saw that there was a MM 101 presentation last week at the Open Source
Summit [1], Unfortunatetly, it is quite high-level and most likelt
uninterestting to you.
But there is also a huge subsection in the official kernel documentation
which has many references to the mm/ and arch/mm code [2].
Cheers,
Steffen
[1]
https://events.linuxfoundation.org/wp-content/uploads/2017/12/MM-101-Introduction-to-Linux-Memory-Management-Christoph-Lameter-Jump-Trading-LLC.pdf
[2] https://www.kernel.org/doc/html/latest/vm/index.html
Continue reading on narkive:
Search results for 'MMU related code' (Questions and Answers)
4
replies
What is virtual memory?
started 2006-09-18 09:13:43 UTC
desktops
Loading...