MCPcopy Create free account
hub / github.com/F-Stack/f-stack / eval_mbuf_store

Function eval_mbuf_store

dpdk/lib/bpf/bpf_validate.c:865–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863}
864
865static const char *
866eval_mbuf_store(const struct bpf_reg_val *rv, uint32_t opsz)
867{
868 uint32_t i;
869
870 static const struct {
871 size_t off;
872 size_t sz;
873 } mbuf_ro_fileds[] = {
874 { .off = offsetof(struct rte_mbuf, buf_addr), },
875 { .off = offsetof(struct rte_mbuf, refcnt), },
876 { .off = offsetof(struct rte_mbuf, nb_segs), },
877 { .off = offsetof(struct rte_mbuf, buf_len), },
878 { .off = offsetof(struct rte_mbuf, pool), },
879 { .off = offsetof(struct rte_mbuf, next), },
880 { .off = offsetof(struct rte_mbuf, priv_size), },
881 };
882
883 for (i = 0; i != RTE_DIM(mbuf_ro_fileds) &&
884 (mbuf_ro_fileds[i].off + mbuf_ro_fileds[i].sz <=
885 rv->u.max || rv->u.max + opsz <= mbuf_ro_fileds[i].off);
886 i++)
887 ;
888
889 if (i != RTE_DIM(mbuf_ro_fileds))
890 return "store to the read-only mbuf field";
891
892 return NULL;
893
894}
895
896static const char *
897eval_store(struct bpf_verifier *bvf, const struct ebpf_insn *ins)

Callers 1

eval_storeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected