aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-05-02 20:42:44 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-02 20:42:44 -0400
commite002434e88882d8f8205619b5b8f1d8e373a2724 (patch)
treec8552f572cec86de50662251ce04c36e28eddc48 /tools
parent7df40c2673a1307c3260aab6f9d4b9bf97ca8fd7 (diff)
parentb5b6ff730253ab68ec230e239c4245cb1e8a5397 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Daniel Borkmann says: ==================== pull-request: bpf 2018-05-03 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Several BPF sockmap fixes mostly related to bugs in error path handling, that is, a bug in updating the scatterlist length / offset accounting, a missing sk_mem_uncharge() in redirect error handling, and a bug where the outstanding bytes counter sg_size was not zeroed, from John. 2) Fix two memory leaks in the x86-64 BPF JIT, one in an error path where we still don't converge after image was allocated and another one where BPF calls are used and JIT passes don't converge, from Daniel. 3) Minor fix in BPF selftests where in test_stacktrace_build_id() we drop useless args in urandom_read and we need to add a missing newline in a CHECK() error message, from Song. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/bpf/bpf_dbg.c7
-rw-r--r--tools/testing/selftests/bpf/test_progs.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/tools/bpf/bpf_dbg.c b/tools/bpf/bpf_dbg.c
index 4f254bcc4423..61b9aa5d6415 100644
--- a/tools/bpf/bpf_dbg.c
+++ b/tools/bpf/bpf_dbg.c
@@ -1063,7 +1063,7 @@ static int cmd_load_pcap(char *file)
1063 1063
1064static int cmd_load(char *arg) 1064static int cmd_load(char *arg)
1065{ 1065{
1066 char *subcmd, *cont, *tmp = strdup(arg); 1066 char *subcmd, *cont = NULL, *tmp = strdup(arg);
1067 int ret = CMD_OK; 1067 int ret = CMD_OK;
1068 1068
1069 subcmd = strtok_r(tmp, " ", &cont); 1069 subcmd = strtok_r(tmp, " ", &cont);
@@ -1073,7 +1073,10 @@ static int cmd_load(char *arg)
1073 bpf_reset(); 1073 bpf_reset();
1074 bpf_reset_breakpoints(); 1074 bpf_reset_breakpoints();
1075 1075
1076 ret = cmd_load_bpf(cont); 1076 if (!cont)
1077 ret = CMD_ERR;
1078 else
1079 ret = cmd_load_bpf(cont);
1077 } else if (matches(subcmd, "pcap") == 0) { 1080 } else if (matches(subcmd, "pcap") == 0) {
1078 ret = cmd_load_pcap(cont); 1081 ret = cmd_load_pcap(cont);
1079 } else { 1082 } else {
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index faadbe233966..4123d0ab90ba 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -1108,7 +1108,7 @@ static void test_stacktrace_build_id(void)
1108 1108
1109 assert(system("dd if=/dev/urandom of=/dev/zero count=4 2> /dev/null") 1109 assert(system("dd if=/dev/urandom of=/dev/zero count=4 2> /dev/null")
1110 == 0); 1110 == 0);
1111 assert(system("./urandom_read if=/dev/urandom of=/dev/zero count=4 2> /dev/null") == 0); 1111 assert(system("./urandom_read") == 0);
1112 /* disable stack trace collection */ 1112 /* disable stack trace collection */
1113 key = 0; 1113 key = 0;
1114 val = 1; 1114 val = 1;
@@ -1158,7 +1158,7 @@ static void test_stacktrace_build_id(void)
1158 } while (bpf_map_get_next_key(stackmap_fd, &previous_key, &key) == 0); 1158 } while (bpf_map_get_next_key(stackmap_fd, &previous_key, &key) == 0);
1159 1159
1160 CHECK(build_id_matches < 1, "build id match", 1160 CHECK(build_id_matches < 1, "build id match",
1161 "Didn't find expected build ID from the map"); 1161 "Didn't find expected build ID from the map\n");
1162 1162
1163disable_pmu: 1163disable_pmu:
1164 ioctl(pmu_fd, PERF_EVENT_IOC_DISABLE); 1164 ioctl(pmu_fd, PERF_EVENT_IOC_DISABLE);