linux-kernelkernel

what is the function of CONFIG_X86_WP_WORKS_OK?


can someone help me to understand this declaration: CONFIG_X86_WP_WORKS_OK in kernel config? what is the function of it? and how it work?


Solution

  • Require working memory write protect

    CONFIG_X86_WP_WORKS_OK

    So if you enable this option, the kernel assumes your processor handles writing to pages while in supervisor mode properly.

    http://lkml.indiana.edu/hypermail/linux/kernel/0003.1/0009.html

    the above is an old thread. recent code does not seems to have this comment.

    WP Write protect Determines whether the CPU can write to pages marked read-only

    http://en.wikipedia.org/wiki/Control_register

    From below

    http://src3.org/#RHEL6-2.6.32+220.el6/arch/x86/mm/init_32.c#L845

    there is a check for WP bit in cpu and find non-working WP bit and panic system.

    http://vulnfactory.org/blog/2011/08/12/wp-safe-or-not/