From a5244bac2ed512a56ed0ebe30ff719c5da772ef9 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 8 Jul 2014 08:05:42 +0000 Subject: [PATCH] Correct si_code for the SIGBUS signal generated by the alignment trap. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/trap.c | 4 ++++ sys/i386/i386/trap.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 0e5766678f6..c56b99e434b 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -313,6 +313,10 @@ trap(struct trapframe *frame) i = SIGBUS; ucode = BUS_OBJERR; break; + case T_ALIGNFLT: + i = SIGBUS; + ucode = BUS_ADRALN; + break; case T_DOUBLEFLT: /* double fault */ default: i = SIGBUS; diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 6e4aba2a213..5285b1d7458 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -366,6 +366,10 @@ trap(struct trapframe *frame) i = SIGBUS; ucode = BUS_OBJERR; break; + case T_ALIGNFLT: + i = SIGBUS; + ucode = BUS_ADRALN; + break; case T_DOUBLEFLT: /* double fault */ default: i = SIGBUS;