@@ -1537,7 +1537,7 @@ struct bpf_link_primer {
struct bpf_struct_ops_value;
struct btf_member;
-#define BPF_STRUCT_OPS_MAX_NR_MEMBERS 64
+#define BPF_STRUCT_OPS_MAX_NR_MEMBERS 128
struct bpf_struct_ops {
const struct bpf_verifier_ops *verifier_ops;
int (*init)(struct btf *btf);
@@ -417,7 +417,7 @@ static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key,
udata = &uvalue->data;
kdata = &kvalue->data;
image = st_map->image;
- image_end = st_map->image + PAGE_SIZE;
+ image_end = st_map->image + 2 * PAGE_SIZE;
for_each_member(i, t, member) {
const struct btf_type *mtype, *ptype;
@@ -688,7 +688,7 @@ static struct bpf_map *bpf_struct_ops_map_alloc(union bpf_attr *attr)
st_map->links =
bpf_map_area_alloc(btf_type_vlen(t) * sizeof(struct bpf_links *),
NUMA_NO_NODE);
- st_map->image = bpf_jit_alloc_exec(PAGE_SIZE);
+ st_map->image = bpf_jit_alloc_exec(2 * PAGE_SIZE);
if (!st_map->uvalue || !st_map->links || !st_map->image) {
__bpf_struct_ops_map_free(map);
return ERR_PTR(-ENOMEM);
Fuse bpf goes a bit past the '64' limit here, although in reality, this limit seems to be more like 37. After 37, we start overrunning the safety checks while setting up the trampoline. This simply doubles some of these values. This will have the same issue, as we'll run out of space way before hitting the 128 limit, but for now that unblocks fuse-bpf. Signed-off-by: Daniel Rosenberg <drosen@google.com> --- include/linux/bpf.h | 2 +- kernel/bpf/bpf_struct_ops.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)