return (void *)p__refcounted_kptr;
 }
 
-static int __bpf_list_add(struct bpf_list_node *node, struct bpf_list_head *head,
+static int __bpf_list_add(struct bpf_list_node_kern *node,
+                         struct bpf_list_head *head,
                          bool tail, struct btf_record *rec, u64 off)
 {
-       struct list_head *n = (void *)node, *h = (void *)head;
+       struct list_head *n = &node->list_head, *h = (void *)head;
 
        /* If list_head was 0-initialized by map, bpf_obj_init_field wasn't
         * called on its fields, so init here
                                         struct bpf_list_node *node,
                                         void *meta__ign, u64 off)
 {
+       struct bpf_list_node_kern *n = (void *)node;
        struct btf_struct_meta *meta = meta__ign;
 
-       return __bpf_list_add(node, head, false,
-                             meta ? meta->record : NULL, off);
+       return __bpf_list_add(n, head, false, meta ? meta->record : NULL, off);
 }
 
 __bpf_kfunc int bpf_list_push_back_impl(struct bpf_list_head *head,
                                        struct bpf_list_node *node,
                                        void *meta__ign, u64 off)
 {
+       struct bpf_list_node_kern *n = (void *)node;
        struct btf_struct_meta *meta = meta__ign;
 
-       return __bpf_list_add(node, head, true,
-                             meta ? meta->record : NULL, off);
+       return __bpf_list_add(n, head, true, meta ? meta->record : NULL, off);
 }
 
 static struct bpf_list_node *__bpf_list_del(struct bpf_list_head *head, bool tail)
                                                  struct bpf_rb_node *node)
 {
        struct rb_root_cached *r = (struct rb_root_cached *)root;
-       struct rb_node *n = (struct rb_node *)node;
+       struct rb_node *n = &((struct bpf_rb_node_kern *)node)->rb_node;
 
        if (RB_EMPTY_NODE(n))
                return NULL;
 /* Need to copy rbtree_add_cached's logic here because our 'less' is a BPF
  * program
  */
-static int __bpf_rbtree_add(struct bpf_rb_root *root, struct bpf_rb_node *node,
+static int __bpf_rbtree_add(struct bpf_rb_root *root,
+                           struct bpf_rb_node_kern *node,
                            void *less, struct btf_record *rec, u64 off)
 {
        struct rb_node **link = &((struct rb_root_cached *)root)->rb_root.rb_node;
-       struct rb_node *parent = NULL, *n = (struct rb_node *)node;
+       struct rb_node *parent = NULL, *n = &node->rb_node;
        bpf_callback_t cb = (bpf_callback_t)less;
        bool leftmost = true;
 
                                    void *meta__ign, u64 off)
 {
        struct btf_struct_meta *meta = meta__ign;
+       struct bpf_rb_node_kern *n = (void *)node;
 
-       return __bpf_rbtree_add(root, node, (void *)less, meta ? meta->record : NULL, off);
+       return __bpf_rbtree_add(root, n, (void *)less, meta ? meta->record : NULL, off);
 }
 
 __bpf_kfunc struct bpf_rb_node *bpf_rbtree_first(struct bpf_rb_root *root)