Commit 7289ddae authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Improve sanity checks in default_unwind_handler

Detail:
  kernel/s/k_body - Now ignores unaligned PC values, as they either indicate stack corruption or Thumb use (which the unwind handler doesn't support anyway)
Admin:
  Tested on Raspberry Pi with high processor vectors


Version 5.70. Tagged as 'RISC_OSLib-5_70'
parent 27bebb79
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.69"
Module_Version SETA 569
Module_MajorVersion SETS "5.70"
Module_Version SETA 570
Module_MinorVersion SETS ""
Module_Date SETS "11 Jun 2012"
Module_ApplicationDate SETS "11-Jun-12"
Module_Date SETS "27 Jun 2012"
Module_ApplicationDate SETS "27-Jun-12"
Module_ComponentName SETS "RISC_OSLib"
Module_ComponentPath SETS "castle/RiscOS/Sources/Lib/RISC_OSLib"
Module_FullVersion SETS "5.69"
Module_HelpVersion SETS "5.69 (11 Jun 2012)"
Module_FullVersion SETS "5.70"
Module_HelpVersion SETS "5.70 (27 Jun 2012)"
END
/* (5.69)
/* (5.70)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.69
#define Module_MajorVersion_CMHG 5.70
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Jun 2012
#define Module_Date_CMHG 27 Jun 2012
#define Module_MajorVersion "5.69"
#define Module_Version 569
#define Module_MajorVersion "5.70"
#define Module_Version 570
#define Module_MinorVersion ""
#define Module_Date "11 Jun 2012"
#define Module_Date "27 Jun 2012"
#define Module_ApplicationDate "11-Jun-12"
#define Module_ApplicationDate "27-Jun-12"
#define Module_ComponentName "RISC_OSLib"
#define Module_ComponentPath "castle/RiscOS/Sources/Lib/RISC_OSLib"
#define Module_FullVersion "5.69"
#define Module_HelpVersion "5.69 (11 Jun 2012)"
#define Module_LibraryVersionInfo "5:69"
#define Module_FullVersion "5.70"
#define Module_HelpVersion "5.70 (27 Jun 2012)"
#define Module_LibraryVersionInfo "5:70"
......@@ -1904,7 +1904,7 @@ default_unwind_handler Keep
BEQ duh_exit
; a minimal sensibleness check on the FP's value
; (bottom bit used to mark stack extension).
; (bottom bit used to mark stack extension, masked out above).
TST a4, #&00000002
BNE duh_corrupt
......@@ -1912,6 +1912,9 @@ default_unwind_handler Keep
LDR a3, [a4, #frame_entrypc]
RemovePSRFromReg a3, v1
TST a3, #3 ; If low bits of PC set...
BNE duh_corrupt ; ...then either stack corrupt or was in Thumb mode (and if Thumb, the STM check below will fail anyway)
STMFD sp!, {a1-a2}
MOV a1, #0
SWI XOS_PlatformFeatures
......@@ -1919,6 +1922,7 @@ default_unwind_handler Keep
TST a1, #8 ; Is it PC+8 or PC+12?
ADDNE a3, a3, #4
LDMFD sp!, {a1-a2}
LDR v1, [a3, #-12]
; check that the save mask instruction is indeed the right sort of STM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment