Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
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
Container Registry
Model registry
Operate
Environments
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
Zipr Toolchain
Commits
ac2e1fa1
Commit
ac2e1fa1
authored
9 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
emit attribute for inferred function
Former-commit-id: 7f7c45f72f956351b7c2790624f1cd0dc43b3bbd
parent
45842de4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/do_cinderella.sh
+13
-0
13 additions, 0 deletions
tools/do_cinderella.sh
with
13 additions
and
0 deletions
tools/do_cinderella.sh
+
13
−
0
View file @
ac2e1fa1
...
...
@@ -13,6 +13,14 @@ LIBC_SEARCH_SPEC=$PEASOUP_HOME/tools/cinderella.spec
TMP
=
tmp.
$$
cinderella_malloc
=
"cinderella::malloc"
# $1 oldfn
# $2 newfn
function
emit_function_attribute
{
if
[
!
-z
$1
]
;
then
echo
"# ATTRIBUTE function_inferred=
${
1
}
,
${
2
}
"
fi
}
# infer CGC syscall wrappers
echo
"
$SECURITY_TRANSFORMS_HOME
/bin/infer_syscall_wrappers.exe
$ORIG_VARIANT_ID
"
$SECURITY_TRANSFORMS_HOME
/bin/infer_syscall_wrappers.exe
$ORIG_VARIANT_ID
...
...
@@ -66,6 +74,7 @@ do
newfn
=
"cinderella::
$fn
"
echo
"
$SECURITY_TRANSFORMS_HOME
/bin/rename_function.exe
$ORIG_VARIANT_ID
$oldfn
$newfn
"
$SECURITY_TRANSFORMS_HOME
/bin/rename_function.exe
$ORIG_VARIANT_ID
$oldfn
$newfn
emit_function_attribute
$oldfn
$newfn
fi
done
rm
$TMP
...
...
@@ -88,6 +97,7 @@ elif [ "$count_malloc" = "1" ]; then
oldfn
=
`
grep
-i
"positive malloc"
cinderella.static.pass1 |
cut
-d
' '
-f4
`
echo
"CINDERELLA PASS1: rename detected malloc fn to cinderella::malloc"
$SECURITY_TRANSFORMS_HOME
/bin/rename_function.exe
$ORIG_VARIANT_ID
$oldfn
$cinderella_malloc
emit_function_attribute
$oldfn
$cinderella_malloc
exit
0
fi
...
...
@@ -115,6 +125,7 @@ if [ "$count_malloc" = "1" ]; then
oldfn
=
`
grep
-i
"positive malloc"
cinderella.static.pass2 |
cut
-d
' '
-f4
`
echo
"CINDERELLA PASS2: rename detected malloc fn to cinderella::malloc"
$SECURITY_TRANSFORMS_HOME
/bin/rename_function.exe
$ORIG_VARIANT_ID
$oldfn
$cinderella_malloc
emit_function_attribute
$oldfn
$cinderella_malloc
exit
0
fi
...
...
@@ -136,6 +147,7 @@ if [ "$count_malloc" = "1" ]; then
oldfn
=
`
grep
-i
"positive malloc"
cinderella.static.pass3 |
cut
-d
' '
-f4
`
echo
"CINDERELLA PASS3: rename detected malloc fn to cinderella::malloc"
$SECURITY_TRANSFORMS_HOME
/bin/rename_function.exe
$ORIG_VARIANT_ID
$oldfn
$cinderella_malloc
emit_function_attribute
$oldfn
$cinderella_malloc
exit
0
fi
...
...
@@ -150,6 +162,7 @@ if [ "$count_malloc" = "1" ]; then
oldfn
=
`
grep
-i
"positive malloc"
cinderella.static.pass4 |
cut
-d
' '
-f4
`
echo
"CINDERELLA PASS4: rename detected malloc fn to cinderella::malloc"
$SECURITY_TRANSFORMS_HOME
/bin/rename_function.exe
$ORIG_VARIANT_ID
$oldfn
$cinderella_malloc
emit_function_attribute
$oldfn
$cinderella_malloc
exit
0
fi
...
...
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