3 ms·
I might be reading that article wrong, but it reads like they're critical of the use of alloca? I've never really written C or the like, what is dangerous about
by Twirrim 8y ago
I might be reading that article wrong, but it reads like they're critical of the use of alloca? I've never really written C or the like, what is dangerous about alloca?
- speps 8y agoVariable size allocation from the stack... That's one dangerous trick. [1] https://stackoverflow.com/questions/1018853/why-is-the-use-of-alloca-not-considered-good-practice https://stackoverflow.com/questions/1018853/why-is-the-use-o...
- pilif 8y agoIt allocates on the stack which is inherently of limited size and allocations grow in the direction of the “juicy” stuff. As so often with the C library, there is little bounds checking going on either (in fact, the behavior once you overflow the stack is explicitly undefined, so who knows what the hell is going to happen) If you somehow let the user specify the amount of bytes you’re going to allocate on the stack, then that’s an exploitable issue.
- Twirrim 8y agoAh, OK. So it is truly horrifying that it's in heavy use in journald, where users inevitably have that sort of power.
- deleted 8y ago[deleted]