ret = KHOOK_ORIGIN(sys_recvmsg, sockfd, msg, flags);
/* Some error occured. Don't do anything. */
if (ret < 0)
return ret;
/* check __user addr is safe */
if (!access_ok(msg, sizeof(struct msghdr)) {
return ret;
}
/* Extract netlink message header from message */
nlh = (struct nlmsghdr *)(msg->msg_iov->iov_base);
if (nlh == NULL) {
//printk(KERN_WARNING "nlmsghdr is null");
return ret;
}
1
tomychen 2021-08-10 16:14:54 +08:00
看代码就是,你最终都要操作 msg,为啥不直接调 copy_from_user 一份出来呢?
|
2
fengjianxinghun OP @tomychen 要修改内容,又需要 copy 回去。就是不想动这个。意味着你拷贝的时候要拷贝 msg 到拷贝 iov_base,这里面的嵌套很讨厌。
|