Re: [PATCH 0/3] [RFC] x86: start the MPX removal process

From: Borislav Petkov
Date: Thu Jan 23 2020 - 06:23:37 EST


On Wed, Jan 22, 2020 at 10:14:58AM -0800, Dave Hansen wrote:
> Here's an updated tree:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-mpx.git/log/?h=mpx-remove-202001
>
> Very lightly tested.

Thx.

So I merged tip/master into it and did some build smoke testing. The
only issue I found is below which happens with an allnoconfig build and
the fix is simple:

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 34360ca301a2..e8133c0e7799 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -21,6 +21,7 @@
#include <asm/pgtable.h>
#include <asm/mce.h>
#include <asm/nmi.h>
+#include <asm/insn.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
#include <asm/io.h>

as apparently the include hell needs to be satisfied again. :)

You could fold it into one of your 4 patches so that you don't break
bisection and then either send the pull request directly to Linus next
week or I can do that - I'm fine with either.

Provided, of course, there are no other complaints.

Thx.

---
arch/x86/kernel/alternative.c: In function âtext_poke_loc_initâ:
arch/x86/kernel/alternative.c:1172:14: error: storage size of âinsnâ isnât known
1172 | struct insn insn;
| ^~~~
arch/x86/kernel/alternative.c:1178:2: error: implicit declaration of function âkernel_insn_initâ; did you mean âkernfs_initâ? [-Werror=implicit-function-declaration]
1178 | kernel_insn_init(&insn, emulate, MAX_INSN_SIZE);
| ^~~~~~~~~~~~~~~~
| kernfs_init
arch/x86/kernel/alternative.c:1178:35: error: âMAX_INSN_SIZEâ undeclared (first use in this function); did you mean âCALL_INSN_SIZEâ?
1178 | kernel_insn_init(&insn, emulate, MAX_INSN_SIZE);
| ^~~~~~~~~~~~~
| CALL_INSN_SIZE
arch/x86/kernel/alternative.c:1178:35: note: each undeclared identifier is reported only once for each function it appears in
arch/x86/kernel/alternative.c:1179:2: error: implicit declaration of function âinsn_get_lengthâ [-Werror=implicit-function-declaration]
1179 | insn_get_length(&insn);
| ^~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:43,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from ./include/linux/list.h:9,
from ./include/linux/module.h:12,
from arch/x86/kernel/alternative.c:4:
arch/x86/kernel/alternative.c:1181:10: error: implicit declaration of function âinsn_completeâ; did you mean âcompleteâ? [-Werror=implicit-function-declaration]
1181 | BUG_ON(!insn_complete(&insn));
| ^~~~~~~~~~~~~
./include/linux/compiler.h:78:42: note: in definition of macro âunlikelyâ
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
arch/x86/kernel/alternative.c:1181:2: note: in expansion of macro âBUG_ONâ
1181 | BUG_ON(!insn_complete(&insn));
| ^~~~~~
arch/x86/kernel/alternative.c:1172:14: warning: unused variable âinsnâ [-Wunused-variable]
1172 | struct insn insn;
| ^~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:266: arch/x86/kernel/alternative.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:503: arch/x86/kernel] Error 2
make: *** [Makefile:1694: arch/x86] Error 2
make: *** Waiting for unfinished jobs....



--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette