Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Goonerousity
Sep 25, 2017

aww yeah
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?).

Adbot
ADBOT LOVES YOU

feedmegin
Jul 30, 2008

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?

Goonerousity
Sep 25, 2017

aww yeah

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.

Aramis
Sep 22, 2009



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

  • Locked thread