fix off by one.
add some improvements from test-multi to the test-sequential script
Fix ARM compile when lacking kvm.h

Reported by Folkert van Heusden <folkert.mobiel@gmail.com>
fix off by 1  rand usage
Add KVM symbols for older kernels.

This patch fixes these build errors on 3.4 and older.

  CC	ioctls/kvm.o
ioctls/kvm.c:21:2: error: ‘KVM_S390_UCAS_MAP’ undeclared here (not in a function)
ioctls/kvm.c:22:2: error: ‘KVM_S390_UCAS_UNMAP’ undeclared here (not in a function)
ioctls/kvm.c:23:2: error: ‘KVM_S390_VCPU_FAULT’ undeclared here (not in a function)
ioctls/kvm.c:55:2: error: ‘KVM_ASSIGN_SET_INTX_MASK’ undeclared here (not in a function)
ioctls/kvm.c:56:2: error: ‘KVM_SIGNAL_MSI’ undeclared here (not in a function)
ioctls/kvm.c:114:2: error: ‘KVM_DIRTY_TLB’ undeclared here (not in a function)
ioctls/kvm.c:115:2: error: ‘KVM_GET_ONE_REG’ undeclared here (not in a function)
ioctls/kvm.c:116:2: error: ‘KVM_SET_ONE_REG’ undeclared here (not in a function)
ioctls/kvm.c:117:2: error: ‘KVM_KVMCLOCK_CTRL’ undeclared here (not in a function)
make: *** [ioctls/kvm.o] Error 1

Signed-off-by: Vinson Lee <vlee@twitter.com>
bring back rand64
fix random switches and page construction

Fix truncated page construction, as well as several unreachable switch
statements. Make interesting 32bit number actually 32 bits. Add additional
64 bit construction with high 32bits from interesting-32.

Signed-off-by: Kees Cook <keescook@chromium.org>
perf_event_open() coverage improvements

Here's an updated patch that more or less exercises all of the
perf_event_open() bits, up to around the 3.6 kernel or so.

The patch is standalone against current trinity git.

It could definitely use some review and tuning.

I haven't turned up any issues with it, but that's partly because in my
experience (the recent exploit being an exception) perf_event bugs rarely
manifest with just an open call; they usually involve
reads/writes/ioctls/mmaps/signals on the fd that is opened, as well as
problems after fork/exec or else on complex events made of multiple
perf_event_open() calls chained together (the call can take a previously
opened fd as an argument).  Testing things like this will be more
difficult.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
fix tpacket3_hdr build failure

It is declared iff TPACKET3_HDRLEN is...
compat: define MS_BORN constant
compat: define some KVM_* constants
fix stupid header requirements

pppox needs if_ether.h for ETH_ALEN in if_pppox.h otherwise on old
systems we get:
In file included from net/pppox.c:6:
/usr/include/linux/if_pppox.h:39: error: 'ETH_ALEN' undeclared here (not in a function)

rose needs ax25.h for ax25_address in rose.h otherwise on old
systems we get:
In file included from net/rose.c:5:
/usr/include/linux/rose.h:49: error: expected specifier-qualifier-list before 'ax25_address'
/usr/include/linux/rose.h:57: error: expected specifier-qualifier-list before 'ax25_address'
/usr/include/linux/rose.h:65: error: expected specifier-qualifier-list before 'ax25_address'
/usr/include/linux/rose.h:78: error: expected specifier-qualifier-list before 'ax25_address'
net/rose.c: In function 'gen_rose':
net/rose.c:24: error: 'struct sockaddr_rose' has no member named 'srose_call'
net/rose.c:26: error: 'struct sockaddr_rose' has no member named 'srose_ndigis'
net/rose.c:27: error: 'struct sockaddr_rose' has no member named 'srose_digi'
Make ARG_RANDOM_INT a bit more interesting than rand()
move rand64 to random.h
add a random bool helper
introduce some routines to return single bits.
add an extra short circuit if 0
introduce rand32

to be used in places instead of rand(), to stress the single-bit cases some.
(later, I'll bias it so that rand() is what gets called most the time)
flip high bit randomly.
use rand_bool