Improved Kernel Security Through Code Validation, Diversification, and Minimization