move phonet sockaddr code out to own file
Move sockaddr main file to net/
split the protocol decoding code out of sockets.c to own file in net/
50% of the time, write a single byte
change permissions back on tmp dir if they have changed.

also, exclude sendmsg for now until oops w/connect is fixed
perf_event_open updates

- add missing PERF_COUNT_HW_REF_CPU_CYCLES
- use get_len for more interesting lengths than rand()
make sure we clear reserved bits in perf struct
rename hw to attr
fill out some more fields
net: add generation of semi-random BPF filters

BPF filters are used in networking and in application sand-boxing
and even have a arch-dependant JIT compiler in the kernel, so add
a more detailed semi-random BPF generator.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
net: bpf: increase the chance that the semi-random bpf is run

The kernel filter code expects us to have a return instruction and
that won't be changed in the kernel code. So increase the chance that
we can also get past the filter precheck and run this fuzzed filter
code.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
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...