summaryrefslogtreecommitdiff
path: root/dev-libs/capstone
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/capstone')
-rw-r--r--dev-libs/capstone/Manifest6
-rw-r--r--dev-libs/capstone/capstone-3.0.5_rc2-r1.ebuild84
-rw-r--r--dev-libs/capstone/capstone-3.0.5_rc2.ebuild44
-rw-r--r--dev-libs/capstone/files/capstone-3.0.5_rc2-CVE-2017-6952.patch41
-rw-r--r--dev-libs/capstone/files/capstone-3.0.5_rc2-FLAGS.patch16
-rw-r--r--dev-libs/capstone/metadata.xml12
6 files changed, 203 insertions, 0 deletions
diff --git a/dev-libs/capstone/Manifest b/dev-libs/capstone/Manifest
new file mode 100644
index 000000000000..033bc570af64
--- /dev/null
+++ b/dev-libs/capstone/Manifest
@@ -0,0 +1,6 @@
+AUX capstone-3.0.5_rc2-CVE-2017-6952.patch 1565 BLAKE2B cd3436d2eba405b354baa2289538c9563f66595cf3a9f0d0a510a70af82bcafd5b4145676e627ab491562b10304c6fe2927bda0135d67123c18173ad871af739 SHA512 1f4f24bdede4439811b077502b227474827a455921eb183455c31e7de142d3f3f7e9f19869aac87b92a768be34a7e5ad040f0d68e8125b590d14dfec7af5b407
+AUX capstone-3.0.5_rc2-FLAGS.patch 398 BLAKE2B 40cdebbdd64e057982af6d7b4cce44821eba5799666c626d8a4afb8a798ebca7c6e211e7956b2824411deae671fd917f3d4c01ec903f47b514ac6cb5d0c9726a SHA512 95fb22a680e20f5b19936bd65ceadb9e29a8ed1f3de831379cfc0e650bfd4af7214b97efa97ed894a10d83541e0e49c60ff1a0cb501cd63a9af8f40460909975
+DIST capstone-3.0.5_rc2.tar.gz 2829338 BLAKE2B dd35fc6c31ec008f78840410ea0d20de56ea8f01c3af1d28488beaceee7fa06ce03c8cd0f56d834eb738d23f528d240693586122b9c1e353365f7348fb6f8362 SHA512 31bafdb0b3183d0c054a4244cc135db9a3c3dc5cb2e2af706bfede0d53cca8cba81d74b74ef9a4adbfd6c79cc408864dd80b8203791e17bd6c98bb69ea4f6894
+EBUILD capstone-3.0.5_rc2-r1.ebuild 1444 BLAKE2B d1be427a65e94ba5651b0097e32bc087a9b93790f996e6c966bba8f12114723e16ad0cf3892f3caee7fe5bece69093343e07d4cf05cd93c659be8988cd3ae027 SHA512 abf20572bd401faab86e3ffb8ca03945e7665328c0b66f3946249513bec5fb6fcb13f98c5239ec468c414924768aaa4b73a648d304b28a3eda6450bfa607b01d
+EBUILD capstone-3.0.5_rc2.ebuild 849 BLAKE2B 8954f0ab824ca3532d0fba48e7b41abcc2b463a26bd7795553d8299f64f3b27e850c79bb04f210c3eeb4b27263390e2a0990be5ca76e4774bdfb16aa2921f748 SHA512 7896e5759c146a82b47239bf0fede1c67f49ec9970d3ca82ff1db6d4c53c7c8f3a3a657491ed12a8ca5de585ffcdaf032f3c3d1b9db6db0d4c75e613ef4dfc70
+MISC metadata.xml 332 BLAKE2B 944b66779658094b7b1020400c1821dcf1f5138c85531fb83e853fa6d38219606f0f92673f57b3b621ffb3149eb50d60da281acaf469e97fc4c826b90c06b5a3 SHA512 a4952a89d043c4c8aec5a7a307d37d895880d49b381e5b881ffecf74b61c9c22cd854a68a1d1de3926431cdfad4f8ba70812be36bb7cac2df5dee8efe96dc269
diff --git a/dev-libs/capstone/capstone-3.0.5_rc2-r1.ebuild b/dev-libs/capstone/capstone-3.0.5_rc2-r1.ebuild
new file mode 100644
index 000000000000..17f8b6cd3aff
--- /dev/null
+++ b/dev-libs/capstone/capstone-3.0.5_rc2-r1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit distutils-r1 toolchain-funcs
+
+DESCRIPTION="disassembly/disassembler framework + bindings"
+HOMEPAGE="http://www.capstone-engine.org/"
+SRC_URI="https://github.com/aquynh/${PN}/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/3" # libcapstone.so.3
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+IUSE="python"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
+"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-CVE-2017-6952.patch
+ "${FILESDIR}"/${P}-FLAGS.patch
+)
+
+S=${WORKDIR}/${P/_rc/-rc}
+
+wrap_python() {
+ if use python; then
+ pushd bindings/python >/dev/null || die
+ distutils-r1_${1} "$@"
+ popd >/dev/null
+ fi
+}
+
+src_prepare() {
+ default
+
+ wrap_python ${FUNCNAME}
+}
+
+src_configure() {
+ {
+ cat <<-EOF
+ # Gentoo overrides:
+ # verbose build
+ V = 1
+ # toolchain
+ AR = $(tc-getAR)
+ CC = $(tc-getCC)
+ RANLIB = $(tc-getRANLIB)
+ # toolchain flags
+ CFLAGS = ${CFLAGS}
+ LDFLAGS = ${LDFLAGS}
+ # libs
+ LIBDIRARCH = $(get_libdir)
+ EOF
+ } >> config.mk || die
+
+ wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+ default
+
+ wrap_python ${FUNCNAME}
+}
+
+src_test() {
+ default
+
+ wrap_python ${FUNCNAME}
+}
+
+src_install() {
+ default
+
+ wrap_python ${FUNCNAME}
+}
diff --git a/dev-libs/capstone/capstone-3.0.5_rc2.ebuild b/dev-libs/capstone/capstone-3.0.5_rc2.ebuild
new file mode 100644
index 000000000000..80fb03207d64
--- /dev/null
+++ b/dev-libs/capstone/capstone-3.0.5_rc2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="disassembly/disassembler framework + bindings"
+HOMEPAGE="http://www.capstone-engine.org/"
+SRC_URI="https://github.com/aquynh/${PN}/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/3" # libcapstone.so.3
+KEYWORDS="~amd64 ~arm ~x86"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-CVE-2017-6952.patch
+ "${FILESDIR}"/${P}-FLAGS.patch
+)
+
+S=${WORKDIR}/${P/_rc/-rc}
+
+src_configure() {
+ {
+ cat <<-EOF
+ # Gentoo overrides:
+ # verbose build
+ V = 1
+ # toolchain
+ AR = $(tc-getAR)
+ CC = $(tc-getCC)
+ RANLIB = $(tc-getRANLIB)
+ # toolchain flags
+ CFLAGS = ${CFLAGS}
+ LDFLAGS = ${LDFLAGS}
+ # libs
+ LIBDIRARCH = $(get_libdir)
+ EOF
+ } >> config.mk || die
+
+}
diff --git a/dev-libs/capstone/files/capstone-3.0.5_rc2-CVE-2017-6952.patch b/dev-libs/capstone/files/capstone-3.0.5_rc2-CVE-2017-6952.patch
new file mode 100644
index 000000000000..ba16126f7411
--- /dev/null
+++ b/dev-libs/capstone/files/capstone-3.0.5_rc2-CVE-2017-6952.patch
@@ -0,0 +1,41 @@
+commit 6fe86eef621b9849f51a5e1e5d73258a93440403
+Author: Quang Nguyễn <quangnh89@users.noreply.github.com>
+Date: Mon Mar 13 22:34:48 2017 +0700
+
+ provide a validity check to prevent against Integer overflow conditions (#870)
+
+ * provide a validity check to prevent against Integer overflow conditions
+
+ * fix some style issues.
+
+diff --git a/windows/winkernel_mm.c b/windows/winkernel_mm.c
+index c127da3a..ecdc1ca2 100644
+--- a/windows/winkernel_mm.c
++++ b/windows/winkernel_mm.c
+@@ -3,6 +3,7 @@
+
+ #include "winkernel_mm.h"
+ #include <ntddk.h>
++#include <Ntintsafe.h>
+
+ // A pool tag for memory allocation
+ static const ULONG CS_WINKERNEL_POOL_TAG = 'kwsC';
+@@ -33,8 +34,16 @@ void * CAPSTONE_API cs_winkernel_malloc(size_t size)
+
+ // FP; a use of NonPagedPool is required for Windows 7 support
+ #pragma prefast(suppress : 30030) // Allocating executable POOL_TYPE memory
+- CS_WINKERNEL_MEMBLOCK *block = (CS_WINKERNEL_MEMBLOCK *)ExAllocatePoolWithTag(
+- NonPagedPool, size + sizeof(CS_WINKERNEL_MEMBLOCK), CS_WINKERNEL_POOL_TAG);
++ size_t number_of_bytes = 0;
++ CS_WINKERNEL_MEMBLOCK *block = NULL;
++ // A specially crafted size value can trigger the overflow.
++ // If the sum in a value that overflows or underflows the capacity of the type,
++ // the function returns NULL.
++ if (!NT_SUCCESS(RtlSizeTAdd(size, sizeof(CS_WINKERNEL_MEMBLOCK), &number_of_bytes))) {
++ return NULL;
++ }
++ block = (CS_WINKERNEL_MEMBLOCK *)ExAllocatePoolWithTag(
++ NonPagedPool, number_of_bytes, CS_WINKERNEL_POOL_TAG);
+ if (!block) {
+ return NULL;
+ }
diff --git a/dev-libs/capstone/files/capstone-3.0.5_rc2-FLAGS.patch b/dev-libs/capstone/files/capstone-3.0.5_rc2-FLAGS.patch
new file mode 100644
index 000000000000..4be2ed4ba0e6
--- /dev/null
+++ b/dev-libs/capstone/files/capstone-3.0.5_rc2-FLAGS.patch
@@ -0,0 +1,16 @@
+Add support for user overridden CFLAGS and LDFLAGS
+diff --git a/cstool/Makefile b/cstool/Makefile
+index 450ac1b..3cf2a81 100644
+--- a/cstool/Makefile
++++ b/cstool/Makefile
+@@ -3,2 +3,3 @@
+ include ../functions.mk
++include ../config.mk
+
+@@ -8,4 +9,4 @@ LIBNAME = capstone
+
+-CFLAGS = -I../include
+-LDFLAGS = -O3 -Wall -L.. -l$(LIBNAME)
++CFLAGS += -I../include
++LDFLAGS += -Wall -L.. -l$(LIBNAME)
+
diff --git a/dev-libs/capstone/metadata.xml b/dev-libs/capstone/metadata.xml
new file mode 100644
index 000000000000..506ec45bd2c7
--- /dev/null
+++ b/dev-libs/capstone/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+
+ <maintainer type="person">
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">aquynh/capstone</remote-id>
+ </upstream>
+</pkgmetadata>