4 ms·
Just FYI, "it's only a one byte overflow" has been a standard exploit denial for 20 years, and also wrong for that long.
by tedunangst 10y ago
Just FYI, "it's only a one byte overflow" has been a standard exploit denial for 20 years, and also wrong for that long.
- deleted 10y ago[deleted]
- 0x0 10y agoSounds familiar to https://googleprojectzero.blogspot.no/2014/08/the-poisoned-nul-byte-2014-edition.html https://googleprojectzero.blogspot.no/2014/08/the-poisoned-n...
- deleted 10y ago[deleted]
- hinkley 10y agoThe allocator used on that project sure seems to think that off by one errors never happen. Why on earth would you put the in use bit in the first byte in your object header? Good grief.
- tedunangst 10y agoLets just say that dlmalloc is the product of another era.
- ams6110 10y agoIndeed -- VERSION 2.6.6 Sun Mar 5 19:10:03 2000
- jcoffland 10y agoWhat would you do instead? Add a padding byte in case of a buffer overflow? If you write code with lots of what-if-this-happened cases instead of just concentrating on creating correct code then you're most likely going to create an even bigger mess.
- jacquesm 10y agoNot a padding byte, but a word sized sentinel before and after the allocated block that gets checked upon free. Sentinel gone? -> overwrite bug detected.
- sebcat 10y agoIf you also have a known (preferably random) value as padding, and you check it at deallocation, it is called a canary, as in canaries in coal mines. It's a commonly used method to find/protect against overflows. For stack overflows, see -fstack-protector(-...) for gcc and clang. For heap overflows, it would depend on the implementation of malloc. glibc has mcheck() and MALLOC_CHECK_. If you're doing this as a part of release testing, ASan (and other *Sans like MSan) is worth looking into.