Can any user run inline assembly for current linux kernel or does that require special permission?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Inline assembly has nothing to do with the kernel. So the answer is no.
Anyone can write inline assembly and compile it into the program. It isn’t any different from compiler generated code.
As for your comment, the answer is no it’s not possible because of memory protection. As soon as you try to access memory that isn’t mapped or you’re not allowed to (whether it’d be in C or via inline assembly), you’ll get a seg-fault.
In other words, the layer of protection is not between the C code and the compiler. It’s between the compiled code and the operating system.
So you can’t damage the kernel using C or inline assembly – unless you have acquired the permissions to do so.