I'm learning interrupt in operating system now and got this question. I know that we cannot directly call system functions in user mode because the CPL in CS is 3 and the DPL of system_call is 0. I'm wondering that if we can just set CPL in CS to 0 and then call the kernel functions?
The reason that it seems doable to me is that interrupt (int 0x80) can change CPL from 3 to 0, which means we should also be able to do the same thing. But if we can, this is a security issue because then any malware will be able to access system resources.