diff options
author | Brian Norris <computersforpeace@gmail.com> | 2017-06-01 14:24:24 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2017-06-01 14:24:24 -0400 |
commit | e3db1289e7432a882823a7effc474aff78868489 (patch) | |
tree | 79188812b29602fe3b3641d55c32cfdc2101f0ef /kernel/bpf/syscall.c | |
parent | c316cf670491def52a396d3bdc5a63ad01f7fefa (diff) | |
parent | 05e97a9eda72d58dba293857df6aac62584ef99a (diff) |
Merge MTD fixes into -next
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r-- | kernel/bpf/syscall.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index fd2411fd6914..265a0d854e33 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c | |||
@@ -783,7 +783,7 @@ struct bpf_prog *bpf_prog_get_type(u32 ufd, enum bpf_prog_type type) | |||
783 | EXPORT_SYMBOL_GPL(bpf_prog_get_type); | 783 | EXPORT_SYMBOL_GPL(bpf_prog_get_type); |
784 | 784 | ||
785 | /* last field in 'union bpf_attr' used by this command */ | 785 | /* last field in 'union bpf_attr' used by this command */ |
786 | #define BPF_PROG_LOAD_LAST_FIELD kern_version | 786 | #define BPF_PROG_LOAD_LAST_FIELD prog_flags |
787 | 787 | ||
788 | static int bpf_prog_load(union bpf_attr *attr) | 788 | static int bpf_prog_load(union bpf_attr *attr) |
789 | { | 789 | { |
@@ -796,6 +796,9 @@ static int bpf_prog_load(union bpf_attr *attr) | |||
796 | if (CHECK_ATTR(BPF_PROG_LOAD)) | 796 | if (CHECK_ATTR(BPF_PROG_LOAD)) |
797 | return -EINVAL; | 797 | return -EINVAL; |
798 | 798 | ||
799 | if (attr->prog_flags & ~BPF_F_STRICT_ALIGNMENT) | ||
800 | return -EINVAL; | ||
801 | |||
799 | /* copy eBPF program license from user space */ | 802 | /* copy eBPF program license from user space */ |
800 | if (strncpy_from_user(license, u64_to_user_ptr(attr->license), | 803 | if (strncpy_from_user(license, u64_to_user_ptr(attr->license), |
801 | sizeof(license) - 1) < 0) | 804 | sizeof(license) - 1) < 0) |