MPX is broken for 32bit programs on a 64bit host

From: Sebastian Andrzej Siewior
Date: Thu Nov 29 2018 - 10:01:54 EST


so I've been testing my FPU patches and noticed that the test
mpx-mini-test_32 [0] fails on 64bit host.
I went back to v4.4 and it didn't pass there fully, it ended with:
| starting mpx bounds table test
| ERROR: siginfo bounds do not match shadow bounds for register 0

But it did way more than it does today. Since commit 1b028f784e8c3
("x86/mm: Introduce mmap_compat_base() for 32-bit mmap()") it is broken
and ends very early with

| mpx dig ( 1) complete, SUCCESS ( 0 / 0)
| #BR status == 2, missing bounds table,kernel should have handled!!

The 64bit cases passes. Didn't try the 32bit test case on a 32bit host.
Maybe the test case is fishy (I can't tell).

This is broken since v4.12-rc1. This is known [1] since April this year.
Should I send a removal patch for MPX or is someone actually going to
fix this? Or do we wait for gcc-9 to be released?

[0] tools/testing/selftests/x86/mpx-mini-test_32
[1] https://lkml.kernel.org/r/20180428175043.y35czmhcursyrzsy@xxxxxxxxx

Sebastian