ARM: 6252/1: Use SIGBUS for unaligned access instead of SIGILL
authorKirill A. Shutemov <kirill@shutemov.name>
Thu, 22 Jul 2010 12:16:49 +0000 (13:16 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 27 Jul 2010 09:43:49 +0000 (10:43 +0100)
POSIX specify to use signal SIGBUS with code BUS_ADRALN for invalid
address alignment.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/alignment.c
arch/arm/mm/fault.c

index 6f98c358989a63347a6a1150f99f25b52b106dbe..53a609680c1047dda20b33a4962df662f3d8f4c4 100644 (file)
@@ -924,8 +924,8 @@ static int __init alignment_init(void)
                ai_usermode = UM_FIXUP;
        }
 
-       hook_fault_code(1, do_alignment, SIGILL, "alignment exception");
-       hook_fault_code(3, do_alignment, SIGILL, "alignment exception");
+       hook_fault_code(1, do_alignment, SIGBUS, "alignment exception");
+       hook_fault_code(3, do_alignment, SIGBUS, "alignment exception");
 
        return 0;
 }
index cbfb2edcf7d12a3a1cae18f04c041d94dc055bcc..ce6f3a422c81e3c752389cedecfa15e13fd25f9a 100644 (file)
@@ -463,9 +463,9 @@ static struct fsr_info {
         * defines these to be "precise" aborts.
         */
        { do_bad,               SIGSEGV, 0,             "vector exception"                 },
-       { do_bad,               SIGILL,  BUS_ADRALN,    "alignment exception"              },
+       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment exception"              },
        { do_bad,               SIGKILL, 0,             "terminal exception"               },
-       { do_bad,               SIGILL,  BUS_ADRALN,    "alignment exception"              },
+       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment exception"              },
 /* Do we need runtime check ? */
 #if __LINUX_ARM_ARCH__ < 6
        { do_bad,               SIGBUS,  0,             "external abort on linefetch"      },