Skip to content

Commit

Permalink
Add try/except block when copying BARs in rogue_mmio_bar tool
Browse files Browse the repository at this point in the history
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
  • Loading branch information
npmitche committed Jul 30, 2024
1 parent 81052e8 commit fa9d06f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion chipsec/modules/tools/smm/rogue_mmio_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@ def smi_mmio_range_fuzz(self, thread_id, b, d, f, bar_off, is64bit, bar, new_bar
# copy all registers from MMIO range to new location in memory
# we do that once rather than before every SMI since we return after first change detected
self.logger.log(f'[*] copying BAR 0x{base:X} > 0x{self.reloc_mmio:X}')
orig_mmio = self.copy_bar(base, self.reloc_mmio, size)
try:
orig_mmio = self.copy_bar(base, self.reloc_mmio, size)
except Exception as e:
self.logger.log_failed('Unable to copy bar. Skipping.')
self.logger.log_verbose(str(e))
if self.cs.os_helper.is_windows():
self.logger.log_important('Try running in Linux for better coverage.')
return False

if self.logger.VERBOSE:
self.cs.mmio.dump_MMIO(base, size)
write_file('mmio_mem.orig', orig_mmio)
Expand Down

0 comments on commit fa9d06f

Please sign in to comment.