rui314 / chibicc

A small C compiler
MIT License
9.57k stars 871 forks source link

security of the executables properties #10

Open MUWASEC opened 3 years ago

MUWASEC commented 3 years ago

maybe you can consider make it more secure by adding security flags like PIE, RELRO, PaX, Canaries, ASLR, Fortify. i dont know if this will make any difference on the performance but in my opinion, it's better than nothing tho

image link

MannySchneck commented 3 years ago

This is an educational project. I think that's a good suggestion for a chapter, but I'm not sure it's appropriate to spew a list of industrial-strength compiler flags at the maintainer of this project. Implementations of the above that meaningfully increase security are not trivial.

MUWASEC commented 3 years ago

yeah i think the same way too (educational project), but as i say before so leave it as the author consideration

rui314 commented 3 years ago

Thank you for your comment. I don't think that I should cover all the details of security enhancement features of compilers, but at least I need to cover what is PIC and PIE and how to generate code for shared libraries (GOTs and PLTs) because without that knowledge, one cannot create a working executable or an DSO. For now, chibicc can actually produce only PIE executable.