Git Product home page Git Product logo

archie's People

Contributors

aewag avatar berkayurun avatar e-shreve-ti avatar elfalko avatar kag499 avatar ks0777 avatar lukasauer avatar tibersam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archie's Issues

Understanding trigger address setting and handling faulted instruction address that occur at the beginning of a TB

I'm seeing some issues with situations where the instruction to be faulted occurs at the start of a TB and a negative trigger_address is specified for the fault. If the instruction to be faulted occurs at the start of a TB then very frequently (perhaps always) ARCHIE either fails to find a trigger instruction or it finds a trigger instruction that executes after the instruction to be faulted.

It appears to me that search_for_fault_location() searches the wrong direction. goldenrun_tb_exec and goldenrun_tb_info are sorted such that the first index (index 0) is the last TB executed. Thus, to search earlier in the execution, the index value should be increased if the TB at the current index doesn't have the trigger location. However, on lines 62 and 88 the index is decreased.

Also, in case the trigger location is not found, the while loop should start with a check that the idx value does not equal or exceed the number of rows in the goldenrun TB data frames. (Or a try block should catch a ValueError when the idx is used in the call to find_tb_info_row.)

I can open a PR, but wanted to have a discussion first in case I am misunderstanding something.

Test ARCHIE as part of CI

  • Golden HDF5 result files based on generic test firmware
    • ARM based
    • RISC-V based
  • Unit tests (e.g. fault config parsing)
  • Benchmarks

Use of instruction overwrite to replace instruction before it is executed, with trigger address set to -1.

I've been unable to create a fault matching the description above. It seems that the combination of setting trigger_address to [-1] and trigger_counter to [0] is not a supported combination? Is there a way to do this? Here is an example fault description:

			{
				"fault_address"		: [134217962, 134217972, 1],
				"fault_type"		: "instruction",
				"fault_model"		: "overwrite",
				"fault_livespan"	        : [3],
				"fault_mask"		: [191], 
				"trigger_address"	: [-1],
				"trigger_counter"	: [0],
				"num_bytes"		: [2]
			}

Use explicit data types with pandas

Pandas may sometimes choose to convert large integers (close to 64-bit integer limit) to floats. This is very common on register dataset on 64-bit architecture and is fixed with #41. Similar situation in the code base should be fixed as well. This problem is likely to also occur if a target binary is mapped to a negative memory address (typical for kernels).

Allow to define a timeout for each experiment

Currently ARCHIE determines the end of an experiment by looking at the number of instructions that are encountered ("max_instruction_count") or by reaching a defined address ("end").

However, there are conditions where neither "max_instruction_count" is reached nor the address defined in "end" is reached:

  • A bug in the QEMU machine model was triggered by the fault injection. If the bug enters end endless loop in the host process, ARCHIE will never finish the experiments.
  • I encountered a case where an injected fault caused a write of the value "0xFFFFFFFD΅" to the SCTRL reg (ARMv7). QEMU continued to run, but the guest code was not executing anymore (probably due to the fact that paging was enabled but no valid pagetable was present). As QEMU did not execute any instructions "max_instruction_count" was never reached and the experiment was never finished.

Regards,

Robert

Missing *analysis* folder

From the hdf5-readme.md:

Analysis
An exemplary analysis script of the hdf5 output for an AES round skip and differential fault analysis can be found in the folder analysis.

but there is no analysis folder in the repo.

Optimized filtering

Current approach: Iterate through TBs sorted by size. More efficient approach needed.

Filter during runtime to reduce memory usage, see #11

Inconsistency between behavior and documentation: fault_livespan = 0

According to https://github.com/Fraunhofer-AISEC/archie/blob/master/fault-readme.md#fault_lifespan , "fault_lifespan" + "trigger_address" must be larger than, or equal to "0" if "trigger_address" is negative, otherwise ARCHIE will issue a warning and remove the fault:

If the trigger_address is set to a negative number, trigger_address + fault_lifespan must be larger or equal to 0. Otherwise ARCHIE will remove the fault configuration with a warning. In addition, the fault_lifespan is automatically reduced if the trigger address is calculated to be before the start point.

However, with this fault.json I don't see any warning although "trigger_address" is negative and "trigger_address" + "fault_lifespan" < 0:

{
  "max_instruction_count" : 1000,
	"start" : {
		"address" : 0xffff0000,
		"counter" : 0
	},
	"end" : {
    "address" : 0xffff06b0,
		"counter" : 0
	},
	"faults" :[	
			[
				{
					"fault_address"		: [0xffff47C8, 0xffff4888, 4],
					"fault_type"		: "instruction",
					"fault_model"		: "overwrite",
					"fault_lifespan"	: [0],
          // fault_mask = bytes to insert: ARMv7 NOP
					"fault_mask"		: [0xE320F000], 
					"trigger_address"	: [-1],
					"trigger_counter"	: [0],
					"num_bytes"		: [4]
				}
			]
		],
}

Also, it seems both "fault_lifespan" and "fault_livespan" are used throughout the code/documentation and examples. This is rather confusing.

Regards,

Robert

Faultconfig is not filtered if end is not set

If the "end" keyword is not used in the fault.json, which is valid behavior as defined in the fault-readme.md, the filtering of the faultconfig, which is at [1], is not executed.

I am not sure if this is done on purpose, but I would guess filtering is as well wanted when only using "start" and "max_instruction_count" values.

EDIT: I may fail to understand how this works as I also don't get how the goldenrun_data is created in some cases: a) start and max_instruction_count or b) max_instruction_count defined. The max_instruction_count set by the user is not used, but a huge predefined number.

[1] https://github.com/Fraunhofer-AISEC/archie/blob/master/goldenrun.py#L89

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.