PartiCarver
Year: 2026
Type: conference-paper
Abstract: PartiCarver Artifact This repository contains the source code of PartiCarver, Version: 1.0.0. Abstract Program partitioning can improve software security by isolating code with different security requirements into separate components. We present PartiCarver, an optimization-guided partitioning approach for C programs. For more details please read our paper. Repository Structure The main PartiCarver implementation is located in the directories named PartiCarver. SVF provides the underlying program-analysis framework. PartiCarver-Zenodo-v1.0.0-reviewer/├── README.md Environment, build, and usage instructions├── VERSION Release version├── NOTICE.md Source and framework attribution├── COPYRIGHT-NOTICES.txt Preserved source notices├── Demo/ Minimal example and verification│ ├── program.c Example program│ ├── policy.json Example security policy│ ├── run.py Build and run both stages│ └── check_results.py Verify constraints and optimality└── SVF/ SVF framework and PartiCarver source code ├── CMakeLists.txt Top-level CMake configuration ├── .config.in Generated-header template ├── .config.cmake.in CMake package template ├── LICENSE.TXT SVF and third-party license notices ├── svf/ │ ├── include/PartiCarver/ PartiCarver interfaces and helpers │ │ ├── Partitioner.h Partitioning data structures │ │ ├── PartFlowDDA.h Pointer-analysis interface │ │ └── PartDDAVFSolver.h Value-flow solver implementation │ └── lib/PartiCarver/ PartiCarver core implementation │ ├── Partitioner.cpp Constraints, optimization, and refinement │ ├── PartFlowDDA.cpp Demand-driven pointer analysis │ ├── PartDDAClient.cpp Analysis-query management │ ├── PartDDAStat.cpp Analysis statistics │ ├── PartitionChecks.cpp Final partition checks and certificates │ └── AnalysisState.cpp Analysis-state summaries └── svf-llvm/tools/PartiCarver/ ├── PartiCarver.cpp Native main() entry point └── CMakeLists.txt particarver executable target Detailed Workflow (1) Prepare the environment Use Bash on Linux or WSL with the following dependencies: Dependency Requirement CMake 3.23 or later C/C++ compiler and Make C++17 support LLVM and Clang 16.0.4, including development headers and CMake configuration Z3 4.8.8, including the executable, C++ headers, and shared library Extract the archive and enter the project root. Replace the paths below with the absolute paths of your project and dependency installations. Use the same Bash session for the remaining steps. cd /path/to/PartiCarver-Zenodo-v1.0.0-reviewerPC_ROOT=$(pwd -P)PC_LLVM=/path/to/llvm-16.0.4PC_Z3=/path/to/z3-4.8.8cmake --versionc++ --version"$PC_LLVM/bin/llvm-config" --version"$PC_LLVM/bin/clang" --version"$PC_Z3/bin/z3" --version LLVM should report 16.0.4, and Z3 should report 4.8.8. The LLVM installation must contain lib/cmake/llvm/LLVMConfig.cmake. The Z3 installation must contain include/z3++.h and the matching libz3.so in bin/ or lib/. (2) Build the source code Configure the CMake project and build the particarver target: if [ -f "$PC_Z3/bin/libz3.so" ]; then PC_Z3_LIBRARY="$PC_Z3/bin/libz3.so"else PC_Z3_LIBRARY="$PC_Z3/lib/libz3.so"ficmake -S "$PC_ROOT/SVF" -B "$PC_ROOT/SVF/PartiCarver-build" \ -DCMAKE_BUILD_TYPE=Debug \ -DSVF_ENABLE_ASSERTIONS=ON \ -DBUILD_SHARED_LIBS=OFF \ -DLLVM_DIR="$PC_LLVM/lib/cmake/llvm" \ -DLLVM_CLANG="$PC_LLVM/bin/clang" \ -DZ3_DIR="$PC_Z3" \ -DZ3_INCLUDES="$PC_Z3/include" \ -DZ3_LIBRARIES="$PC_Z3_LIBRARY" \ -DCMAKE_BUILD_RPATH="$PC_Z3/bin;$PC_Z3/lib"cmake --build "$PC_ROOT/SVF/PartiCarver-build" \ --target particarver --parallel 2 A successful build generates: SVF/PartiCarver-build/bin/particarver PartiCarver executableSVF/PartiCarver-build/lib/extapi.bc SVF external-API analysis model Display the command-line options with: "$PC_ROOT/SVF/PartiCarver-build/bin/particarver" -help (3) Prepare the input PartiCarver takes LLVM bitcode and a JSON security policy. For a single C source file, generate bitcode with the selected Clang installation: "$PC_LLVM/bin/clang" -O0 -g -emit-llvm -c \ /absolute/path/to/program.c -o /absolute/path/to/program.bc For a multi-file program, compile the translation units to bitcode and combine them with the matching llvm-link before analysis. A policy declares components, sensitive values, and pinned functions. For example, a program with a global variable named secret and a function named main can use the following policy, saved as policy.json: { "components": ["Secure", "Public"], "sensitive-values": {"Secure": ["secret"]}, "pinned-functions": {"Secure": ["main"]}, "declassifiers": []} Replace the policy's symbol names with those in your program. The privileged component supplied to PartiCarver must match a component declared in the policy. (4) Run PartiCarver Set absolute paths for the bitcode and policy. Run the native executable from a fresh result directory so its generated files are collected in one place: PC_INPUT=/absolute/path/to/program.bcPC_POLICY=/absolute/path/to/policy.jsonPC_OUTPUT="$PC_ROOT/runs/program-all"mkdir -p "$PC_ROOT/runs"( set -e mkdir -- "$PC_OUTPUT" cd -- "$PC_OUTPUT" "$PC_ROOT/SVF/PartiCarver-build/bin/particarver" \ -dfs -clock-type=wall -stat=false \ -extapi="$PC_ROOT/SVF/PartiCarver-build/lib/extapi.bc" \ -particarver-policy-file="$PC_POLICY" \ -particarver-secure-component=Secure \ -particarver-ptr-params \ -particarver-opt-refine=guided \ -particarver-opt-refine-root-selection=guided \ -particarver-opt-refine-max-rounds=5 \ -particarver-opt-refine-min-gap=1 \ -particarver-opt-refine-time-budget=0 \ -particarver-opt-refine-random-seed=0 \ -particarver-opt-refine-query-mode=all \ "$PC_INPUT" > run.log 2>&1) Choose a different PC_OUTPUT for each run. The example uses guided refinement and at most five nonempty batches. The all query mode selects all currently untried legal roots associated with the selected blockers. For a finite budget, replace -particarver-opt-refine-query-mode=all with -particarver-opt-refine-query-mode=topk and add, for example, -particarver-opt-refine-topk=20. In this configuration, -particarver-ptr-params skips the same-component constraints for pointer-containing arguments and returns. Blocker selection checks each candidate constraint for a violating relaxed-optimal partition at the fixed minimum cost (Equation 8). The final partition is checked against the generated hard constraints for the selected configuration. (5) Inspect the analysis results The example writes its outputs to runs/program-all/. (6) Minimal demo With Python 3.8 or later, run from the project root: python3 Demo/run.py --llvm "$PC_LLVM" --z3 "$PC_Z3" The script builds and runs in a new temporary directory. Expected privileged IR instruction counts are 27 → 21 → 16: Stage 2 removes 6 instructions and Stage 3 removes 5 more. The demo uses k=all and n_max=5; its initial constraints are already satisfiable, so Stage 2's reduction comes from MO. To additionally verify optimality and that consumer can leave Secure only after Stage 3, use the output directory printed by the demo: python3 Demo/check_results.py /path/to/demo-output --z3 "$PC_Z3" Both final partitions must satisfy their full hard constraints. The additional checks report UNSAT for a lower-cost partition at either stage, and UNSAT/SAT for moving consumer outside Secure before/after Stage 3, respectively. Copyright and Licenses PartiCarver incorporates the SVF framework and bundled third-party components. Their original copyright and license notices are retained in SVF/LICENSE.TXT, component-specific license files, and COPYRIGHT-NOTICES.txt. See NOTICE.md for source attribution and the correspondence between historical source paths and the current PartiCarver directories.
Author: Anonymous
Language: English
Subfield: Hardware and Architecture
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7212161526
