Kosha: An Adversarial Compiler For Security Education via Documented Failure
Authors/Creators
Description
Modern systems software education relies increasingly on auxiliary developer tooling—ranging from static analysis linters and automated memory sanitisers to interactive IDE diagnostics and large-scale language models—designed to accelerate debugging and lower entry barriers. However, these instruments share a structural pedagogical flaw: they resolve software defects for the developer rather than requiring the developer to resolve them. By outsourcing the verification step to automated engines, novices develop a passive reliance on external correction, bypassing the rigorous mental execution modeling required for systems mastery.
This paper introduces Kosha (v0.1.0), an adversarial C99 educational compiler engineered to explicitly refuse deferred verification. Kosha strips compiler diagnostic verbosity down to minimal, non-descriptive error codes that map strictly to an external architectural manual. We detail Kosha's single-pass pipeline, formalise its operational type-inference rules, and characterise its host-target security isolation boundaries, presenting a rigorous pedagogical instrument designed to force active, first-principles manual tracing in systems security curricula.
Files
architecture.pdf
Additional details
Related works
- Is supplement to
- Software: https://archive.softwareheritage.org/swh:1:dir:21caacbeaba1e0c46b76da95cbb2ebe335c54c8b (URL)
Dates
- Submitted
-
2026-10-27Preprint release
Software
References
- Leroy, X. (2009). A formally verified compiler back-end. Communications of the ACM, 52(7), 107-115.
- Kumar, R., Myreen, M. O., Norrish, M., & Owens, S. (2014). CakeML: A verified implementation of ML. ACM SIGPLAN Notices, 49(1), 179-191.
- Zhao, J., Nagarakatte, S., Martin, M. M., & Zdancewic, S. (2012). Formalizing the LLVM intermediate representation for verified compilation. ACM SIGPLAN Notices, 47(1), 427-440.
- Hathhorn, C., Ellison, C., & Rosu, G. (2015). Defining the undefinedness of C. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (pp. 336-345).
- Krebbers, R. (2015). The C standard formalised in Coq (Doctoral dissertation, Radboud University).
- Bessey, A., Block, K., Chelf, B., Chou, A., Fulton, B., Hallem, S., Henri-Gros, C., Kamsky, A., McPeak, S., & Engler, D. (2010). A few billion lines of code later: using static analysis to find bugs in the real world. Communications of the ACM, 53(2), 66-75.
- Vassena, M., Disselkoen, C., von Gleissenthall, K., Cauligi, S., Kıcı, R. G., Jhala, R., Tullsen, D., & Stefan, D. (2021). Automatically eliminating speculative leaks from cryptographic code with Blade. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages (POPL) (pp. 225-238).
- Torbunova, A., Ashraf, A., & Porres, I. (2024). A systematic mapping study on teaching of security concepts in programming courses. In Proceedings of the 50th Euromicro Conference on Software Engineering and Advanced Applications (SEAA) (pp. 350-357). IEEE.