Hello community, here is the log from the commit of package trinity for openSUSE:Factory checked in at 2016-03-03 15:16:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/trinity (Old) and /work/SRC/openSUSE:Factory/.trinity.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "trinity" Changes: -------- --- /work/SRC/openSUSE:Factory/trinity/trinity.changes 2016-02-05 00:31:34.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.trinity.new/trinity.changes 2016-03-03 15:16:23.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Mar 2 07:52:44 UTC 2016 - [email protected] + +- Update to 20160301 to avoid PowerPC build failure + remove 0001-net-protocols.c-fix-build-on-old-machines.patch + +------------------------------------------------------------------- Old: ---- 0001-net-protocols.c-fix-build-on-old-machines.patch trinity-20160131.tar.xz New: ---- trinity-20160301.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ trinity.spec ++++++ --- /var/tmp/diff_new_pack.fdNFRF/_old 2016-03-03 15:16:24.000000000 +0100 +++ /var/tmp/diff_new_pack.fdNFRF/_new 2016-03-03 15:16:24.000000000 +0100 @@ -17,14 +17,13 @@ Name: trinity -Version: 20160131 +Version: 20160301 Release: 0 Summary: A Linux System call fuzz tester License: GPL-2.0 Group: Development/Tools/Other Url: http://codemonkey.org.uk/projects/trinity/ Source0: %{name}-%{version}.tar.xz -Patch0: 0001-net-protocols.c-fix-build-on-old-machines.patch # SLE11-SP*, for -std=gnu11 %if 0%{suse_version} == 1110 @@ -52,14 +51,13 @@ %prep %setup -q -%patch0 -p1 %build %if 0%{suse_version} == 1110 export CC=gcc-4.%{gcc_minor} %endif export CFLAGS="%{optflags}" -./configure.sh +./configure make %{?_smp_mflags} V=1 %install ++++++ trinity-20160131.tar.xz -> trinity-20160301.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/Makefile new/trinity-20160301/Makefile --- old/trinity-20160131/Makefile 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/Makefile 2016-03-01 18:05:38.000000000 +0100 @@ -10,7 +10,9 @@ CC := $(CROSS_COMPILE)$(CC) LD := $(CROSS_COMPILE)$(LD) -CFLAGS += -Wall -Wextra -g -O2 -I. -Iinclude/ -Wimplicit -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D__linux__ -std=gnu11 +CFLAGS += -Wall -Wextra -g -O2 -I. -Iinclude/ -Wimplicit -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D__linux__ + +CFLAGS += $(shell if $(CC) -std=gnu11 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-std=gnu11"; else echo "-std=gnu99"; fi) # Only enabled during development, and on gcc 4.9+ CPP_MAJOR := $(shell $(CPP) -dumpversion 2>&1 | cut -d'.' -f1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/configure new/trinity-20160301/configure --- old/trinity-20160131/configure 1970-01-01 01:00:00.000000000 +0100 +++ new/trinity-20160301/configure 2016-03-01 18:05:38.000000000 +0100 @@ -0,0 +1,254 @@ +#!/bin/bash + +CONFIGH="config.h" + +if [ -t 1 ]; then + RED="[1;31m" + GREEN="[1;32m" + COL_RESET="[0;m" +fi + +MISSING_DEFS=0 + +[ -z "$CC" ] && CC=gcc + +# expand tilde +CC="$(eval echo ${CROSS_COMPILE}${CC})" + +CFLAGS="${CFLAGS}" +if [ "${SYSROOT}xx" != "xx" ]; then + CFLAGS="${CFLAGS} $(eval echo --sysroot=${SYSROOT} )" +fi + +echo "#pragma once" > $CONFIGH +echo "/* This file is auto-generated by configure.sh */" >> $CONFIGH + +TMP=$(mktemp) + +check_header() +{ + echo -n "[*] Checking header $1 ... " + + rm -f "$TMP" || exit 1 + echo "#include <$1>" >"$TMP.c" + + ${CC} ${CFLAGS} "$TMP.c" -E &>"$TMP.log" + if [ $? -eq 0 ]; then + echo $GREEN "[YES]" $COL_RESET + echo "#define $2 1" >> $CONFIGH + else + echo $RED "[NO]" $COL_RESET + MISSING_DEFS=1 + fi +} + +############################################################################################# + +echo "[*] Checking system headers." + +############################################################################################# +# Are ipv6 headers usable ? +[ -z "$IPV6" ] && IPV6=yes +if [[ "$IPV6" == "yes" ]]; then + echo -n "[*] Checking ipv6 headers ... " + RET=$(grep __UAPI_DEF_IN6_PKTINFO /usr/include/linux/ipv6.h) + if [ -z "$RET" ]; then + echo $RED "[BROKEN]" $COL_RESET "See https://patchwork.ozlabs.org/patch/425881/" + else + echo $GREEN "[OK]" $COL_RESET + echo "#define USE_IPV6 1" >> $CONFIGH + fi +fi + +############################################################################################# +# is /usr/include/linux/if_pppox.h new enough to feature pppol2tpin6/pppol2tpv3in6 +# +echo -n "[*] Checking if pppox can use pppol2tpin6.. " +rm -f "$TMP" || exit 1 + +cat >"$TMP.c" << EOF +#include <stdio.h> +#include <netinet/in.h> +#include <linux/if.h> +#include <linux/if_pppox.h> + +void main() +{ + struct sockaddr_pppol2tpin6 *pppox; + printf("%d\n", pppox->sa_family); +} +EOF + +${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" +if [ ! -x "$TMP" ]; then + echo $RED "[NO]" $COL_RESET + MISSING_DEFS=1 +else + echo $GREEN "[YES]" $COL_RESET + echo "#define USE_PPPOL2TPIN6 1" >> $CONFIGH +fi + +############################################################################################# +# is /usr/include/linux/if_pppox.h new enough to feature pppol2tpv3 +# +echo -n "[*] Checking if pppox can use pppol2tv3.. " +rm -f "$TMP" || exit 1 + +cat >"$TMP.c" << EOF +#include <stdio.h> +#include <netinet/in.h> +#include <linux/if.h> +#include <linux/if_pppox.h> + +void main() +{ + struct sockaddr_pppol2tpv3 *pppox; + printf("%d\n", pppox->sa_family); +} +EOF + +${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" +if [ ! -x "$TMP" ]; then + echo $RED "[NO]" $COL_RESET + MISSING_DEFS=1 +else + echo $GREEN "[YES]" $COL_RESET + echo "#define USE_PPPOL2TPV3 1" >> $CONFIGH +fi + +############################################################################################# +# is /usr/include/linux/if_pppox.h new enough to feature pptp +# +echo -n "[*] Checking if pppox can use pptp.. " +rm -f "$TMP" || exit 1 + +cat >"$TMP.c" << EOF +#include <stdio.h> +#include <netinet/in.h> +#include <linux/if.h> +#include <linux/if_pppox.h> + +void main() +{ + struct sockaddr_pppox *pppox; + printf("%d\n", pppox->sa_addr.pptp.call_id); +} +EOF + +${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" +if [ ! -x "$TMP" ]; then + echo $RED "[NO]" $COL_RESET + MISSING_DEFS=1 +else + echo $GREEN "[YES]" $COL_RESET + echo "#define USE_PPPOX_PPTP 1" >> $CONFIGH +fi + +############################################################################################# +# is /usr/include/linux/llc.h new enough to feature LLC_OPT_PKTINFO +# +echo -n "[*] Checking if llc can use LLC_OPT_PKTINFO.. " +rm -f "$TMP" || exit 1 + +cat >"$TMP.c" << EOF +#include <stdio.h> +#include <net/if.h> +#include <linux/llc.h> + +void main() +{ + printf("%d\n", LLC_OPT_PKTINFO); +} +EOF + +${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" +if [ ! -x "$TMP" ]; then + echo $RED "[NO]" $COL_RESET + MISSING_DEFS=1 +else + echo $GREEN "[YES]" $COL_RESET + echo "#define USE_LLC_OPT_PKTINFO 1" >> $CONFIGH +fi + +############################################################################################# +# Do glibc headers provides struct termios2 + +echo -n "[*] Checking if glibc headers provide termios2.. " +rm -f "$TMP" || exit 1 + +cat >"$TMP.c" << EOF +#include <sys/ioctl.h> +#include <sys/vt.h> +#include <termios.h> + +int main() +{ + struct termios2 test; +} +EOF + +${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" +if [ ! -x "$TMP" ]; then + echo $RED "[NO]" $COL_RESET + MISSING_DEFS=1 +else + echo $GREEN "[YES]" $COL_RESET + echo "#define HAVE_TERMIOS2 1" >> $CONFIGH +fi + +############################################################################################# +# Do glibc headers provides nvme ioctls + +echo -n "[*] Checking if glibc headers provide nvme ioctls.. " +rm -f "$TMP" || exit 1 + +cat >"$TMP.c" << EOF +#include <sys/ioctl.h> +#include <linux/nvme.h> + +int main(int argc, char* argv[]) +{ + unsigned int foo = NVME_IOCTL_IO_CMD; +} +EOF + +${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" +if [ ! -x "$TMP" ]; then + echo $RED "[NO]" $COL_RESET + MISSING_DEFS=1 +else + echo $GREEN "[YES]" $COL_RESET + echo "#define USE_NVME 1" >> $CONFIGH +fi + +############################################################################################# + +check_header linux/caif/caif_socket.h USE_CAIF +check_header linux/if_alg.h USE_IF_ALG +check_header linux/rds.h USE_RDS +check_header linux/vfio.h USE_VFIO +check_header linux/btrfs.h USE_BTRFS +check_header drm/drm.h USE_DRM +check_header drm/exynos_drm.h USE_DRM_EXYNOS +check_header sound/compress_offload.h USE_SNDDRV_COMPRESS_OFFLOAD +check_header linux/kvm.h USE_KVM +check_header linux/seccomp.h USE_SECCOMP +check_header linux/vhost.h USE_VHOST +check_header execinfo.h USE_BACKTRACE +check_header netatalk/at.h USE_APPLETALK +check_header netrom/netrom.h USE_NETROM +check_header netrose/rose.h USE_ROSE + +rm -f "$TMP" "$TMP.log" "$TMP.c" + +############################################################################################# + +if [ "$MISSING_DEFS" == "1" ]; then + echo "[-] Some header definitions were missing. This is not fatal." + echo " It usually means you're building on an older distribution which doesn't" + echo " have header files describing newer kernel features." + echo " Trinity will still compile and run, it just won't use those new features." + echo " Go ahead, and run 'make'" +fi + +exit 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/configure.sh new/trinity-20160301/configure.sh --- old/trinity-20160131/configure.sh 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/configure.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,254 +0,0 @@ -#!/bin/bash - -CONFIGH="config.h" - -if [ -t 1 ]; then - RED="[1;31m" - GREEN="[1;32m" - COL_RESET="[0;m" -fi - -MISSING_DEFS=0 - -[ -z "$CC" ] && CC=gcc - -# expand tilde -CC="$(eval echo ${CROSS_COMPILE}${CC})" - -CFLAGS="${CFLAGS}" -if [ "${SYSROOT}xx" != "xx" ]; then - CFLAGS="${CFLAGS} $(eval echo --sysroot=${SYSROOT} )" -fi - -echo "#pragma once" > $CONFIGH -echo "/* This file is auto-generated by configure.sh */" >> $CONFIGH - -TMP=$(mktemp) - -check_header() -{ - echo -n "[*] Checking header $1 ... " - - rm -f "$TMP" || exit 1 - echo "#include <$1>" >"$TMP.c" - - ${CC} ${CFLAGS} "$TMP.c" -E &>"$TMP.log" - if [ $? -eq 0 ]; then - echo $GREEN "[YES]" $COL_RESET - echo "#define $2 1" >> $CONFIGH - else - echo $RED "[NO]" $COL_RESET - MISSING_DEFS=1 - fi -} - -############################################################################################# - -echo "[*] Checking system headers." - -############################################################################################# -# Are ipv6 headers usable ? -[ -z "$IPV6" ] && IPV6=yes -if [[ "$IPV6" == "yes" ]]; then - echo -n "[*] Checking ipv6 headers ... " - RET=$(grep __UAPI_DEF_IN6_PKTINFO /usr/include/linux/ipv6.h) - if [ -z "$RET" ]; then - echo $RED "[BROKEN]" $COL_RESET "See https://patchwork.ozlabs.org/patch/425881/" - else - echo $GREEN "[OK]" $COL_RESET - echo "#define USE_IPV6 1" >> $CONFIGH - fi -fi - -############################################################################################# -# is /usr/include/linux/if_pppox.h new enough to feature pppol2tpin6/pppol2tpv3in6 -# -echo -n "[*] Checking if pppox can use pppol2tpin6.. " -rm -f "$TMP" || exit 1 - -cat >"$TMP.c" << EOF -#include <stdio.h> -#include <netinet/in.h> -#include <linux/if.h> -#include <linux/if_pppox.h> - -void main() -{ - struct sockaddr_pppol2tpin6 *pppox; - printf("%d\n", pppox->sa_family); -} -EOF - -${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" -if [ ! -x "$TMP" ]; then - echo $RED "[NO]" $COL_RESET - MISSING_DEFS=1 -else - echo $GREEN "[YES]" $COL_RESET - echo "#define USE_PPPOL2TPIN6 1" >> $CONFIGH -fi - -############################################################################################# -# is /usr/include/linux/if_pppox.h new enough to feature pppol2tpv3 -# -echo -n "[*] Checking if pppox can use pppol2tv3.. " -rm -f "$TMP" || exit 1 - -cat >"$TMP.c" << EOF -#include <stdio.h> -#include <netinet/in.h> -#include <linux/if.h> -#include <linux/if_pppox.h> - -void main() -{ - struct sockaddr_pppol2tpv3 *pppox; - printf("%d\n", pppox->sa_family); -} -EOF - -${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" -if [ ! -x "$TMP" ]; then - echo $RED "[NO]" $COL_RESET - MISSING_DEFS=1 -else - echo $GREEN "[YES]" $COL_RESET - echo "#define USE_PPPOL2TPV3 1" >> $CONFIGH -fi - -############################################################################################# -# is /usr/include/linux/if_pppox.h new enough to feature pptp -# -echo -n "[*] Checking if pppox can use pptp.. " -rm -f "$TMP" || exit 1 - -cat >"$TMP.c" << EOF -#include <stdio.h> -#include <netinet/in.h> -#include <linux/if.h> -#include <linux/if_pppox.h> - -void main() -{ - struct sockaddr_pppox *pppox; - printf("%d\n", pppox->sa_addr.pptp.call_id); -} -EOF - -${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" -if [ ! -x "$TMP" ]; then - echo $RED "[NO]" $COL_RESET - MISSING_DEFS=1 -else - echo $GREEN "[YES]" $COL_RESET - echo "#define USE_PPPOX_PPTP 1" >> $CONFIGH -fi - -############################################################################################# -# is /usr/include/linux/llc.h new enough to feature LLC_OPT_PKTINFO -# -echo -n "[*] Checking if llc can use LLC_OPT_PKTINFO.. " -rm -f "$TMP" || exit 1 - -cat >"$TMP.c" << EOF -#include <stdio.h> -#include <net/if.h> -#include <linux/llc.h> - -void main() -{ - printf("%d\n", LLC_OPT_PKTINFO); -} -EOF - -${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" -if [ ! -x "$TMP" ]; then - echo $RED "[NO]" $COL_RESET - MISSING_DEFS=1 -else - echo $GREEN "[YES]" $COL_RESET - echo "#define USE_LLC_OPT_PKTINFO 1" >> $CONFIGH -fi - -############################################################################################# -# Do glibc headers provides struct termios2 - -echo -n "[*] Checking if glibc headers provide termios2.. " -rm -f "$TMP" || exit 1 - -cat >"$TMP.c" << EOF -#include <sys/ioctl.h> -#include <sys/vt.h> -#include <termios.h> - -int main() -{ - struct termios2 test; -} -EOF - -${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" -if [ ! -x "$TMP" ]; then - echo $RED "[NO]" $COL_RESET - MISSING_DEFS=1 -else - echo $GREEN "[YES]" $COL_RESET - echo "#define HAVE_TERMIOS2 1" >> $CONFIGH -fi - -############################################################################################# -# Do glibc headers provides nvme ioctls - -echo -n "[*] Checking if glibc headers provide nvme ioctls.. " -rm -f "$TMP" || exit 1 - -cat >"$TMP.c" << EOF -#include <sys/ioctl.h> -#include <linux/nvme.h> - -int main(int argc, char* argv[]) -{ - unsigned int foo = NVME_IOCTL_IO_CMD; -} -EOF - -${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log" -if [ ! -x "$TMP" ]; then - echo $RED "[NO]" $COL_RESET - MISSING_DEFS=1 -else - echo $GREEN "[YES]" $COL_RESET - echo "#define USE_NVME 1" >> $CONFIGH -fi - -############################################################################################# - -check_header linux/caif/caif_socket.h USE_CAIF -check_header linux/if_alg.h USE_IF_ALG -check_header linux/rds.h USE_RDS -check_header linux/vfio.h USE_VFIO -check_header linux/btrfs.h USE_BTRFS -check_header drm/drm.h USE_DRM -check_header drm/exynos_drm.h USE_DRM_EXYNOS -check_header sound/compress_offload.h USE_SNDDRV_COMPRESS_OFFLOAD -check_header linux/kvm.h USE_KVM -check_header linux/seccomp.h USE_SECCOMP -check_header linux/vhost.h USE_VHOST -check_header execinfo.h USE_BACKTRACE -check_header netatalk/at.h USE_APPLETALK -check_header netrom/netrom.h USE_NETROM -check_header netrose/rose.h USE_ROSE - -rm -f "$TMP" "$TMP.log" "$TMP.c" - -############################################################################################# - -if [ "$MISSING_DEFS" == "1" ]; then - echo "[-] Some header definitions were missing. This is not fatal." - echo " It usually means you're building on an older distribution which doesn't" - echo " have header files describing newer kernel features." - echo " Trinity will still compile and run, it just won't use those new features." - echo " Go ahead, and run 'make'" -fi - -exit 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/fds/fds.c new/trinity-20160301/fds/fds.c --- old/trinity-20160131/fds/fds.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/fds/fds.c 2016-03-01 18:05:38.000000000 +0100 @@ -66,7 +66,9 @@ output(0, "Registered %d fd providers.\n", num_fd_providers); } -unsigned int open_fds(void) +static unsigned int num_fd_providers_initialized = 0; + +static void __open_fds(bool do_rand) { struct list_head *node; @@ -75,15 +77,40 @@ provider = (struct fd_provider *) node; + /* disabled on cmdline */ if (provider->enabled == FALSE) continue; + /* already done */ + if (provider->initialized == TRUE) + continue; + + if (do_rand == TRUE) { + /* to mix up init order */ + if (RAND_BOOL()) + continue; + } + provider->enabled = provider->open(); - if (provider->enabled == TRUE) + if (provider->enabled == TRUE) { + provider->initialized = TRUE; + num_fd_providers_initialized++; num_fd_providers_enabled++; + } } +} - output(0, "Enabled %d fd providers.\n", num_fd_providers_enabled); +unsigned int open_fds(void) +{ + /* Open half the providers randomly */ + while (num_fd_providers_initialized < (num_fd_providers / 2)) + __open_fds(TRUE); + + /* Now open any leftovers */ + __open_fds(FALSE); + + output(0, "Enabled %d fd providers: initialized:%d.\n", + num_fd_providers_enabled, num_fd_providers_initialized); return TRUE; } @@ -112,6 +139,10 @@ if (provider->enabled == FALSE) // FIXME: Better would be to just remove disabled providers from the list. goto retry; + // Hasn't been run yet. + if (provider->initialized == FALSE) + goto retry; + fd = provider->get(); break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/fds/perf.c new/trinity-20160301/fds/perf.c --- old/trinity-20160131/fds/perf.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/fds/perf.c 2016-03-01 18:05:38.000000000 +0100 @@ -21,6 +21,7 @@ { struct objhead *head; unsigned int i = 0; + unsigned int perm_count = 0; head = get_objhead(OBJ_GLOBAL, OBJ_FD_PERF); head->destroy = &perffd_destructor; @@ -43,13 +44,25 @@ output(2, "fd[%d] = perf\n", fd); i++; } else { - /* If ENOSYS, bail early rather than do MAX_PERF_FDS retries */ - if (errno == ENOSYS) - return TRUE; - - /* If we get here we probably generated something invalid and - * perf_event_open threw it out. Go around the loop again. - */ + switch (errno) { + case ENOSYS: + /* If ENOSYS, bail early rather than do MAX_PERF_FDS retries */ + return FALSE; + + case EINVAL: + /* If we get here we probably generated something invalid and + * perf_event_open threw it out. Go around the loop again. + */ + continue; + + case EACCES: + perm_count++; + } + } + + if (perm_count > 1000) { + output(2, "Couldn't open enough perf events, got EPERM too much. Giving up.\n"); + return FALSE; } if (shm->exit_reason != STILL_RUNNING) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/fds/pipes.c new/trinity-20160301/fds/pipes.c --- old/trinity-20160131/fds/pipes.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/fds/pipes.c 2016-03-01 18:05:38.000000000 +0100 @@ -67,6 +67,9 @@ obj = get_random_object(OBJ_FD_PIPE, OBJ_GLOBAL); + if (obj == NULL) + return 0; + return obj->pipefd; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/fds/sockets.c new/trinity-20160301/fds/sockets.c --- old/trinity-20160131/fds/sockets.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/fds/sockets.c 2016-03-01 18:05:38.000000000 +0100 @@ -372,7 +372,7 @@ type = buffer[1]; protocol = buffer[2]; - if (domain > TRINITY_PF_MAX) { + if (domain >= TRINITY_PF_MAX) { output(1, "cachefile contained invalid domain %u\n", domain); goto regenerate; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/include/compat.h new/trinity-20160301/include/compat.h --- old/trinity-20160131/include/compat.h 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/include/compat.h 2016-03-01 18:05:38.000000000 +0100 @@ -1088,3 +1088,12 @@ #ifndef NVME_IOCTL_RESET #define NVME_IOCTL_RESET _IO('N', 0x44) #endif + +/* linux/shm.h */ +#ifndef SHM_HUGE_SHIFT +#define SHM_HUGE_SHIFT 26 +#endif +#ifndef SHM_HUGE_2MB +#define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT) +#define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT) +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/include/fd.h new/trinity-20160301/include/fd.h --- old/trinity-20160131/include/fd.h 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/include/fd.h 2016-03-01 18:05:38.000000000 +0100 @@ -17,6 +17,7 @@ int (*open)(void); int (*get)(void); bool enabled; + bool initialized; }; unsigned int check_if_fd(struct childdata *child, struct syscallrecord *rec); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/include/net.h new/trinity-20160301/include/net.h --- old/trinity-20160131/include/net.h 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/include/net.h 2016-03-01 18:05:38.000000000 +0100 @@ -48,7 +48,7 @@ struct protoptr { const struct netproto *proto; }; -extern const struct protoptr net_protocols[PF_MAX]; +extern const struct protoptr net_protocols[TRINITY_PF_MAX]; const struct fd_provider socket_fd_provider; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/include/object-types.h new/trinity-20160301/include/object-types.h --- old/trinity-20160131/include/object-types.h 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/include/object-types.h 2016-03-01 18:05:38.000000000 +0100 @@ -18,5 +18,6 @@ OBJ_FD_USERFAULTFD, OBJ_FD_FANOTIFY, OBJ_FUTEX, + OBJ_SYSV_SHM, MAX_OBJECT_TYPES, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/include/objects.h new/trinity-20160301/include/objects.h --- old/trinity-20160131/include/objects.h 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/include/objects.h 2016-03-01 18:05:38.000000000 +0100 @@ -6,6 +6,7 @@ #include "futex.h" #include "object-types.h" #include "maps.h" +#include "sysv-shm.h" struct object { struct list_head list; @@ -39,6 +40,8 @@ struct socketinfo sockinfo; struct __lock lock; /* futex */ + + struct sysv_shm sysv_shm; }; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/include/sysv-shm.h new/trinity-20160301/include/sysv-shm.h --- old/trinity-20160131/include/sysv-shm.h 1970-01-01 01:00:00.000000000 +0100 +++ new/trinity-20160301/include/sysv-shm.h 2016-03-01 18:05:38.000000000 +0100 @@ -0,0 +1,10 @@ +#pragma once + +void create_sysv_shms(void); + +struct sysv_shm { + void *ptr; + int id; + size_t size; + int flags; +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/locks.c new/trinity-20160301/locks.c --- old/trinity-20160131/locks.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/locks.c 2016-03-01 18:05:38.000000000 +0100 @@ -11,11 +11,7 @@ /* * Check that the processes holding locks are still alive. - * And if they are, ensure they haven't held them for an - * excessive length of time. */ -#define STEAL_THRESHOLD 1000000 - static bool check_lock(lock_t *_lock) { pid_t pid; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/log.c new/trinity-20160301/log.c --- old/trinity-20160131/log.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/log.c 2016-03-01 18:05:38.000000000 +0100 @@ -103,7 +103,7 @@ } /* go on with file logs only if enabled */ - if (logging == LOGGING_FILES) + if (logging == LOGGING_DISABLED) return; handle = find_logfile_handle(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/main.c new/trinity-20160301/main.c --- old/trinity-20160131/main.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/main.c 2016-03-01 18:05:38.000000000 +0100 @@ -730,6 +730,12 @@ } print_stats(); + + /* This should never happen, but just to catch corner cases, like if + * fork() failed when we tried to replace a child. + */ + if (shm->running_childs < max_children) + fork_children(); } /* if the pid map is corrupt, we can't trust that we'll diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/mm/fault-write.c new/trinity-20160301/mm/fault-write.c --- old/trinity-20160131/mm/fault-write.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/mm/fault-write.c 2016-03-01 18:05:38.000000000 +0100 @@ -82,9 +82,9 @@ * a strlen and go off the end. */ static void dirty_last_page(struct map *map) { - char *p = map->ptr; + char *p = map->ptr + map->size - page_size; - memset((void *) p + (map->size - page_size), 'A', page_size); + memset((void *) p, 'A', page_size); } static const struct faultfn write_faultfns_single[] = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/net/proto-alg.c new/trinity-20160301/net/proto-alg.c --- old/trinity-20160131/net/proto-alg.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/net/proto-alg.c 2016-03-01 18:05:38.000000000 +0100 @@ -48,17 +48,21 @@ "authenc(hmac(sha1),cbc(aes))", "authenc(hmac(sha1),cbc(des))", "authenc(hmac(sha1),cbc(des3_ede))", + "authenc(hmac(sha1),ctr(aes))" "authenc(hmac(sha1),ecb(cipher_null))", "authenc(hmac(sha224),cbc(des))", "authenc(hmac(sha224),cbc(des3_ede))", "authenc(hmac(sha256),cbc(aes))", "authenc(hmac(sha256),cbc(des))", "authenc(hmac(sha256),cbc(des3_ede))", + "authenc(hmac(sha256),ctr(aes))" "authenc(hmac(sha384),cbc(des))", "authenc(hmac(sha384),cbc(des3_ede))", + "authenc(hmac(sha384),ctr(aes))" "authenc(hmac(sha512),cbc(aes))", "authenc(hmac(sha512),cbc(des))", "authenc(hmac(sha512),cbc(des3_ede))", + "authenc(hmac(sha512),ctr(aes))" "cbc(aes)", "cbc(anubis)", "cbc(blowfish)", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/net/protocols.c new/trinity-20160301/net/protocols.c --- old/trinity-20160131/net/protocols.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/net/protocols.c 2016-03-01 18:05:38.000000000 +0100 @@ -1,8 +1,9 @@ #include <sys/socket.h> #include "config.h" #include "net.h" +#include "compat.h" -const struct protoptr net_protocols[PF_MAX] = { +const struct protoptr net_protocols[TRINITY_PF_MAX] = { [PF_UNIX] = { .proto = &proto_unix }, [PF_INET] = { .proto = &proto_ipv4 }, [PF_AX25] = { .proto = &proto_ax25 }, @@ -43,5 +44,7 @@ [PF_PPPOX] = { .proto = &proto_pppol2tp }, [PF_IUCV] = { .proto = &proto_iucv }, [PF_RXRPC] = { .proto = &proto_rxrpc }, +#ifdef USE_IF_ALG [PF_ALG] = { .proto = &proto_alg }, +#endif }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/objects.c new/trinity-20160301/objects.c --- old/trinity-20160131/objects.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/objects.c 2016-03-01 18:05:38.000000000 +0100 @@ -83,6 +83,11 @@ output(0, "futex: %lx owner:%d\n", obj->lock.futex, obj->lock.owner_pid); break; + case OBJ_SYSV_SHM: + output(0, "sysv_shm: id:%u size:%d flags:%x ptr:%p\n", + obj->sysv_shm.id, obj->sysv_shm.size, + obj->sysv_shm.flags, obj->sysv_shm.ptr); + break; case MAX_OBJECT_TYPES: default: break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/rand/random-page.c new/trinity-20160301/rand/random-page.c --- old/trinity-20160131/rand/random-page.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/rand/random-page.c 2016-03-01 18:05:38.000000000 +0100 @@ -88,7 +88,7 @@ /* If we only have a small buffer, don't do * the longer generators. */ - if (len < 20) + if (len < 24) randrange = 6; else { /* Make sure we're always dealing with an even number */ @@ -127,7 +127,7 @@ p = (char *) ptr; - while (p < (char *)(ptr + (len-22))) { // 22 is the longest case below + separator. + while (p < (char *)(ptr + (len-23))) { // 23 is the longest case below + separator. if (RAND_BOOL()) { /* hex */ switch (rnd() % 3) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/rand/random.c new/trinity-20160301/rand/random.c --- old/trinity-20160131/rand/random.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/rand/random.c 2016-03-01 18:05:38.000000000 +0100 @@ -186,7 +186,7 @@ */ u64 rand64(void) { - unsigned long r = 0; + u64 r = 0; switch (rnd() % 8) { @@ -207,7 +207,7 @@ break; case 4: r = randbits(64); break; - case 5: r = (0ULL | rnd()) << 32 | rnd(); + case 5: r = (u64) rnd() << 32 | rnd(); break; case 6: r = rept_byte(); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/syscalls/mlockall.c new/trinity-20160301/syscalls/mlockall.c --- old/trinity-20160131/syscalls/mlockall.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/syscalls/mlockall.c 2016-03-01 18:05:38.000000000 +0100 @@ -8,9 +8,15 @@ #include "syscall.h" #include "trinity.h" +#ifndef MCL_CURRENT #define MCL_CURRENT 1 +#endif +#ifndef MCL_FUTURE #define MCL_FUTURE 2 +#endif +#ifndef MCL_ONFAULT #define MCL_ONFAULT 4 +#endif static void sanitise_mlockall(struct syscallrecord *rec) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/syscalls/shmctl.c new/trinity-20160301/syscalls/shmctl.c --- old/trinity-20160131/syscalls/shmctl.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/syscalls/shmctl.c 2016-03-01 18:05:38.000000000 +0100 @@ -1,12 +1,22 @@ /* * SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) */ +#include <linux/ipc.h> +#include <linux/shm.h> #include "sanitise.h" +static unsigned long shmctl_ops[] = { + IPC_STAT, IPC_SET, IPC_RMID, IPC_INFO, + SHM_INFO, SHM_STAT, SHM_LOCK, SHM_UNLOCK, +}; + struct syscallentry syscall_shmctl = { .name = "shmctl", .num_args = 3, .arg1name = "shmid", .arg2name = "cmd", + .arg2type = ARG_OP, + .arg2list = ARGLIST(shmctl_ops), .arg3name = "buf", + .arg3type = ARG_ADDRESS, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/sysv-shm.c new/trinity-20160301/sysv-shm.c --- old/trinity-20160131/sysv-shm.c 1970-01-01 01:00:00.000000000 +0100 +++ new/trinity-20160301/sysv-shm.c 2016-03-01 18:05:38.000000000 +0100 @@ -0,0 +1,56 @@ +/* + * SYSV Shared mapping creation. + */ + +#include <sys/shm.h> +#include <limits.h> + +#include "arch.h" +#include "compat.h" +#include "random.h" +#include "sysv-shm.h" +#include "objects.h" +#include "utils.h" + +void create_sysv_shms(void) +{ + unsigned int i; + int shmget_flags[] = { + 0, // Just CREAT|EXCL + SHM_HUGETLB|SHM_HUGE_2MB, + SHM_HUGETLB|SHM_HUGE_1GB, + SHM_NORESERVE, + SHM_HUGETLB|SHM_HUGE_2MB|SHM_NORESERVE, + SHM_HUGETLB|SHM_HUGE_1GB|SHM_NORESERVE, + }; + + for (i = 0; i < ARRAY_SIZE(shmget_flags); i++) { + void *p; + struct object *obj; + size_t size = 0; + int flags; + int id; + + obj = alloc_object(); + + flags = 0660 | IPC_CREAT | IPC_EXCL | shmget_flags[i]; + + size = page_size * (1 + rnd() % 10); + + id = shmget(IPC_PRIVATE, page_size, flags); + if (id == -1) { + free(obj); + continue; + } + obj->sysv_shm.id = id; + obj->sysv_shm.flags = flags; + obj->sysv_shm.size = size; + + add_object(obj, OBJ_GLOBAL, OBJ_SYSV_SHM); + + p = shmat(id, NULL, 0); // TODO: Try alternative flags. + if (p != (void *) -1) + obj->sysv_shm.ptr = p; + } + //dump_objects(OBJ_GLOBAL, OBJ_SYSV_SHM); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/tables-uniarch.c new/trinity-20160301/tables-uniarch.c --- old/trinity-20160131/tables-uniarch.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/tables-uniarch.c 2016-03-01 18:05:38.000000000 +0100 @@ -121,10 +121,11 @@ void deactivate_disabled_syscalls_uniarch(void) { - struct syscallentry *entry; unsigned int i; for_each_syscall(i) { + struct syscallentry *entry; + entry = syscalls[i].entry; if (entry->flags & TO_BE_DEACTIVATED) { entry->flags &= ~(ACTIVE|TO_BE_DEACTIVATED); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trinity-20160131/trinity.c new/trinity-20160301/trinity.c --- old/trinity-20160131/trinity.c 2016-02-02 09:27:02.000000000 +0100 +++ new/trinity-20160301/trinity.c 2016-03-01 18:05:38.000000000 +0100 @@ -18,6 +18,7 @@ #include "random.h" #include "signals.h" #include "shm.h" +#include "sysv-shm.h" #include "futex.h" #include "tables.h" #include "taint.h" @@ -164,7 +165,10 @@ parse_devices(); + /* FIXME: Some better object construction method needed. */ create_futexes(); + create_sysv_shms(); + setup_main_signals();
