Re: [tip:x86/asm 2/4] arch/x86/include/asm/special_insns.h:31:9: error: 'X86_CR0_WP' undeclared

From: Kees Cook
Date: Wed Mar 06 2019 - 11:26:26 EST


On Wed, Mar 6, 2019 at 3:43 AM kbuild test robot <lkp@xxxxxxxxx> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/asm
> head: a0bf7fc24303a538396aa8d32450d05c1929b9f0
> commit: d309ba034fac1a149d00cac79318973e9ba81848 [2/4] x86/asm: Pin sensitive CR0 bits
> config: um-x86_64_defconfig (attached as .config)
> compiler: gcc-8 (Debian 8.3.0-2) 8.3.0
> reproduce:
> git checkout d309ba034fac1a149d00cac79318973e9ba81848
> # save the attached .config to linux build tree
> make ARCH=um SUBARCH=x86_64

Gah, I did not build-test um. :(

>
> All errors (new ones prefixed by >>):
>
> In file included from arch/x86/include/asm/cacheflush.h:7,
> from include/linux/highmem.h:12,
> from net//core/sock.c:117:
> arch/x86/include/asm/special_insns.h: In function 'native_write_cr0':
> >> arch/x86/include/asm/special_insns.h:31:9: error: 'X86_CR0_WP' undeclared (first use in this function)
> val |= X86_CR0_WP;
> ^~~~~~~~~~

Should I just add something like:

#ifdef __arch_um__
# define X86_CR0_WP 0
#endif

?


--
Kees Cook