x86, mpx: fix 32-bit address space calculation
From: Dave Hansen <email@example.com>
I received a bug report that running 32-bit MPX binaries on 64-bit
kernels was broken. I traced it down to this little code snippet.
We were switching our "number of bounds directory entries"
calculation correctly. But, we didn't switch the other side of
the calculation: the virtual space size.
This meant that we were calculating an absurd size for
bd_entry_virt_space() on 32-bit because we used the 64-bit
Correct that and properly handle all 3 possible cases:
1. 32-bit binary on 64-bit kernel
2. 64-bit binary on 64-bit kernel
3. 32-bit binary on 32-bit kernel
Signed-off-by: Dave Hansen <firstname.lastname@example.org>
1 file changed