@@ -106,6 +106,8 @@ def __init__(self, mpstate):
106106 self .add_command ('internalerror_autopilot' , self .cmd_internalerror_autopilot , "cause internal error in autopilot" )
107107 self .add_command ('dfu_boot' , self .cmd_dfu_boot , "boot into DFU mode" )
108108 self .add_command ('deadlock' , self .cmd_deadlock , "trigger deadlock" )
109+ self .add_command ('nullptr_read' , self .cmd_nullptr_read , "read from a very low address" )
110+ self .add_command ('nullptr_write' , self .cmd_nullptr_write , "write to a very low address" )
109111 self .add_command ('batreset' , self .cmd_battery_reset , "reset battery remaining" )
110112 self .add_command ('setorigin' , self .cmd_setorigin , "set global origin" )
111113 self .add_command ('magsetfield' , self .cmd_magset_field , "set expected mag field by field" )
@@ -269,6 +271,14 @@ def cmd_deadlock(self, args):
269271 '''trigger a mutex deadlock'''
270272 self .cmd_dosomethingreallynastyto_autopilot (args , 'mutex-deadlock' , 100 )
271273
274+ def cmd_nullptr_write (self , args ):
275+ '''write to a low address (nullptr-deref)'''
276+ self .cmd_dosomethingreallynastyto_autopilot (args , 'nullptr-deref-write' , 102 )
277+
278+ def cmd_nullptr_read (self , args ):
279+ '''read from a low address (nullptr-deref)'''
280+ self .cmd_dosomethingreallynastyto_autopilot (args , 'nullptr-deref-read' , 103 )
281+
272282 def cmd_battery_reset (self , args ):
273283 '''reset battery remaining'''
274284 mask = - 1
0 commit comments