GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.kernel.org — Livepatching APIs — The Linux Kernel documentation Livepatching APIs¶Livepatch Enablement¶Parameters
Description Initializes the data structure associated with the patch, creates the sysfs interface, performs the needed symbol lookups and code relocations, registers the patched functions with ftrace. This function is supposed to be called from the livepatch Return 0 on success, otherwise error Shadow Variables¶
Parameters
Return the shadow variable data element, NULL on failure.
Parameters
Description Allocates size bytes for new shadow variable data using gfp_flags. The data are zeroed by default. They are further initialized by ctor function if it is not NULL. The new shadow variable is then added to the global hashtable. If an existing <obj, id> shadow variable can be found, this routine will issue a WARN, exit early and return NULL. This function guarantees that the constructor function is called only when the variable did not exist before. The cost is that ctor is called in atomic context under a spin lock. Return the shadow variable data element, NULL on duplicate or failure.
Parameters
Description Returns a pointer to existing shadow data if an <obj, id> shadow
variable is already present. Otherwise, it creates a new shadow
variable like This function guarantees that only one shadow variable exists with the given id for the given obj. It also guarantees that the constructor function will be called only when the variable did not exist before. The cost is that ctor is called in atomic context under a spin lock. Return the shadow variable data element, NULL on failure.
Parameters
Description This function releases the memory for this <obj, id> shadow variable instance, callers should stop referencing it accordingly.
Parameters
Description This function releases the memory for all <_, id> shadow variable instances, callers should stop referencing them accordingly. System State Changes¶
Parameters
Description Checks whether the given patch modifies the given system state. The function can be called either from pre/post (un)patch callbacks or from the kernel code added by the livepatch. Return pointer to
Parameters
Description Checks whether already installed livepatches modify the given system state. The same system state can be modified by more non-cumulative livepatches. It is expected that the latest livepatch has the most up-to-date information. The function can be called only during transition when a new livepatch is being enabled or when such a transition is reverted. It is typically called only from pre/post (un)patch callbacks. Return pointer to the latest Object Types¶
Definition: struct klp_func {
const char *old_name;
void *new_func;
unsigned long old_sympos;
void *old_func;
struct kobject kobj;
struct list_head node;
struct list_head stack_node;
struct klp_object *obj;
unsigned long old_size, new_size;
bool nop;
bool patched;
bool transition;
};
Members
Description The patched and transition variables define the func’s patching state. When patching, a func is always in one of the following states:
And when unpatching, it goes in the reverse order:
Definition: struct klp_object {
const char *name;
struct klp_func *funcs;
struct klp_callbacks callbacks;
struct kobject kobj;
struct list_head func_list;
struct list_head node;
struct klp_patch *patch;
struct module *mod;
bool dynamic;
bool patched;
};
Members
Definition: struct klp_state {
unsigned long id;
unsigned int version;
void *data;
};
Members
Definition: struct klp_patch {
struct module *mod;
struct klp_object *objs;
struct klp_state *states;
bool replace;
struct list_head list;
struct kobject kobj;
struct list_head obj_list;
bool enabled;
bool forced;
struct work_struct free_work;
struct completion finish;
};
Members
Definition: struct klp_callbacks {
klp_pre_patch_t pre_patch;
klp_post_patch_t post_patch;
klp_pre_unpatch_t pre_unpatch;
klp_post_unpatch_t post_unpatch;
bool post_unpatch_enabled;
};
Members
Description All callbacks are optional. Only the pre-patch callback, if provided, will be unconditionally executed. If the parent klp_object fails to patch for any reason, including a non-zero error status returned from the pre-patch callback, no further callbacks will be executed. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |