Skip to content
Snippets Groups Projects
Commit 98469fa5 authored by Jason Hiser's avatar Jason Hiser
Browse files

Merge branch 'master' of git.zephyr-software.com:allnp/security_transforms

Former-commit-id: 2487b85f261c68838437c09ffbaa8c357bb68127
parents 45441692 d400fb82
No related branches found
No related tags found
No related merge requests found
before_script:
- "source ~gitlab-runner/cicd_support/cicd_support.shinc"
after_script:
- "echo Test Complete."
stages:
- clean
- build
- test
#
# Cleaning
#
#template
.do-clean: &do-nightly-clean
stage: clean
script:
- ./cicd_tests/do-clean.sh
# per os items
do-nightly-clean-ubuntu18:
<<: *do-nightly-clean
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
do-nightly-clean-ubuntu16:
<<: *do-nightly-clean
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
do-nightly-clean-centos75:
<<: *do-nightly-clean
tags:
- centos75
variables:
OS: 'centos75'
#
# building
#
# template
.do-build: &do-build
stage: build
script:
- ./cicd_tests/do-build.sh
# per os items
do-build-ubuntu18:
<<: *do-build
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
do-build-ubuntu16:
<<: *do-build
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
do-build-centos75:
<<: *do-build
tags:
- centos75
variables:
OS: 'centos75'
#
# $PSZ ls
#
# template
.xform-ls: &xform-ls
stage: test
script:
- ./cicd_tests/xform-ls.sh
#per OS
xform-ls-ubuntu18:
<<: *xform-ls
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
xform-ls-ubuntu16:
<<: *xform-ls
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
xform-ls-centos75:
<<: *xform-ls
tags:
- centos75
variables:
OS: 'centos75'
#
# $PSZ cat
#
# template
.xform-cat: &xform-cat
stage: test
script:
- ./cicd_tests/xform-cat.sh
xform-cat-ubuntu18:
<<: *xform-cat
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
xform-cat-ubuntu16:
<<: *xform-cat
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
xform-cat-centos75:
<<: *xform-cat
tags:
- centos75
variables:
OS: 'centos75'
#!/bin/bash
if [ `uname -s` = 'SunOS' ]; then
# SunOS == solaris == different compiler by default.
export CC="cc -I/opt/csw/include -L /opt/csw/lib/ -g"
export CXX="CC -I/opt/csw/include -L /opt/csw/lib/ -g"
fi
#sanity check
if [ $SECURITY_TRANSFORMS_HOME"X" = "X" ]; then
echo Please set SECURITY_TRANSFORMS_HOME properly
exit
fi
# make everything
cd $SECURITY_TRANSFORMS_HOME
echo "Build transformer library + associated tools"
make all -f Makefile
#/bin/bash
set -e
set -x
main()
{
# gather info for debugging later, probably not necessary
pwd
hostname
whoami
env|grep "^CICD"
git submodule sync
git submodule update --init --recursive
local orig_dir=$(pwd)
# puts peasoup_umbrella (and all submodules) in CICD_MODULE_WORK_DIR
cicd_setup_module_dependency allnp/peasoup_umbrella.git
# puts the version of security_transforms to test in peasoup_umbrella/security_transforms
cicd_put_module_in_tree peasoup_umbrella/security_transforms
# Build/run $PSZ, test result
cd $CICD_MODULE_WORK_DIR/peasoup_umbrella
source set_env_vars
sudo ./get-peasoup-packages.sh all
# remove pedi files so that rebuilding includes re-doing pedi setup.
$PEDI_HOME/pedi -c -m manifest.txt || true # ignore errors in cleanup
./build-all.sh
dropdb $PGDATABASE 2>/dev/null || true ; ./postgres_setup.sh
cd $orig_dir
}
main "$@"
#/bin/bash
set -e
set -x
main()
{
# gather info for debugging later, probably not necessary
pwd
hostname
whoami
env|grep "^CICD"
if [[ $CICD_NIGHTLY == 1 ]] ; then
rm -rf $CICD_MODULE_WORK_DIR/peasoup_umbrella
fi
}
main "$@"
cd $CICD_MODULE_WORK_DIR/peasoup_umbrella
set -e
set -x
source set_env_vars
cd /tmp
rm -rf cat.rida ped_cat;
$PSZ $(which cat) ./cat.rida -c rida=on -s meds_static=off -c p1transform=on --tempdir ped_cat || true
if [[ ! -x ./cat.rida ]]; then cat ped_cat/logs/*; fi
./cat.rida /dev/null
#!/bin/bash
set -e
set -x
cd $CICD_MODULE_WORK_DIR/peasoup_umbrella
source set_env_vars
cd /tmp
rm -rf ls.rida ped_ls
$PSZ /bin/ls ./ls.rida -c rida=on -s meds_static=off -c p1transform=on --tempdir ped_ls || true
if [[ ! -x ./ls.rida ]]; then cat ped_ls/logs/*; fi
rm -rf ped_ls
./ls.rida
#!/bin/sh
rm -Rf lib bin tools/meds2pdb/meds2pdb tools/spasm/spasm tools/transforms/nulltransform tools/transforms/p1transform include/ELFTypes.h include/ELFIO.h include/ELFI.h include/ELFO.h libIRDB/include/dbinterface.htpp libIRDB/include/basics.htpp ELFIO-1.0.3/config.log ELFIO-1.0.3/config.status ELFIO-1.0.3/autom4te.cache ELFIO-1.0.3/Makefile ELFIO-1.0.3/ELFIO/.deps ELFIO-1.0.3/ELFIO/Makefile ELFIO-1.0.3/doc/Makefile ELFIO-1.0.3/Examples/Makefile ELFIO-1.0.3/Examples/tutorial/Makefile ELFIO-1.0.3/Examples/WriteObj/WriteObj ELFIO-1.0.3/Examples/WriteObj/.deps ELFIO-1.0.3/Examples/WriteObj/Makefile ELFIO-1.0.3/Examples/RelocationTable/RelocationTable ELFIO-1.0.3/Examples/RelocationTable/.deps ELFIO-1.0.3/Examples/RelocationTable/Makefile ELFIO-1.0.3/Examples/WriteObj2/WriteObj2 ELFIO-1.0.3/Examples/WriteObj2/.deps ELFIO-1.0.3/Examples/WriteObj2/Makefile ELFIO-1.0.3/Examples/ELFDump/.deps ELFIO-1.0.3/Examples/ELFDump/ELFDump ELFIO-1.0.3/Examples/ELFDump/Makefile ELFIO-1.0.3/Examples/Writer/.deps ELFIO-1.0.3/Examples/Writer/Writer ELFIO-1.0.3/Examples/Writer/Makefile beaengine/CMakeCache.txt beaengine/cmake_install.cmake beaengine/Makefile beaengine/CMakeFiles/CMakeOutput.log beaengine/CMakeFiles/CMakeDirectoryInformation.cmake beaengine/CMakeFiles/CompilerIdC beaengine/CMakeFiles/Makefile.cmake beaengine/CMakeFiles/Makefile2 beaengine/CMakeFiles/TargetDirectories.txt beaengine/CMakeFiles/CMakeTmp beaengine/CMakeFiles/CMakeSystem.cmake beaengine/CMakeFiles/CompilerIdCXX beaengine/obj/Linux.gnu.Debug/beaengineSources/cmake_install.cmake beaengine/obj/Linux.gnu.Debug/beaengineSources/Makefile beaengine/obj/Linux.gnu.Debug/beaengineSources/CMakeFiles/CMakeDirectoryInformation.cmake beaengine/obj/Linux.gnu.Debug/beaengineSources/CMakeFiles/BeaEngine_s_d.dir/flags.make beaengine/obj/Linux.gnu.Debug/beaengineSources/CMakeFiles/BeaEngine_s_d.dir/C.includecache beaengine/obj/Linux.gnu.Debug/beaengineSources/CMakeFiles/BeaEngine_s_d.dir/depend.internal beaengine/obj/Linux.gnu.Debug/beaengineSources/CMakeFiles/BeaEngine_s_d.dir/DependInfo.cmake beaengine/obj/Linux.gnu.Debug/beaengineSources/CMakeFiles/BeaEngine_s_d.dir/build.make
cd $SECURITY_TRANSFORMS_HOME
make clean -f Makefile
......@@ -32,6 +32,7 @@
#include "MEDS_DeadRegAnnotation.hpp"
#include "MEDS_IBAnnotation.hpp"
#include "MEDS_IBTAnnotation.hpp"
#include "MEDS_MemoryRangeAnnotation.hpp"
// @todo: multiple annotation per instruction
......@@ -104,7 +105,7 @@ void MEDS_AnnotationParser::parseFile(istream &p_inputStream)
if(add_if_valid<MEDS_FuncExitAnnotation>(line)) continue;
if(add_if_valid<MEDS_IBAnnotation>(line)) continue;
if(add_if_valid<MEDS_IBTAnnotation>(line)) continue;
if (add_if_valid<MEDS_MemoryRangeAnnotation>(line)) continue;
}
}
......
......@@ -23,8 +23,7 @@
#include <cstdio>
#include <string>
#include <string.h>
#include <cstdint>
#include <inttypes.h>
#include <cinttypes>
#include "MEDS_MemoryRangeAnnotation.hpp"
......@@ -88,11 +87,30 @@ void MEDS_MemoryRangeAnnotation::parse()
// 417748 12 INSTR STATICMEMWRITE MIN 3c60320 LIMIT 4e53730 ZZ
// 4992ea 4 INSTR STACKMEMRANGE MIN RSP - 568 LIMIT RSP - 48 INSTRSPDELTA - 592 ZZ
int ItemsFilled = sscanf(m_rawInputLine.c_str(), "%*x %d %*s %*s MIN %" SCNu64 " LIMIT %" SCNu64 "", &instrSize, &MinVal, &LimitVal);
if (3 != ItemsFilled) {
if (this->isStaticGlobalRange()) {
int ItemsFilled = sscanf(m_rawInputLine.c_str(), "%*x %d %*s %*s MIN %" SCNx64 " LIMIT %" SCNx64, &instrSize, &MinVal, &LimitVal);
if (3 != ItemsFilled) {
this->setInvalid();
cerr << "Error on sscanf of annotation: ItemsFilled = " << ItemsFilled << " line: " << m_rawInputLine << endl;
return;
}
else {
cerr << "Parsed STATICMEMWRITE annotation: MIN = " << hex << MinVal << " LIMIT = " << LimitVal << endl;
}
}
else {
#if 0
int ItemsFilled = sscanf(m_rawInputLine.c_str(), "%*x %d %*s %*s MIN %" SCNx64 " LIMIT %" SCNx64, &instrSize, &MinVal, &LimitVal);
if (3 != ItemsFilled) {
this->setInvalid();
cerr << "Error on sscanf of annotation: ItemsFilled = " << ItemsFilled << " line: " << m_rawInputLine << endl;
return;
}
#else
this->setInvalid();
cerr << "Error on sscanf of annotation" << endl;
cerr << "Not yet parsing STACKMEMRANGE annotations " << endl;
return;
#endif
}
this->setInstructionSize(instrSize); // in base class
......
Subproject commit 5fe925b21b9b2c227ad79a98efb9b890af2d1247
Subproject commit 844394fefeb8197007510824e71c905dafb0e5d9
directory plugins_install ps
directory bin ps
directory lib ps
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment