I cannot get Stack Smash Protector working

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tuanhtrng
Posts: 2
Joined: Sat May 14, 2022 4:50 am

I cannot get Stack Smash Protector working

Post by tuanhtrng »

Dear OSdevers,

I implemented SSP as the wiki instructed but failed to get it working. On release build, the stack overflow regress did not trigger the SSP. However, on the debug build, my whole regression test fails due to stack overflows! Why!?

I am learning RISC-V with OSdev. The OS is written in C++ using clang-devel from FreeBSD.
ccleaverr
Posts: 3
Joined: Fri Aug 12, 2022 4:46 am
Location: Christchurch, New Zealand

Re: I cannot get Stack Smash Protector working

Post by ccleaverr »

Can you post some code? Including the code for the SSP and for the test.

How do your release and debug builds differ?
And when he came back to, he was flat on his back on the beach in the freezing sand, and it was raining out of a low sky, and the tide was way out.
tuanhtrng
Posts: 2
Joined: Sat May 14, 2022 4:50 am

Re: I cannot get Stack Smash Protector working

Post by tuanhtrng »

I found the bug. It was a function from dlmalloc.

My kernel uses dlmalloc for dynamic memory.
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: I cannot get Stack Smash Protector working

Post by kzinti »

Are you saying that dlmalloc() has a bug? I find this surprising. Can you explain what was the problem with dlmalloc?
Post Reply