Skip to content

Commit

Permalink
Cause applet crashes to hang indefinitely
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Mar 13, 2024
1 parent 40b8e51 commit 2892976
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
14 changes: 7 additions & 7 deletions trusted_os/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ func segfault(buf []byte, ctx *monitor.ExecCtx) (err error) {
}

func inspect(buf []byte, ctx *monitor.ExecCtx) (err error) {
if false {
log.Printf("PC\t%s", fileLine(buf, ctx.R15)) // PC
log.Printf("LR\t%s", fileLine(buf, ctx.R14)) // LR
log.Printf("PC\t%s", fileLine(buf, ctx.R15)) // PC
log.Printf("LR\t%s", fileLine(buf, ctx.R14)) // LR

switch ctx.ExceptionVector {
case arm.UNDEFINED, arm.PREFETCH_ABORT, arm.DATA_ABORT:
return segfault(buf, ctx)
}
switch ctx.ExceptionVector {
case arm.UNDEFINED, arm.PREFETCH_ABORT, arm.DATA_ABORT:
return segfault(buf, ctx)
}

// XXX block forever
<-make(chan bool, 1)
return
}
7 changes: 0 additions & 7 deletions trusted_os/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,6 @@ func main() {

// never returns
handleInterrupts()

if debug {
// We never hit this due to handleInterrupts not returning, but having this line here
// forces the linker to keep the symbol present which is necessary for the inspect()
// function to work for debug builds.
runtime.CallOnG0()
}
}

func createBundleVerifier(logOrigin string, logVerifier note.Verifier, manifestVerifiers []string) (firmware.BundleVerifier, error) {
Expand Down

0 comments on commit 2892976

Please sign in to comment.