Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e64a7d1

Browse files
gregkhTreehugger Robot
authored andcommitted
Revert "bpf: Prevent tail call between progs attached to different hooks"
This reverts commit 5d5e3b4 which is commit 28ead3e upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: Id8dbbec2cc722d014f33450af1f44801b26b6a8e Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 764ed90 commit e64a7d1

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

include/linux/bpf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ struct bpf_map {
292292
* same prog type, JITed flag and xdp_has_frags flag.
293293
*/
294294
struct {
295-
const struct btf_type *attach_func_proto;
296295
spinlock_t lock;
297296
enum bpf_prog_type type;
298297
bool jited;

kernel/bpf/core.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,6 @@ bool bpf_prog_map_compatible(struct bpf_map *map,
22592259
{
22602260
enum bpf_prog_type prog_type = resolve_prog_type(fp);
22612261
bool ret;
2262-
struct bpf_prog_aux *aux = fp->aux;
22632262

22642263
if (fp->kprobe_override)
22652264
return false;
@@ -2269,7 +2268,7 @@ bool bpf_prog_map_compatible(struct bpf_map *map,
22692268
* in the case of devmap and cpumap). Until device checks
22702269
* are implemented, prohibit adding dev-bound programs to program maps.
22712270
*/
2272-
if (bpf_prog_is_dev_bound(aux))
2271+
if (bpf_prog_is_dev_bound(fp->aux))
22732272
return false;
22742273

22752274
spin_lock(&map->owner.lock);
@@ -2279,26 +2278,12 @@ bool bpf_prog_map_compatible(struct bpf_map *map,
22792278
*/
22802279
map->owner.type = prog_type;
22812280
map->owner.jited = fp->jited;
2282-
map->owner.xdp_has_frags = aux->xdp_has_frags;
2283-
map->owner.attach_func_proto = aux->attach_func_proto;
2281+
map->owner.xdp_has_frags = fp->aux->xdp_has_frags;
22842282
ret = true;
22852283
} else {
22862284
ret = map->owner.type == prog_type &&
22872285
map->owner.jited == fp->jited &&
2288-
map->owner.xdp_has_frags == aux->xdp_has_frags;
2289-
if (ret &&
2290-
map->owner.attach_func_proto != aux->attach_func_proto) {
2291-
switch (prog_type) {
2292-
case BPF_PROG_TYPE_TRACING:
2293-
case BPF_PROG_TYPE_LSM:
2294-
case BPF_PROG_TYPE_EXT:
2295-
case BPF_PROG_TYPE_STRUCT_OPS:
2296-
ret = false;
2297-
break;
2298-
default:
2299-
break;
2300-
}
2301-
}
2286+
map->owner.xdp_has_frags == fp->aux->xdp_has_frags;
23022287
}
23032288
spin_unlock(&map->owner.lock);
23042289

0 commit comments

Comments
 (0)