diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-18 09:08:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-18 09:08:05 +0100 |
commit | d9e3d899bc7a852d44b3305ed49799fbf090e756 (patch) | |
tree | f3a75cb5f60be908a4384bd9e7add08486d7d338 /tools/testing | |
parent | cc2e60dfa6ba4ff2c054bca932b9afc8702a2f9a (diff) | |
parent | 1291a0d5049dbc06baaaf66a9ff3f53db493b19b (diff) |
Merge 4.15-rc4 into usb-next
We want the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/bpf/Makefile | 1 | ||||
-rw-r--r-- | tools/testing/selftests/bpf/test_verifier_log.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 333a48655ee0..792af7c3b74f 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 + LIBDIR := ../../../lib BPFDIR := $(LIBDIR)/bpf APIDIR := ../../../include/uapi diff --git a/tools/testing/selftests/bpf/test_verifier_log.c b/tools/testing/selftests/bpf/test_verifier_log.c index 3cc0b561489e..e9626cf5607a 100644 --- a/tools/testing/selftests/bpf/test_verifier_log.c +++ b/tools/testing/selftests/bpf/test_verifier_log.c @@ -3,6 +3,8 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <sys/time.h> +#include <sys/resource.h> #include <linux/bpf.h> #include <linux/filter.h> @@ -131,11 +133,16 @@ static void test_log_bad(char *log, size_t log_len, int log_level) int main(int argc, char **argv) { + struct rlimit limit = { RLIM_INFINITY, RLIM_INFINITY }; char full_log[LOG_SIZE]; char log[LOG_SIZE]; size_t want_len; int i; + /* allow unlimited locked memory to have more consistent error code */ + if (setrlimit(RLIMIT_MEMLOCK, &limit) < 0) + perror("Unable to lift memlock rlimit"); + memset(log, 1, LOG_SIZE); /* Test incorrect attr */ |