Earlier quoted context omitted.
Mathematics in C is modular arithmetic built as an abstraction on top of fixed-width numbers. One has to keep reminding oneself of this fact. This got etched in my brain after I saw a piece of code that calculated the middle index of an array in a roundabout way mid = left+ (right-left) /2 instead of mid = (right +left) / 2 Although even this code can cause overflows, it has served as a reminder to be cautious even w…
> One has to keep reminding oneself of this fact. No, one doesn't need to do this, and no matter how hard you try, ths doesn't work in practice since you only need to slip once to introduce a CVE into your program. What we need is for compilers to start calling `abort` by default on any kind of integer overflow. If you have a piece of C code in which you actually need integers to overflow with some particular semanti…
RabbitMQ integer overflow that leads to heap memory corruption
21–25 of 25 posts
Re: RabbitMQ integer overflow that leads to heap memory corruption
#22Earlier quoted context omitted.
Mathematics in C is modular arithmetic built as an abstraction on top of fixed-width numbers. One has to keep reminding oneself of this fact. This got etched in my brain after I saw a piece of code that calculated the middle index of an array in a roundabout way mid = left+ (right-left) /2 instead of mid = (right +left) / 2 Although even this code can cause overflows, it has served as a reminder to be cautious even w…
> One has to keep reminding oneself of this fact. No, one doesn't need to do this, and no matter how hard you try, ths doesn't work in practice since you only need to slip once to introduce a CVE into your program. What we need is for compilers to start calling `abort` by default on any kind of integer overflow. If you have a piece of C code in which you actually need integers to overflow with some particular semanti…
Re: RabbitMQ integer overflow that leads to heap memory corruption
#23Earlier quoted context omitted.
> One has to keep reminding oneself of this fact. No, one doesn't need to do this, and no matter how hard you try, ths doesn't work in practice since you only need to slip once to introduce a CVE into your program. What we need is for compilers to start calling `abort` by default on any kind of integer overflow. If you have a piece of C code in which you actually need integers to overflow with some particular semanti…
Doesn't Rust arithmetic wraparound on release? I read Microsoft's Midori language paniced/abandoned on overflow even in release, and the compiler got quite good at optimizing overflow checks away.
Re: RabbitMQ integer overflow that leads to heap memory corruption
#24Earlier quoted context omitted.
> One has to keep reminding oneself of this fact. No, one doesn't need to do this, and no matter how hard you try, ths doesn't work in practice since you only need to slip once to introduce a CVE into your program. What we need is for compilers to start calling `abort` by default on any kind of integer overflow. If you have a piece of C code in which you actually need integers to overflow with some particular semanti…
Doesn't Rust arithmetic wraparound on release? I read Microsoft's Midori language paniced/abandoned on overflow even in release, and the compiler got quite good at optimizing overflow checks away.
Re: RabbitMQ integer overflow that leads to heap memory corruption
#25Earlier quoted context omitted.
Mathematics in C is modular arithmetic built as an abstraction on top of fixed-width numbers. One has to keep reminding oneself of this fact. This got etched in my brain after I saw a piece of code that calculated the middle index of an array in a roundabout way mid = left+ (right-left) /2 instead of mid = (right +left) / 2 Although even this code can cause overflows, it has served as a reminder to be cautious even w…
> One has to keep reminding oneself of this fact. No, one doesn't need to do this, and no matter how hard you try, ths doesn't work in practice since you only need to slip once to introduce a CVE into your program. What we need is for compilers to start calling `abort` by default on any kind of integer overflow. If you have a piece of C code in which you actually need integers to overflow with some particular semanti…
GCC supports this for C and C++, but it's off by default. I don't know if any distros build with this flag (-ftrapv) enabled. Seems like a good idea.
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.h...