x86/mm/pkeys: Fix fill_sig_info_pkey
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 4 Jan 2018 01:04:34 +0000 (19:04 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 12 Jan 2018 20:23:53 +0000 (14:23 -0600)
commit90bc9fb15942ad08b46cd003d8d1b51f3d43e322
treeafdec849db739ddb9cfc401a3acb1290bb845a37
parent6ac1dc736b323011a55ecd1fc5897c24c4f77cbd
x86/mm/pkeys: Fix fill_sig_info_pkey

SEGV_PKUERR is a signal specific si_code which happens to have the
same numeric value as several others: BUS_MCEERR_AR, ILL_ILLTRP,
FPE_FLTOVF, TRAP_HWBKPT, CLD_TRAPPED, POLL_ERR, SEGV_THREAD_ID,
as such it is not safe to just test the si_code the signal number
must also be tested to prevent a false positive in fill_sig_info_pkey.

I found this error by inspection, and BUS_MCEERR_AR appears to
be a real candidate for confusion.  So pass in si_signo and fix it.

Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Fixes: 019132ff3daf ("x86/mm/pkeys: Fill in pkey field in siginfo")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/x86/mm/fault.c