Input fuzzing on TLUL
For security concern, we may need to think of how to randomly drive any data on TLUL interface and check it doesn't break anything. In current TLUL error cases, we only cover defined cases (like OOB, unaligned address etc).
There are 2 items we may want to further discuss
-
if device doesn't response or returns with wrong source ID, the TLUL bus will hang. @cdgori suggested we might implement a timeout in design and return garbage data or all 1s/0s when it times out. But this violates the TLUL protocol. @eunchan what do you think?
-
if we randomly drive data on TLUL, some other protocol violations will happen, like outstanding items can't use same source ID. We report assertion error for most of these violations and may need to define what correct design behavior are when those happen.
I have to admit i'm very conflicted about this. For one, anything that causes the fabric to lock-up permanently should in theory be covered by the host timeout mechanism ( https://drive.google.com/drive/u/1/folders/1rptAyxoz6ciZ_Y751IbQPIZfg7fI6bY9 ). Another is that there are so many possibilities in locking up the fabric i'm not sure it is possible to design them all away
Chris could you chime in with your thoughts?
In my opinion, when it comes to TLUL, there are a few things that matter most
- The glitch "after" pmp scenario - This one we talked about before, and I am still not sure how we cover it outside of generic detectors and possibly parity for address / IDs / attributes etc
- Random activity (fuzzing for example) causes a peripheral to issue an unexpected tlul command or an unexpected tlul response.
The former i think is why we need iopmps, and we do plan to have them. So at least the damage can be sandboxed. The latter might actually be something we want to fuzz (although I think our existing assertions might already cover this case). There was also the list of oob activity we discussed sometime last year...and i'm really not sure trying to cover more in design would be wise...
On Wed, Mar 18, 2020 at 6:26 PM weicaiyang [email protected] wrote:
Assigned #1786 https://github.com/lowRISC/opentitan/issues/1786 to @tjaychen https://github.com/tjaychen.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/lowRISC/opentitan/issues/1786#event-3143725809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2RSRNTLGESNPYKUVWI2DRIFYDPANCNFSM4LO6GBJQ .
Related question, should I implement input fuzzing separately in the Ibex testbench, since no testing will be done on the core with the TLUL adapter logic?
@tjaychen sorry for bringing this again. Not sure if we have more clear picture about this issue. We have some timers in our design. Will we use them to make sure when the fabric is locked up, design can probably handle that, such as inform SW or reset it. Or do we plan to add some logic in xbar to handle the lock-up?
For one, anything that causes the fabric to lock-up permanently should in theory be covered by the host timeout mechanism
hey all, the current direction is that if the fabric locks up (for any reason), the watchdog timer will eventually kick in and reboot the system.
hey all, the current direction is that if the fabric locks up (for any reason), the watchdog timer will eventually kick in and reboot the system.
sounds good. Looks like no additional logic is needed in xbar. let me close this issue. thanks Tim.