Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CFI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
CFI
Commits
62e0a8df
Commit
62e0a8df
authored
6 years ago
by
Matthew McGill
Browse files
Options
Downloads
Patches
Plain Diff
Further changes were needed
parent
30f044a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nonce_relocs.cpp
+21
-2
21 additions, 2 deletions
nonce_relocs.cpp
with
21 additions
and
2 deletions
nonce_relocs.cpp
+
21
−
2
View file @
62e0a8df
...
...
@@ -903,7 +903,16 @@ size_t NonceRelocs_t::DollopEntryOpeningSize(DollopEntry_t* entry)
if
(
!
m_on
)
return
0
;
if
(
entry
->
Instruction
()
->
GetIndirectBranchTargetAddress
()
==
NULL
)
bool
isPinnedIBT
=
(
entry
->
Instruction
()
->
GetIndirectBranchTargetAddress
()
!=
NULL
)
&&
(
entry
->
Instruction
()
->
GetIndirectBranchTargetAddress
()
->
GetVirtualOffset
()
!=
0
);
// For correctness, we have to put non-exe nonces on unpinned IBTs
// even if they have an exe nonce reloc,
// because its possible that a plt-style jump targets a return site.
// However I've never seen that, so at this point essentially all
// unpinned IBTs with an exe nonce relocation don't need a non-exe nonce.
// Should we ignore the never-seen weird case to lower overhead?
if
(
!
isPinnedIBT
)
return
get_cfi_space
(
entry
->
Instruction
());
return
0
;
...
...
@@ -1049,7 +1058,17 @@ RangeAddress_t NonceRelocs_t::PlopDollopEntry(Zipr_SDK::DollopEntry_t *de,
}
// put down nonces and instruction
if
(
get_cfi_space
(
insn
)
>
0
&&
insn
->
GetIndirectBranchTargetAddress
()
==
NULL
)
bool
isPinnedIBT
=
(
insn
->
GetIndirectBranchTargetAddress
()
!=
NULL
)
&&
(
insn
->
GetIndirectBranchTargetAddress
()
->
GetVirtualOffset
()
!=
0
);
// For correctness, we have to put non-exe nonces on unpinned IBTs
// even if they have an exe nonce reloc,
// because its possible that a plt-style jump targets a return site.
// However I've never seen that, so at this point essentially all
// unpinned IBTs with an exe nonce relocation don't need a non-exe nonce.
// Should we ignore the never-seen weird case to lower overhead?
if
(
get_cfi_space
(
insn
)
>
0
&&
!
isPinnedIBT
)
{
unsigned
int
cfi_space
=
get_cfi_space
(
insn
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment