History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Conflicts: drivers/net/can/dev.c commit 03f16c5075b2 ("can: dev: can_restart: fix use after free bug") commit 3e77f70e7345 ("can: dev: move driver related infrastructure into separate subdir") Code move. drivers/net/dsa/b53/b53_common.c commit 8e4052c32d6b ("net: dsa: b53: fix an off by one in checking "vlan->vid"") commit b7a9e0da2d1c ("net: switchdev: remove vid_begin -> vid_end range from VLAN objects") Field rename.

Jakub Kicinski committed 5 years ago

Commit 0fe2f272 parents 7b8fc01 75439bc285 files · +3212 −1446Browse files

Showing the changes to kernel (8 of 285 files). Show all

Unified · Split

8 files
  1. kernel/bpf/bpf_inode_storage.c +6 −3
  2. kernel/bpf/bpf_task_storage.c +4 −1
  3. kernel/bpf/btf.c +1 −1
  4. kernel/bpf/cgroup.c +3 −2
  5. kernel/bpf/helpers.c +1 −1
  6. kernel/bpf/syscall.c +4 −2
  7. kernel/bpf/verifier.c +5 −3
  8. kernel/signal.c +3 −0
kernel/bpf/bpf_inode_storage.c+6−3
@@ -176,14 +176,14 @@ BPF_CALL_4(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode, · 175 unmodified lines
176176 * bpf_local_storage_update expects the owner to have a
177177 * valid storage pointer.
178178 */
179− if (!inode_storage_ptr(inode))
179+ if (!inode || !inode_storage_ptr(inode))
180180 return (unsigned long)NULL;
181181
182182 sdata = inode_storage_lookup(inode, map, true);
183183 if (sdata)
184184 return (unsigned long)sdata->data;
185185
186− /* This helper must only called from where the inode is gurranteed
186+ /* This helper must only called from where the inode is guaranteed
187187 * to have a refcount and cannot be freed.
188188 */
189189 if (flags & BPF_LOCAL_STORAGE_GET_F_CREATE) {
@@ -200,7 +200,10 @@ BPF_CALL_4(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode, · 10 unmodified lines
200200 BPF_CALL_2(bpf_inode_storage_delete,
201201 struct bpf_map *, map, struct inode *, inode)
202202 {
203− /* This helper must only called from where the inode is gurranteed
203+ if (!inode)
204+ return -EINVAL;
205+
206+ /* This helper must only called from where the inode is guaranteed
204207 * to have a refcount and cannot be freed.
205208 */
206209 return inode_storage_delete(inode, map);
kernel/bpf/bpf_task_storage.c+4−1
@@ -218,7 +218,7 @@ BPF_CALL_4(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, · 217 unmodified lines
218218 * bpf_local_storage_update expects the owner to have a
219219 * valid storage pointer.
220220 */
221− if (!task_storage_ptr(task))
221+ if (!task || !task_storage_ptr(task))
222222 return (unsigned long)NULL;
223223
224224 sdata = task_storage_lookup(task, map, true);
@@ -243,6 +243,9 @@ BPF_CALL_4(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, · 18 unmodified lines
243243 BPF_CALL_2(bpf_task_storage_delete, struct bpf_map *, map, struct task_struct *,
244244 task)
245245 {
246+ if (!task)
247+ return -EINVAL;
248+
246249 /* This helper must only be called from places where the lifetime of the task
247250 * is guaranteed. Either by being refcounted or by being protected
248251 * by an RCU read-side critical section.
kernel/bpf/btf.c+1−1
@@ -4172,7 +4172,7 @@ static int btf_parse_hdr(struct btf_verifier_env *env) · 4171 unmodified lines
41724172 return -ENOTSUPP;
41734173 }
41744174
4175− if (btf_data_size == hdr->hdr_len) {
4175+ if (!btf->base_btf && btf_data_size == hdr->hdr_len) {
41764176 btf_verifier_log(env, "No data");
41774177 return -EINVAL;
41784178 }
kernel/bpf/cgroup.c+3−2
@@ -1391,12 +1391,13 @@ int __cgroup_bpf_run_filter_setsockopt(struct sock *sk, int *level, · 1390 unmodified lines
13911391 if (ctx.optlen != 0) {
13921392 *optlen = ctx.optlen;
13931393 *kernel_optval = ctx.optval;
1394+ /* export and don't free sockopt buf */
1395+ return 0;
13941396 }
13951397 }
13961398
13971399 out:
1398− if (ret)
1399− sockopt_free_buf(&ctx);
1400+ sockopt_free_buf(&ctx);
14001401 return ret;
14011402 }
14021403
kernel/bpf/helpers.c+1−1
@@ -108,7 +108,7 @@ BPF_CALL_2(bpf_map_peek_elem, struct bpf_map *, map, void *, value) · 107 unmodified lines
108108 }
109109
110110 const struct bpf_func_proto bpf_map_peek_elem_proto = {
111− .func = bpf_map_pop_elem,
111+ .func = bpf_map_peek_elem,
112112 .gpl_only = false,
113113 .ret_type = RET_INTEGER,
114114 .arg1_type = ARG_CONST_MAP_PTR,
kernel/bpf/syscall.c+4−2
@@ -2712,7 +2712,6 @@ out_unlock: · 2711 unmodified lines
27122712 out_put_prog:
27132713 if (tgt_prog_fd && tgt_prog)
27142714 bpf_prog_put(tgt_prog);
2715− bpf_prog_put(prog);
27162715 return err;
27172716 }
27182717
@@ -2825,7 +2824,10 @@ static int bpf_raw_tracepoint_open(const union bpf_attr *attr) · 106 unmodified lines
28252824 tp_name = prog->aux->attach_func_name;
28262825 break;
28272826 }
2828− return bpf_tracing_prog_attach(prog, 0, 0);
2827+ err = bpf_tracing_prog_attach(prog, 0, 0);
2828+ if (err >= 0)
2829+ return err;
2830+ goto out_put_prog;
28292831 case BPF_PROG_TYPE_RAW_TRACEPOINT:
28302832 case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE:
28312833 if (strncpy_from_user(buf,
kernel/bpf/verifier.c+5−3
@@ -2217,6 +2217,8 @@ static bool is_spillable_regtype(enum bpf_reg_type type) · 2216 unmodified lines
22172217 case PTR_TO_RDWR_BUF:
22182218 case PTR_TO_RDWR_BUF_OR_NULL:
22192219 case PTR_TO_PERCPU_BTF_ID:
2220+ case PTR_TO_MEM:
2221+ case PTR_TO_MEM_OR_NULL:
22202222 return true;
22212223 default:
22222224 return false;
@@ -5352,7 +5354,7 @@ static bool signed_add_overflows(s64 a, s64 b) · 3129 unmodified lines
53525354 return res < a;
53535355 }
53545356
5355−static bool signed_add32_overflows(s64 a, s64 b)
5357+static bool signed_add32_overflows(s32 a, s32 b)
53565358 {
53575359 /* Do the add in u32, where overflow is well-defined */
53585360 s32 res = (s32)((u32)a + (u32)b);
@@ -5362,7 +5364,7 @@ static bool signed_add32_overflows(s64 a, s64 b) · 3 unmodified lines
53625364 return res < a;
53635365 }
53645366
5365−static bool signed_sub_overflows(s32 a, s32 b)
5367+static bool signed_sub_overflows(s64 a, s64 b)
53665368 {
53675369 /* Do the sub in u64, where overflow is well-defined */
53685370 s64 res = (s64)((u64)a - (u64)b);
@@ -5374,7 +5376,7 @@ static bool signed_sub_overflows(s32 a, s32 b) · 5 unmodified lines
53745376
53755377 static bool signed_sub32_overflows(s32 a, s32 b)
53765378 {
5377− /* Do the sub in u64, where overflow is well-defined */
5379+ /* Do the sub in u32, where overflow is well-defined */
53785380 s32 res = (s32)((u32)a - (u32)b);
53795381
53805382 if (b < 0)
kernel/signal.c+3−0
@@ -2550,6 +2550,9 @@ bool get_signal(struct ksignal *ksig) · 2549 unmodified lines
25502550 struct signal_struct *signal = current->signal;
25512551 int signr;
25522552
2553+ if (unlikely(current->task_works))
2554+ task_work_run();
2555+
25532556 /*
25542557 * For non-generic architectures, check for TIF_NOTIFY_SIGNAL so
25552558 * that the arch handlers don't all have to do it. If we get here

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t