/** * struct rethook - The rethook management data structure. * @data: The user-defined data storage. * @handler: The user-defined return hook handler. * @pool: The pool of struct rethook_node. * @ref: The reference counter. * @rcu: The rcu_head for deferred freeing. * * Don't embed to another data structure, because this is a self-destructive * data structure when all rethook_node are freed.
*/ struct rethook { void *data; /* * To avoid sparse warnings, this uses a raw function pointer with * __rcu, instead of rethook_handler_t. But this must be same as * rethook_handler_t.
*/ void (__rcu *handler) (struct rethook_node *, void *, unsignedlong, struct pt_regs *); struct objpool_head pool; struct rcu_head rcu;
};
/** * struct rethook_node - The rethook shadow-stack entry node. * @rcu: The rcu_head for deferred freeing. * @llist: The llist, linked to a struct task_struct::rethooks. * @rethook: The pointer to the struct rethook. * @ret_addr: The storage for the real return address. * @frame: The storage for the frame pointer. * * You can embed this to your extended data structure to store any data * on each entry of the shadow stack.
*/ struct rethook_node { struct rcu_head rcu; struct llist_node llist; struct rethook *rethook; unsignedlong ret_addr; unsignedlong frame;
};
/** * is_rethook_trampoline() - Check whether the address is rethook trampoline * @addr: The address to be checked * * Return true if the @addr is the rethook trampoline address.
*/ staticinlinebool is_rethook_trampoline(unsignedlong addr)
{ return addr == (unsignedlong)dereference_symbol_descriptor(arch_rethook_trampoline);
}
/* If the architecture needs to fixup the return address, implement it. */ void arch_rethook_fixup_return(struct pt_regs *regs, unsignedlong correct_ret_addr);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.