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.
Showing the changes to kernel (8 of 285 files). Show all
Unified · Split
| @@ -176,14 +176,14 @@ BPF_CALL_4(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode, · 175 unmodified lines | |||
| 176 | * bpf_local_storage_update expects the owner to have a | 176 | * bpf_local_storage_update expects the owner to have a |
| 177 | * valid storage pointer. | 177 | * valid storage pointer. |
| 178 | */ | 178 | */ |
| 179 | if (!inode_storage_ptr(inode)) | 179 | if (!inode || !inode_storage_ptr(inode)) |
| 180 | return (unsigned long)NULL; | 180 | return (unsigned long)NULL; |
| 181 | 181 | ||
| 182 | sdata = inode_storage_lookup(inode, map, true); | 182 | sdata = inode_storage_lookup(inode, map, true); |
| 183 | if (sdata) | 183 | if (sdata) |
| 184 | return (unsigned long)sdata->data; | 184 | return (unsigned long)sdata->data; |
| 185 | 185 | ||
| 186 | /* This helper must only called from where the inode is gurranteed | 186 | /* This helper must only called from where the inode is guaranteed |
| 187 | * to have a refcount and cannot be freed. | 187 | * to have a refcount and cannot be freed. |
| 188 | */ | 188 | */ |
| 189 | if (flags & BPF_LOCAL_STORAGE_GET_F_CREATE) { | 189 | 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 | |||
| 200 | BPF_CALL_2(bpf_inode_storage_delete, | 200 | BPF_CALL_2(bpf_inode_storage_delete, |
| 201 | struct bpf_map *, map, struct inode *, inode) | 201 | struct bpf_map *, map, struct inode *, inode) |
| 202 | { | 202 | { |
| 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 | ||
| 204 | * to have a refcount and cannot be freed. | 207 | * to have a refcount and cannot be freed. |
| 205 | */ | 208 | */ |
| 206 | return inode_storage_delete(inode, map); | 209 | return inode_storage_delete(inode, map); |
| @@ -218,7 +218,7 @@ BPF_CALL_4(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, · 217 unmodified lines | |||
| 218 | * bpf_local_storage_update expects the owner to have a | 218 | * bpf_local_storage_update expects the owner to have a |
| 219 | * valid storage pointer. | 219 | * valid storage pointer. |
| 220 | */ | 220 | */ |
| 221 | if (!task_storage_ptr(task)) | 221 | if (!task || !task_storage_ptr(task)) |
| 222 | return (unsigned long)NULL; | 222 | return (unsigned long)NULL; |
| 223 | 223 | ||
| 224 | sdata = task_storage_lookup(task, map, true); | 224 | 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 | |||
| 243 | BPF_CALL_2(bpf_task_storage_delete, struct bpf_map *, map, struct task_struct *, | 243 | BPF_CALL_2(bpf_task_storage_delete, struct bpf_map *, map, struct task_struct *, |
| 244 | task) | 244 | task) |
| 245 | { | 245 | { |
| 246 | if (!task) | ||
| 247 | return -EINVAL; | ||
| 248 | |||
| 246 | /* This helper must only be called from places where the lifetime of the task | 249 | /* This helper must only be called from places where the lifetime of the task |
| 247 | * is guaranteed. Either by being refcounted or by being protected | 250 | * is guaranteed. Either by being refcounted or by being protected |
| 248 | * by an RCU read-side critical section. | 251 | * by an RCU read-side critical section. |
| @@ -4172,7 +4172,7 @@ static int btf_parse_hdr(struct btf_verifier_env *env) · 4171 unmodified lines | |||
| 4172 | return -ENOTSUPP; | 4172 | return -ENOTSUPP; |
| 4173 | } | 4173 | } |
| 4174 | 4174 | ||
| 4175 | if (btf_data_size == hdr->hdr_len) { | 4175 | if (!btf->base_btf && btf_data_size == hdr->hdr_len) { |
| 4176 | btf_verifier_log(env, "No data"); | 4176 | btf_verifier_log(env, "No data"); |
| 4177 | return -EINVAL; | 4177 | return -EINVAL; |
| 4178 | } | 4178 | } |
| @@ -1391,12 +1391,13 @@ int __cgroup_bpf_run_filter_setsockopt(struct sock *sk, int *level, · 1390 unmodified lines | |||
| 1391 | if (ctx.optlen != 0) { | 1391 | if (ctx.optlen != 0) { |
| 1392 | *optlen = ctx.optlen; | 1392 | *optlen = ctx.optlen; |
| 1393 | *kernel_optval = ctx.optval; | 1393 | *kernel_optval = ctx.optval; |
| 1394 | /* export and don't free sockopt buf */ | ||
| 1395 | return 0; | ||
| 1394 | } | 1396 | } |
| 1395 | } | 1397 | } |
| 1396 | 1398 | ||
| 1397 | out: | 1399 | out: |
| 1398 | if (ret) | 1400 | sockopt_free_buf(&ctx); |
| 1399 | sockopt_free_buf(&ctx); | ||
| 1400 | return ret; | 1401 | return ret; |
| 1401 | } | 1402 | } |
| 1402 | 1403 | ||
| @@ -108,7 +108,7 @@ BPF_CALL_2(bpf_map_peek_elem, struct bpf_map *, map, void *, value) · 107 unmodified lines | |||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | const struct bpf_func_proto bpf_map_peek_elem_proto = { | 110 | const struct bpf_func_proto bpf_map_peek_elem_proto = { |
| 111 | .func = bpf_map_pop_elem, | 111 | .func = bpf_map_peek_elem, |
| 112 | .gpl_only = false, | 112 | .gpl_only = false, |
| 113 | .ret_type = RET_INTEGER, | 113 | .ret_type = RET_INTEGER, |
| 114 | .arg1_type = ARG_CONST_MAP_PTR, | 114 | .arg1_type = ARG_CONST_MAP_PTR, |
| @@ -2712,7 +2712,6 @@ out_unlock: · 2711 unmodified lines | |||
| 2712 | out_put_prog: | 2712 | out_put_prog: |
| 2713 | if (tgt_prog_fd && tgt_prog) | 2713 | if (tgt_prog_fd && tgt_prog) |
| 2714 | bpf_prog_put(tgt_prog); | 2714 | bpf_prog_put(tgt_prog); |
| 2715 | bpf_prog_put(prog); | ||
| 2716 | return err; | 2715 | return err; |
| 2717 | } | 2716 | } |
| 2718 | 2717 | ||
| @@ -2825,7 +2824,10 @@ static int bpf_raw_tracepoint_open(const union bpf_attr *attr) · 106 unmodified lines | |||
| 2825 | tp_name = prog->aux->attach_func_name; | 2824 | tp_name = prog->aux->attach_func_name; |
| 2826 | break; | 2825 | break; |
| 2827 | } | 2826 | } |
| 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; | ||
| 2829 | case BPF_PROG_TYPE_RAW_TRACEPOINT: | 2831 | case BPF_PROG_TYPE_RAW_TRACEPOINT: |
| 2830 | case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE: | 2832 | case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE: |
| 2831 | if (strncpy_from_user(buf, | 2833 | if (strncpy_from_user(buf, |
| @@ -2217,6 +2217,8 @@ static bool is_spillable_regtype(enum bpf_reg_type type) · 2216 unmodified lines | |||
| 2217 | case PTR_TO_RDWR_BUF: | 2217 | case PTR_TO_RDWR_BUF: |
| 2218 | case PTR_TO_RDWR_BUF_OR_NULL: | 2218 | case PTR_TO_RDWR_BUF_OR_NULL: |
| 2219 | case PTR_TO_PERCPU_BTF_ID: | 2219 | case PTR_TO_PERCPU_BTF_ID: |
| 2220 | case PTR_TO_MEM: | ||
| 2221 | case PTR_TO_MEM_OR_NULL: | ||
| 2220 | return true; | 2222 | return true; |
| 2221 | default: | 2223 | default: |
| 2222 | return false; | 2224 | return false; |
| @@ -5352,7 +5354,7 @@ static bool signed_add_overflows(s64 a, s64 b) · 3129 unmodified lines | |||
| 5352 | return res < a; | 5354 | return res < a; |
| 5353 | } | 5355 | } |
| 5354 | 5356 | ||
| 5355 | static bool signed_add32_overflows(s64 a, s64 b) | 5357 | static bool signed_add32_overflows(s32 a, s32 b) |
| 5356 | { | 5358 | { |
| 5357 | /* Do the add in u32, where overflow is well-defined */ | 5359 | /* Do the add in u32, where overflow is well-defined */ |
| 5358 | s32 res = (s32)((u32)a + (u32)b); | 5360 | s32 res = (s32)((u32)a + (u32)b); |
| @@ -5362,7 +5364,7 @@ static bool signed_add32_overflows(s64 a, s64 b) · 3 unmodified lines | |||
| 5362 | return res < a; | 5364 | return res < a; |
| 5363 | } | 5365 | } |
| 5364 | 5366 | ||
| 5365 | static bool signed_sub_overflows(s32 a, s32 b) | 5367 | static bool signed_sub_overflows(s64 a, s64 b) |
| 5366 | { | 5368 | { |
| 5367 | /* Do the sub in u64, where overflow is well-defined */ | 5369 | /* Do the sub in u64, where overflow is well-defined */ |
| 5368 | s64 res = (s64)((u64)a - (u64)b); | 5370 | s64 res = (s64)((u64)a - (u64)b); |
| @@ -5374,7 +5376,7 @@ static bool signed_sub_overflows(s32 a, s32 b) · 5 unmodified lines | |||
| 5374 | 5376 | ||
| 5375 | static bool signed_sub32_overflows(s32 a, s32 b) | 5377 | static bool signed_sub32_overflows(s32 a, s32 b) |
| 5376 | { | 5378 | { |
| 5377 | /* Do the sub in u64, where overflow is well-defined */ | 5379 | /* Do the sub in u32, where overflow is well-defined */ |
| 5378 | s32 res = (s32)((u32)a - (u32)b); | 5380 | s32 res = (s32)((u32)a - (u32)b); |
| 5379 | 5381 | ||
| 5380 | if (b < 0) | 5382 | if (b < 0) |
| @@ -2550,6 +2550,9 @@ bool get_signal(struct ksignal *ksig) · 2549 unmodified lines | |||
| 2550 | struct signal_struct *signal = current->signal; | 2550 | struct signal_struct *signal = current->signal; |
| 2551 | int signr; | 2551 | int signr; |
| 2552 | 2552 | ||
| 2553 | if (unlikely(current->task_works)) | ||
| 2554 | task_work_run(); | ||
| 2555 | |||
| 2553 | /* | 2556 | /* |
| 2554 | * For non-generic architectures, check for TIF_NOTIFY_SIGNAL so | 2557 | * For non-generic architectures, check for TIF_NOTIFY_SIGNAL so |
| 2555 | * that the arch handlers don't all have to do it. If we get here | 2558 | * that the arch handlers don't all have to do it. If we get here |