Linux use of protected instruction using gcc

I want to run the rdmsr or wrmsr instruction from some code running as root.
I know how to use IOPL to set the access level of IO instructions, but what about other kernal level instructions?

Thanks.

Comments

  • : I want to run the rdmsr or wrmsr instruction from some code running as root.
    : I know how to use IOPL to set the access level of IO instructions, but what about other kernal level instructions?
    :
    : Thanks.
    :
    unless you are in ring 0 (which means in the kernel or a kernel module under linux) you can't execute these instructions. linux will kill your task if you attempt to. even if you are root.

    Eike.

    SUSE LINUX 7.3 PRO - The world starts behind windows

  • OK, I knew this, but in a similar way to opening up trapped IO using IOPL(3) as root, I figured there may of been some programmatic way around it.

    What would be the simplest method of running code in kernel mode then. What about a simple device driver?


    : : I want to run the rdmsr or wrmsr instruction from some code running as root.
    : : I know how to use IOPL to set the access level of IO instructions, but what about other kernal level instructions?
    : :
    : : Thanks.
    : :
    : unless you are in ring 0 (which means in the kernel or a kernel module under linux) you can't execute these instructions. linux will kill your task if you attempt to. even if you are root.
    :
    : Eike.
    :
    : SUSE LINUX 7.3 PRO - The world starts behind windows
    :
    :

  • i would guess there is no way around this barrier. the MSR's can completely screwup the kernel ... But using a somple device driver should do the trick. maybe there already is a device driver to access the MSR's ? i think i saw them in /proc.

    : OK, I knew this, but in a similar way to opening up trapped IO using IOPL(3) as root, I figured there may of been some programmatic way around it.
    :
    : What would be the simplest method of running code in kernel mode then. What about a simple device driver?
    :
    :
    : : : I want to run the rdmsr or wrmsr instruction from some code running as root.
    : : : I know how to use IOPL to set the access level of IO instructions, but what about other kernal level instructions?
    : : :
    : : : Thanks.
    : : :
    : : unless you are in ring 0 (which means in the kernel or a kernel module under linux) you can't execute these instructions. linux will kill your task if you attempt to. even if you are root.
    : :
    : : Eike.
    : :
    : : SUSE LINUX 7.3 PRO - The world starts behind windows
    : :
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories