kpatch/kmod/patch
Jessica Yu 0bb5c106ef kmod: restructure kpatch sysfs tree
Restructure kpatch's sysfs interface and mirror the sysfs tree after
livepatch's sysfs layout. With the current sysfs layout, we cannot
distinguish which object a function belongs to, and we cannot tell which
modules/objects are patched. Therefore, restructure the kpatch sysfs tree
such that module/object information is available. With the new layout, each
patched object has its own directory, with each function being a
subdirectory of its object.

Implement this by embedding a kobject struct within the kpatch_module,
kpatch_func, and kpatch_object structs and supplying their ktypes and
kobject release methods.

Before:
/sys/kernel/kpatch
└── patches
    └── <patch_module>
        ├── checksum
        ├── enabled
        └── functions
            ├── <function>    # from <object1>
            │    ├── new_addr
            │    └── old_addr
            ├── <function>    # from <object2>
            │    ├── new_addr
            │    └── old_addr
            └─── <function>   # from <object3>
                 ├── new_addr
                 └── old_addr

After:
/sys/kernel/kpatch
└── <patch_module>
    ├── <object1>
    │   └── <function,sympos>
    │       ├── new_addr
    │       └── old_addr
    ├── <object2>
    │   └── <function,sympos>
    │       ├── new_addr
    │       └── old_addr
    ├── checksum
    ├── enabled
    └── <object3>
        └── <function,sympos>
            ├── new_addr
            └── old_addr
2017-02-27 20:07:16 -08:00
..
kpatch-macros.h remove obsolete warning for KPATCH_FORCE_UNSAFE 2014-10-31 11:39:14 -05:00
kpatch-patch-hook.c kmod: restructure kpatch sysfs tree 2017-02-27 20:07:16 -08:00
kpatch-patch.h livepatch-patch-hook: add support for livepatch sympos 2016-02-16 10:31:44 -06:00
kpatch.h build and install core module with make 2014-02-18 07:44:33 -06:00
kpatch.lds.S kpatch-build: build dynrelas or klp relas depending on kernel version 2017-01-23 12:43:43 -08:00
livepatch-patch-hook.c livepatch-patch-hook: ensure compatibility with kernels < 4.7 and >= 4.7 2017-01-23 12:43:39 -08:00
Makefile kpatch-build: build dynrelas or klp relas depending on kernel version 2017-01-23 12:43:43 -08:00
patch-hook.c CONFIG_LIVE_PATCHING -> CONFIG_LIVEPATCH 2015-02-04 08:32:08 -06:00