Skip to content

Comment on Ask HN: How to handle kernel struct changes (e.g. iov_iter) in eBPF?

Comments

I define structt iov_iter___old and struct iov_iter___new, and then use bpf_core_field_exists(((struct iov_iter___new )0)->__iov) to judge whether to use struct iov_iter___new iter = (void )&msg->msg_iter or struct iov_iter___old iter = (void *)&msg->msg_iter

I should add that I am in the kprobe tcp_sendmsg function and need to get the contents of the iov field in msg_iter.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.