I am using memset in an embedded application to delete one data. here is the function:
uint8_t Delete()
{
memset(cure.name, 0x0, 32);
cure.volume = 0;
cure.valid=0;
printf("[*] Cure DELETED\n");
return 1;
}
and I am trying to evaluate it against fault injection attack (clock glitching). As I saw in my experiments after clock glitching memset overwrites the neighbor's memory blocks as well. (they have been filled by zeros). is there any safer (more secure) alternative function for memset that I could use? maybe an instruction which validates the destination block at all the copying step.
Thank you in advance for your help;
memset is a standard library function; it is unlikely to take into consideration intentionally generated hardware glitches. Firmware protection against these glitches appears to depend on:
I suspect you will have to write your own function to do this; you could add random delays within the loop for zeroing the memory, for example.
I do not know if this is sufficient. You may need more details about what in your system is vulnerable; what instruction is targeted, in order to also add verification code