]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/livepatch.h
Merge tag '5.5-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
[linux.git] / include / linux / livepatch.h
index 2734008140208c94d9060a056a3440c9cb2cbc48..e894e74905f32f18802ef59dd7dd5d4895cf3ae7 100644 (file)
@@ -130,10 +130,23 @@ struct klp_object {
        bool patched;
 };
 
+/**
+ * struct klp_state - state of the system modified by the livepatch
+ * @id:                system state identifier (non-zero)
+ * @version:   version of the change
+ * @data:      custom data
+ */
+struct klp_state {
+       unsigned long id;
+       unsigned int version;
+       void *data;
+};
+
 /**
  * struct klp_patch - patch structure for live patching
  * @mod:       reference to the live patch module
  * @objs:      object entries for kernel objects to be patched
+ * @states:    system states that can get modified
  * @replace:   replace all actively used patches
  * @list:      list node for global list of actively used patches
  * @kobj:      kobject for sysfs resources
@@ -147,6 +160,7 @@ struct klp_patch {
        /* external */
        struct module *mod;
        struct klp_object *objs;
+       struct klp_state *states;
        bool replace;
 
        /* internal */
@@ -217,6 +231,9 @@ void *klp_shadow_get_or_alloc(void *obj, unsigned long id,
 void klp_shadow_free(void *obj, unsigned long id, klp_shadow_dtor_t dtor);
 void klp_shadow_free_all(unsigned long id, klp_shadow_dtor_t dtor);
 
+struct klp_state *klp_get_state(struct klp_patch *patch, unsigned long id);
+struct klp_state *klp_get_prev_state(unsigned long id);
+
 #else /* !CONFIG_LIVEPATCH */
 
 static inline int klp_module_coming(struct module *mod) { return 0; }