svn commit: r475144 - in head/security: . klee klee/files

Yuri Victorovich yuri at FreeBSD.org
Mon Jul 23 03:19:28 UTC 2018


Author: yuri
Date: Mon Jul 23 03:19:26 2018
New Revision: 475144
URL: https://svnweb.freebsd.org/changeset/ports/475144

Log:
  New port: security/klee: Symbolic virtual machine built on top of the LLVM
  
  PR:		219150
  Submitted by:	larca <itbot at list.ru>

Added:
  head/security/klee/
  head/security/klee/Makefile   (contents, props changed)
  head/security/klee/distinfo   (contents, props changed)
  head/security/klee/files/
  head/security/klee/files/patch-CMakeLists.txt   (contents, props changed)
  head/security/klee/files/patch-cmake_find__stp.cmake   (contents, props changed)
  head/security/klee/files/patch-lib_Core_Executor.cpp   (contents, props changed)
  head/security/klee/pkg-descr   (contents, props changed)
  head/security/klee/pkg-plist   (contents, props changed)
Modified:
  head/security/Makefile

Modified: head/security/Makefile
==============================================================================
--- head/security/Makefile	Mon Jul 23 03:19:25 2018	(r475143)
+++ head/security/Makefile	Mon Jul 23 03:19:26 2018	(r475144)
@@ -309,6 +309,7 @@
     SUBDIR += kgpg
     SUBDIR += kgpg-kde4
     SUBDIR += kickpass
+    SUBDIR += klee
     SUBDIR += kleopatra
     SUBDIR += knock
     SUBDIR += knocker

Added: head/security/klee/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/klee/Makefile	Mon Jul 23 03:19:26 2018	(r475144)
@@ -0,0 +1,49 @@
+# $FreeBSD$
+
+PORTNAME=	klee
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.4.0-191
+DISTVERSIONSUFFIX=	-g79ac709
+CATEGORIES=	security devel
+
+MAINTAINER=	itbot at bk.ru
+COMMENT=	Symbolic virtual machine built on top of the LLVM
+
+LICENSE=	NCSA
+LICENSE_FILE=	${WRKSRC}/LICENSE.TXT
+
+BUILD_DEPENDS=	llvm-config${LLVM_VERSION}:devel/llvm${LLVM_VERSION} \
+		gmake:devel/gmake
+
+LLVM_VERSION=	38 # the latest llvm version that the master branch (79ac709) currently supports
+
+USES=		cmake:outsource localbase pkgconfig python:run shebangfix
+USE_GITHUB=	yes
+SHEBANG_FILES=	tools/klee-stats/klee-stats tools/ktest-tool/ktest-tool
+USE_LDCONFIG=	yes
+
+CMAKE_OFF=	ENABLE_POSIX_RUNTIME ENABLE_UNIT_TESTS ENABLE_SYSTEM_TESTS
+CMAKE_ARGS=	-DLLVM_CONFIG_BINARY=${LOCALBASE}/bin/llvm-config${LLVM_VERSION} \
+		-DMAKE_BINARY=${LOCALBASE}/bin/gmake \
+		-DFREEBSD_STP_STATIC_LIBRARY:STRING=${LOCALBASE}/lib/libstp.a
+
+OPTIONS_DEFINE=		TCMALLOC
+OPTIONS_SINGLE=		SOLVER
+OPTIONS_SINGLE_SOLVER=	Z3 STP # TODO METASMT
+OPTIONS_DEFAULT=	TCMALLOC Z3
+SOLVER_DESC=		Solver: Use the
+
+TCMALLOC_DESC=		Use tcmalloc library for memory management
+TCMALLOC_CMAKE_BOOL=	ENABLE_TCMALLOC
+TCMALLOC_LIB_DEPENDS=	libtcmalloc.so:devel/google-perftools
+
+Z3_DESC=		Z3 SMT solver
+Z3_CMAKE_BOOL=		ENABLE_SOLVER_Z3
+Z3_BUILD_DEPENDS=	z3:math/z3
+Z3_RUN_DEPENDS=		z3:math/z3
+
+STP_DESC=		STP SMT solver
+STP_CMAKE_BOOL=		ENABLE_SOLVER_STP
+STP_BUILD_DEPENDS=	stp>0:math/stp
+
+.include <bsd.port.mk>

Added: head/security/klee/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/klee/distinfo	Mon Jul 23 03:19:26 2018	(r475144)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1532277676
+SHA256 (klee-klee-v1.4.0-191-g79ac709_GH0.tar.gz) = 92d57d88967e5615d5c806e52a427180b3ccd95a5b018c0bfab3e895b8b13111
+SIZE (klee-klee-v1.4.0-191-g79ac709_GH0.tar.gz) = 969253

Added: head/security/klee/files/patch-CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/klee/files/patch-CMakeLists.txt	Mon Jul 23 03:19:26 2018	(r475144)
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig	2018-07-12 22:25:49 UTC
++++ CMakeLists.txt
+@@ -412,7 +412,7 @@ endif()
+ ################################################################################
+ # Detect libcap
+ ################################################################################
+-check_include_file("sys/capability.h" HAVE_SYS_CAPABILITY_H)
++#check_include_file("sys/capability.h" HAVE_SYS_CAPABILITY_H)
+ if (HAVE_SYS_CAPABILITY_H)
+   find_library(LIBCAP_LIBRARIES
+     NAMES cap

Added: head/security/klee/files/patch-cmake_find__stp.cmake
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/klee/files/patch-cmake_find__stp.cmake	Mon Jul 23 03:19:26 2018	(r475144)
@@ -0,0 +1,11 @@
+--- cmake/find_stp.cmake.orig	2018-07-12 22:25:49 UTC
++++ cmake/find_stp.cmake
+@@ -13,6 +13,8 @@
+ # is displayed in `ccmake` and `cmake-gui`.
+ set(STP_DIR "" CACHE PATH "Path to directory containing STPConfig.cmake")
+ find_package(STP CONFIG)
++SET(STP_STATIC_LIBRARY ${FREEBSD_STP_STATIC_LIBRARY})
++MESSAGE("YURI STP_STATIC_LIBRARY=${STP_STATIC_LIBRARY}")
+ 
+ # Set the default so that if the following is true:
+ # * STP was found

Added: head/security/klee/files/patch-lib_Core_Executor.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/klee/files/patch-lib_Core_Executor.cpp	Mon Jul 23 03:19:26 2018	(r475144)
@@ -0,0 +1,11 @@
+--- lib/Core/Executor.cpp.orig	2018-07-22 16:43:34 UTC
++++ lib/Core/Executor.cpp
+@@ -3885,7 +3885,7 @@ void Executor::prepareForEarlyExit() {
+ 
+ /// Returns the errno location in memory
+ int *Executor::getErrnoLocation(const ExecutionState &state) const {
+-#ifndef __APPLE__
++#if !defined(__APPLE__) && !defined(__FreeBSD__)
+   /* From /usr/include/errno.h: it [errno] is a per-thread variable. */
+   return __errno_location();
+ #else

Added: head/security/klee/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/klee/pkg-descr	Mon Jul 23 03:19:26 2018	(r475144)
@@ -0,0 +1,19 @@
+KLEE is a symbolic virtual machine built on top of the LLVM compiler
+infrastructure.
+
+Currently, there are two primary components:
+* The core symbolic virtual machine engine; this is responsible for executing
+  LLVM bitcode modules with support for symbolic values. This is comprised of
+  the code in lib/.
+* A POSIX/Linux emulation layer oriented towards supporting uClibc, with
+  additional support for making parts of the operating system environment
+  symbolic.
+
+Additionally, there is a simple library for replaying computed inputs on native
+code (for closed programs). There is also a more complicated infrastructure for
+replaying the inputs generated for the POSIX/Linux emulation layer, which
+handles running native programs in an environment that matches a computed test
+input, including setting up files, pipes, environment variables, and passing
+command line arguments.
+
+WWW: https://klee.github.io/

Added: head/security/klee/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/klee/pkg-plist	Mon Jul 23 03:19:26 2018	(r475144)
@@ -0,0 +1,11 @@
+bin/gen-random-bout
+bin/kleaver
+bin/klee
+bin/klee-stats
+bin/ktest-tool
+include/klee/klee.h
+lib/klee/runtime/libklee-libc.bca
+lib/klee/runtime/libkleeRuntimeFreeStanding.bca
+lib/klee/runtime/libkleeRuntimeIntrinsic.bca
+lib/libkleeRuntest.so
+lib/libkleeRuntest.so.1.0


More information about the svn-ports-all mailing list