Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Browse files Browse the repository at this point in the history
Daniel Borkmann says:

====================
pull-request: bpf 2020-08-28

The following pull-request contains BPF updates for your *net* tree.

We've added 4 non-merge commits during the last 4 day(s) which contain
a total of 4 files changed, 7 insertions(+), 4 deletions(-).

The main changes are:

1) Fix out of bounds access for BPF_OBJ_GET_INFO_BY_FD retrieval, from Yonghong Song.

2) Fix wrong __user annotation in bpf_stats sysctl handler, from Tobias Klauser.

3) Few fixes for BPF selftest scripting in test_{progs,maps}, from Jesper Dangaard Brouer.
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Aug 28, 2020
2 parents 5438dd4 + fa45056 commit c8146fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kernel/bpf/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@ static int bpf_raw_tp_link_fill_link_info(const struct bpf_link *link,
u32 ulen = info->raw_tracepoint.tp_name_len;
size_t tp_len = strlen(tp_name);

if (ulen && !ubuf)
if (!ulen ^ !ubuf)
return -EINVAL;

info->raw_tracepoint.tp_name_len = tp_len + 1;
Expand Down
3 changes: 1 addition & 2 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ static int max_extfrag_threshold = 1000;

#if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_SYSCTL)
static int bpf_stats_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos)
void *buffer, size_t *lenp, loff_t *ppos)
{
struct static_key *key = (struct static_key *)table->data;
static int saved_val;
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/bpf/test_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,8 @@ static void __run_parallel(unsigned int tasks,
pid_t pid[tasks];
int i;

fflush(stdout);

for (i = 0; i < tasks; i++) {
pid[i] = fork();
if (pid[i] == 0) {
Expand Down
4 changes: 3 additions & 1 deletion tools/testing/selftests/bpf/test_progs.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,9 @@ int cd_flavor_subdir(const char *exec_name)
if (!flavor)
return 0;
flavor++;
fprintf(stdout, "Switching to flavor '%s' subdirectory...\n", flavor);
if (env.verbosity > VERBOSE_NONE)
fprintf(stdout, "Switching to flavor '%s' subdirectory...\n", flavor);

return chdir(flavor);
}

Expand Down

0 comments on commit c8146fe

Please sign in to comment.