File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -340,10 +340,9 @@ class SrcSafetyAnalysis {
340340
341341 SrcState createEntryState () {
342342 SrcState S (NumRegs, RegsToTrackInstsFor.getNumTrackedRegisters ());
343- for (MCPhysReg Reg : BC.MIB ->getTrustedLiveInRegs ()) {
343+ for (MCPhysReg Reg : BC.MIB ->getTrustedLiveInRegs ())
344344 S.TrustedRegs |= BC.MIB ->getAliases (Reg, /* OnlySmaller=*/ true );
345- S.SafeToDerefRegs = S.TrustedRegs ;
346- }
345+ S.SafeToDerefRegs = S.TrustedRegs ;
347346 return S;
348347 }
349348
Original file line number Diff line number Diff line change @@ -491,7 +491,22 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
491491
492492 // If signing oracles are considered, the particular value left in the base
493493 // register after this instruction is important. This function checks that
494- // if the base register was overwritten, it is due to address write-back.
494+ // if the base register was overwritten, it is due to address write-back:
495+ //
496+ // ; good:
497+ // autdza x1 ; x1 is authenticated (may fail)
498+ // ldr x0, [x1, #8] ; x1 is checked and not changed
499+ // pacdzb x1
500+ //
501+ // ; also good:
502+ // autdza x1
503+ // ldr x0, [x1, #8]! ; x1 is checked and incremented by 8
504+ // pacdzb x1
505+ //
506+ // ; bad (the value being signed is not the authenticated one):
507+ // autdza x1
508+ // ldr x1, [x1, #8] ; x1 is overwritten with an unrelated value
509+ // pacdzb x1
495510 //
496511 // Note that this function is not needed for authentication oracles, as the
497512 // particular value left in the register after a successful memory access
You can’t perform that action at this time.
0 commit comments