|
I have no idea how the heap and stack work, but I have a theory that, in C/C++ you can overload the *malloc() function, with unelevated privileges, and somehow corrupt memory, or cause a buffer overflow (right?).
|
# ? Oct 2, 2017 14:48 |
|
|
# ? Mar 29, 2024 16:51 |
|
Goonerousity posted:I have no idea how the heap and stack work, but I have a theory that, in C/C++ you can overload the *malloc() function, with unelevated privileges, and somehow corrupt memory, or cause a buffer overflow (right?). I mean depends on platform, but yes, you could do this with something like LD_PRELOAD. You're only going to break a program running under the same privileges you already had anyway, though, so why would you do this?
|
# ? Oct 2, 2017 15:16 |
|
feedmegin posted:I mean depends on platform, but yes, you could do this with something like LD_PRELOAD. You're only going to break a program running under the same privileges you already had anyway, though, so why would you do this? Since the heap (???) is encapsulated by the kernel I figure it could write in critical areas of memory.
|
# ? Oct 2, 2017 17:00 |
|
Goonerousity posted:I have no idea how the heap and stack work, but I have a theory that, in C/C++ you can overload the *malloc() function, with unelevated privileges, and somehow corrupt memory, or cause a buffer overflow (right?). You may want to read up on virtual memory. Unless you are writing kernel code, your program "thinks" it has all the memory it can address, but it's actually all smokes and mirrors. Two consecutive bytes may be Gigabytes appart in physical ram, and you cannot "see" the memory of any other program unless you've set it up with the OS prior. Aramis fucked around with this message at 17:21 on Oct 2, 2017 |
# ? Oct 2, 2017 17:19 |