52
The DOVER Edge André DeHon [email protected] Eli Boling, Rishiyur Nikhil, Darius Rad, Julie Schwarz, Niraj Sharma, Joseph Stoy, Greg Sullivan, Andrew Sutherland Draper 7/13/2016 1 RISCV July 2016

dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

The  DOVER  EdgeAndré  DeHon  [email protected]  

Eli  Boling,  Rishiyur  Nikhil,  Darius  Rad,    Julie  Schwarz,  Niraj  Sharma,  Joseph  Stoy,    

Greg  Sullivan,  Andrew  Sutherland  

Draper  7/13/2016

1RISCV  July  2016

Page 2: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Question• How  handle  the  “edge”  of  a  tagged  system,where  necessary  to  deal  with    – I/O  to  the  untagged  world  

– Tag-­‐oblivious,  legacy  devices  and  drivers    

– Tag-­‐oblivious,  Direct-­‐Memory  Access  devices

RISCV  July  20162

Page 3: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DOVER=RISC-­‐V  +  PUMP  Software-­‐Defined Metadata  Processing  (SDMP)

3RISCV  July  2016

DataTag

Page 4: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DOVER=RISC-­‐V  +  PUMP  Software-­‐Defined Metadata  Processing  (SDMP)

• Add  metadata  tag  to  every  word  – Allows  us  to  know  information  about  data  word  

• Type,  where-­‐came-­‐from,  buffer,  secrecy

3RISCV  July  2016

DataTag

Page 5: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DOVER=RISC-­‐V  +  PUMP  Software-­‐Defined Metadata  Processing  (SDMP)

• Add  metadata  tag  to  every  word  – Allows  us  to  know  information  about  data  word  

• Type,  where-­‐came-­‐from,  buffer,  secrecy

• Mediate  every  instruction  by  checking  tags  – Allows  enforcement  of  safety/security  policies  

• Memory  safety,  CFI,  integrity,  information  flow

3RISCV  July  2016

DataTag

Page 6: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Challenge

RISCV  July  20164

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 7: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Challenge• Processor  not  only  entity  can  write  to  memory.

RISCV  July  20164

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 8: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Challenge• Processor  not  only  entity  can  write  to  memory.

• DMA  engines  for  performance  – E.g.,  networking,  graphics

RISCV  July  20164

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 9: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Challenge• Processor  not  only  entity  can  write  to  memory.

• DMA  engines  for  performance  – E.g.,  networking,  graphics

• Danger:  undermine  security  policies  – Write  over  OS  code  

– Read  secret  data

RISCV  July  20164

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 10: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Fine-­‐Grained  Slave  Device  Control

RISCV  July  20165

Page 11: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Fine-­‐Grained  Slave  Device  Control

• Tag  memory-­‐mapped  devices    – Use  to  write  rules  to  control  access

RISCV  July  20165

Page 12: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Fine-­‐Grained  Slave  Device  Control

• Tag  memory-­‐mapped  devices    – Use  to  write  rules  to  control  access

• Control  “who”  can  write  to  which  devices  – Which  code,  which  task  – not  just  kernel/user

RISCV  July  20165

Page 13: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Fine-­‐Grained  Slave  Device  Control

• Tag  memory-­‐mapped  devices    – Use  to  write  rules  to  control  access

• Control  “who”  can  write  to  which  devices  – Which  code,  which  task  – not  just  kernel/user

• Give  configuration  control  to  particular  drivers,  without  giving  the  driver  control  to  all  devices  or  other  privileges

RISCV  July  20165

Page 14: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Fine-­‐Grained  Slave  Device  Control

• Tag  memory-­‐mapped  devices    – Use  to  write  rules  to  control  access

• Control  “who”  can  write  to  which  devices  – Which  code,  which  task  – not  just  kernel/user

• Give  configuration  control  to  particular  drivers,  without  giving  the  driver  control  to  all  devices  or  other  privileges

• Mark  memory-­‐mapped  slave  data  as  untrusted  – and  by  source

RISCV  July  20165

Page 15: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DMA  IO  Policies

RISCV  July  20166

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 16: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DMA  IO  Policies

• Containment  -­‐-­‐  who's  allowed  to  read/write  buffer

RISCV  July  20166

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 17: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DMA  IO  Policies

• Containment  -­‐-­‐  who's  allowed  to  read/write  buffer• Integrity  –  mark  incoming  data  as  untrusted  

– At  least  until  validated

RISCV  July  20166

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 18: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DMA  IO  Policies

• Containment  -­‐-­‐  who's  allowed  to  read/write  buffer• Integrity  –  mark  incoming  data  as  untrusted  

– At  least  until  validated

• Secrecy  -­‐-­‐  not  allow  classified  data  to  exit  system    – Without  proper  encryption

RISCV  July  20166

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 19: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DMA  IO  Policies

• Containment  -­‐-­‐  who's  allowed  to  read/write  buffer• Integrity  –  mark  incoming  data  as  untrusted  

– At  least  until  validated

• Secrecy  -­‐-­‐  not  allow  classified  data  to  exit  system    – Without  proper  encryption

• Data  presence/synchronization    – only  grab  valid  data  – only  overwrite    empty  buffer    

• and  mark  as  non-­‐empty  when  write

RISCV  July  20166

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 20: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

SDMP  Policy  Function

RISCV  July  20167

Page 21: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

SDMP  Policy  Function

• Every  word  has  metadata

RISCV  July  20167

Page 22: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

SDMP  Policy  Function

• Every  word  has  metadata

• PUMP  is  a  function  from:  – Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag

RISCV  July  20167

Page 23: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

SDMP  Policy  Function

• Every  word  has  metadata

• PUMP  is  a  function  from:  – Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag

• To:  – Allowed?  

– PCtag  

– Resulttag  (RD,  memory  result)RISCV  July  2016

7

Page 24: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO

RISCV  July  20168

Page 25: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO• Same  function:  

Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag  

                     !  Allowed?,  PCtag,  Resulttag

RISCV  July  20168

Page 26: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO• Same  function:  

Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag  

                     !  Allowed?,  PCtag,  Resulttag

• Slave  devices  present  MRtag

RISCV  July  20168

Page 27: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO• Same  function:  

Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag  

                     !  Allowed?,  PCtag,  Resulttag

• Slave  devices  present  MRtag• Opcode:    {DMA-­‐load,                                      DMA-­‐store}

RISCV  July  20168

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 28: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO• Same  function:  

Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag  

                     !  Allowed?,  PCtag,  Resulttag

• Slave  devices  present  MRtag• Opcode:    {DMA-­‐load,                                      DMA-­‐store}

• PCtag  –  state  of  DMA

RISCV  July  20168

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 29: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO• Same  function:  

Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag  

                     !  Allowed?,  PCtag,  Resulttag

• Slave  devices  present  MRtag• Opcode:    {DMA-­‐load,                                      DMA-­‐store}

• PCtag  –  state  of  DMA

• Instrtag–  identify  DMA  source

RISCV  July  20168

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 30: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO• Same  function:  

Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag  

                     !  Allowed?,  PCtag,  Resulttag

• Slave  devices  present  MRtag• Opcode:    {DMA-­‐load,                                      DMA-­‐store}

• PCtag  –  state  of  DMA

• Instrtag–  identify  DMA  source

• RS1tag,  RS2tag  –  public,  untrusted

RISCV  July  20168

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 31: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Extend  for  IO• Same  function:  

Opcode,  PCtag,  Instrtag,  RS1tag,  RS2tag,  MRtag  

                     !  Allowed?,  PCtag,  Resulttag

• Slave  devices  present  MRtag• Opcode:    {DMA-­‐load,                                      DMA-­‐store}

• PCtag  –  state  of  DMA

• Instrtag–  identify  DMA  source

• RS1tag,  RS2tag  –  public,  untrusted

• MRtag,  Resulttag  –  on  memory  read/writtenRISCV  July  2016

8

SoC

Inter-connect Fabric

MemoryRISC-V CPU

IMMU/ICacheDMMU/DCache

DMA, and/ or other accelerators

Page 32: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Misbehavior  Models

RISCV  July  20169

Page 33: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Misbehavior  Models

• Execution  on  processor  !  halt  offending  process

RISCV  July  20169

Page 34: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Misbehavior  Models

• Execution  on  processor  !  halt  offending  process• DMA  not  necessarily  associated  with  a  process

RISCV  July  20169

Page 35: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Misbehavior  Models

• Execution  on  processor  !  halt  offending  process• DMA  not  necessarily  associated  with  a  process1. Disable  offending  device  

– Set  PCtag  for  device  to  DISABLED  

– Discard  all  operation  from  DISABLED  devices  – Requires  privileged  device  reset  to  re-­‐enable

RISCV  July  20169

Page 36: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Misbehavior  Models

• Execution  on  processor  !  halt  offending  process• DMA  not  necessarily  associated  with  a  process1. Disable  offending  device  

– Set  PCtag  for  device  to  DISABLED  

– Discard  all  operation  from  DISABLED  devices  – Requires  privileged  device  reset  to  re-­‐enable

2. Discard  offending  operation  – Set  Resulttag  to  DISCARD  

• Redact  data,  discard  write  

– Allow  device  to  continue

RISCV  July  20169

Page 37: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DOVER  SoC  Architecture

RISCV  July  201610

Page 38: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DMA  Validation  Architecture

RISCV  July  201611

Page 39: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

RISC-­‐V  Integration

RISCV  July  201612

Page 40: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

RISC-­‐V  Integration

• IOPUMP  generates  interrupt  on  Rule  Miss

RISCV  July  201612

Page 41: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

RISC-­‐V  Integration

• IOPUMP  generates  interrupt  on  Rule  Miss• Memory  mapped  devices  

– IOPUMP  – Device  Register  File

RISCV  July  201612

Page 42: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

RISC-­‐V  Integration

• IOPUMP  generates  interrupt  on  Rule  Miss• Memory  mapped  devices  

– IOPUMP  – Device  Register  File

• Device  tags  control  access  to  IOPUMP,  DeviceTagRF  – Setup  during  boot,  before  engage  PUMP

RISCV  July  201612

Page 43: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

RISC-­‐V  Integration

• IOPUMP  generates  interrupt  on  Rule  Miss• Memory  mapped  devices  

– IOPUMP  – Device  Register  File

• Device  tags  control  access  to  IOPUMP,  DeviceTagRF  – Setup  during  boot,  before  engage  PUMP

• IOPUMP  CSRs  similar  to  PUMP  CSRs  – Rule  inputs  and  outputs

RISCV  July  201612

Page 44: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Miss  Handler

RISCV  July  201613

Page 45: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Miss  Handler

• Uses  same  rule  function  as  Processor  /  PUMP  miss  handler

RISCV  July  201613

Page 46: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Miss  Handler

• Uses  same  rule  function  as  Processor  /  PUMP  miss  handler

• Dispatched  from  interrupt

RISCV  July  201613

Page 47: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Miss  Handler

• Uses  same  rule  function  as  Processor  /  PUMP  miss  handler

• Dispatched  from  interrupt

• Insertion  into    – Memory-­‐mapped  IOPUMP  CSRs    

– Instead  of  RISC-­‐V  PUMP  CSRs

RISCV  July  201613

Page 48: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Conclusions

RISCV  July  201614

Page 49: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Conclusions

• Complete  protection,  must  manage,  the  Edge  of  the  tagged  metadata  system

RISCV  July  201614

Page 50: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Conclusions

• Complete  protection,  must  manage,  the  Edge  of  the  tagged  metadata  system

• Complete,  Fine-­‐Grained  Mediation    – For  all  actors,  including  DMA  IO

RISCV  July  201614

Page 51: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

Conclusions

• Complete  protection,  must  manage,  the  Edge  of  the  tagged  metadata  system

• Complete,  Fine-­‐Grained  Mediation    – For  all  actors,  including  DMA  IO

• Maintain  uniform  SDMP  model  to  the  Edge  – Slave  device  tags  

– Mediated  DMA

RISCV  July  201614

Page 52: dover edge jul2016 v2€¦ · DOVER=RISCVV&+PUMP& SoftwareVDefined MetadataProcessing&(SDMP) 3 RISCV&July&2016 Tag Data

DOVER  SoC  Architecture

RISCV  July  201615