Home Home > GIT Browse
AgeCommit message (Collapse)Author
2017-12-08kGraft to livepatch migration. External rename.Libor Pechacek
External rename and thus final step of kGraft -> upstream livepatch migration. kgraft-patch* modules are now livepatch* and live in /lib/modules/$(uname -r)/livepatch. References: fate#323682 Signed-off-by: Libor Pechacek <lpechacek@suse.com> [ mb: changelog ] Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-08kGraft to livepatch migration. API change.Libor Pechacek
Change from kGraft API to livepatch API. Note: error handling in _init() function is broken and fixed later. Automatic generation of klp_objects is not present at all. Added later. References: fate#323682 Signed-off-by: Libor Pechacek <lpechacek@suse.com> [ mb: changelog, patch split, whitespace errors ] Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-08kGraft to livepatch migration. Internal rename.Libor Pechacek
Internal rename in preparation for kGraft -> upstream livepatch migration. External module naming stays the same. API is not touched yet. References: fate#323682 Signed-off-by: Libor Pechacek <lpechacek@suse.com> [ mb: changelog edit ] Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-05uname_patch: fix UNAME26 for 4.0Miroslav Benes
Backport upstream commit 39afb5ee4640 ("kernel/sys.c: fix UNAME26 for 4.0"). Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-04Revert "Add compat.h to deal with changes of KGR_PATCH macro"Miroslav Benes
This reverts commit 4186bef35862029a2fd36ba4a73d5fa538992709. All currently supported kernels (that is, everything since SLE12_Update_14 and SLE12-SP1_Update_5) have sympos support. We can drop compat, because we don't need it anymore. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-11-30scripts: Generate ExclusiveArch in spec file dynamicallyMiroslav Benes
ppc64le architecture kernel support is not present in all currently supported branches. It may cause problem for the maintenance team. Generate ExclusiveArch dynamically. It should be 'ppc64le x86_64' for SLE12-SP3 and 'x86_64' for the rest. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-11-23shadow variables: add KGR_SHADOW_ID helperNicolai Stange
As shadow variables are supposed to be shared among different KGraft modules their id's must be compile time constants. Introduce the KGR_SHADOW_ID helper macro for generating them in a uniform manner based on the bsc# number and a local id. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-11-23shadow variables: share shadow data among KGraft modulesNicolai Stange
As it stands, each KGraft module maintains its own set of shadow variable management structures and thus, shadow variables are not sharable between livepatch modules. This behaviour is different from the upstream implementation and, as pointed out by Miroslav Benes, it also opens up an opportunity for a small window where the system might become vulnerable again during transition as we stack new livepatches on top. Let all KGraft patches share the shadow data. Sharing is implemented by moving the management structures from a KGraft module's .data to dynamically allocated memory. Each KGraft module will have specifically named pointers, 'kgr_shadow_hash12' and 'kgr_shadow_lock12', referencing them. Upon initialization, a KGraft module will discover already existing such shadow data by kallsyms-searching all loaded modules for these pointer symbols. If none is found, a new instance is allocated. The newly introduced kgr_shadow_init() implementing this is idempotent and can thus be called from the bsc# subpatches' initializers if needed. Upon KGraft module removal, the new kgr_shadow_cleanup() will conduct another kallsyms search and deallocate the shadow data in case there are no more users. kgr_shadow_cleanup() is also idempotent. Initialization and teardown of the common shadow data is serialized with the module_mutex which has to be taken for the kallsyms search anyway. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-11-23shadow variables: drop EXPORT_SYMBOL()sNicolai Stange
The shadow variable API will only ever get used by the KGraft module itself and thus, there's no need for exporting it. Drop all EXPORT_SYMBOL annotations. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-11-23shadow variables: introduce upstream patchNicolai Stange
Joe Lawrence posted the sixth version of his shadow variable patch [1] implementing the association of additional out-of-band data members to existing structure instances from livepatches. Jiri Kosina has applied this to his git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching.git for-4.15/shadow-variables tree and thus, it's queued up and close to getting merged. The plan is to eventually backport this shadow variable support to SLE kernels, but we also want to have it usable from KGraft modules by now. Port the implementation to the kraft-patches module. Namely, - dump shadow.c in it's current upstream state as it is after commits 439e7271dc2b ("livepatch: introduce shadow variable API") 5d9da759f758 ("livepatch: __klp_shadow_get_or_alloc() is local to shadow.c") 19205da6a0da ("livepatch: Small shadow variable documentation fixes") - add a shadow.h header and declare the newly introduced functions there - and incorporate the new files into the KGraft module's build system. [1] 1504211861-19899-2-git-send-email-joe.lawrence@redhat.com ("[PATCH v6] livepatch: introduce shadow variable API") Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-11-16rpm/kgraft-patch.spec: Add ppc64le as a supported archMiroslav Benes
ppc64le is about to be supported in Live Patching product. Add it to ExclusiveArch tag. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-11-16rpm/kgraft-patch.spec: Remove s390x from supported archsMiroslav Benes
s390x is not supported in Live Patching product. Remove it from ExclusiveArch. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-06-14scripts/register-patches.sh: register subpatch sources in rpm specNicolai Stange
In order to reduce the manual merging work upon addition of new (sub)patches, commit 4e8dc885be22 ("scripts: create kgr_patch_main.c dynamically") introduced the register-patches.sh helper. It discovers those and tweaks the main entry point, kgr_patch_main.c, as needed. However, a remaining manual merging task is to list a (sub)patch's source archive in rpm/kgraft-patch.spec and to %setup it. Make scripts/register-patches.sh do this. Namely, - introduce the @@KGR_PATCHES_SOURCES@@ and @@KGR_PATCHES_SETUP_SOURCES@@ placeholders in rpm/kgraft-patch.spec - and make scripts/register-patches.sh expand those within a spec file to be given as an additional command line argument. Finally, adjust scripts/tar-up.sh accordingly. Signed-off-by: Nicolai Stange <nstange@suse.de>
2017-06-14scripts/register-patches.sh: don't add ','s to @@KGR_PATCHES_FUNCS@@Nicolai Stange
register-patches.sh expands kgr_patch_main.c's @@KGR_PATCHES_FUNCS@@ placeholder by concatenating all available patches' KGR_PATCH_<XY>_FUNCS together, separating them by commas. The KGR_PATCH_<XY>_FUNCS are CPP macros supposed to be provided by each patch. If one of these happens to be empty, the preprocessed expansion will contain two consecutive commas which gcc doesn't like in array initializers. Do not add any commas to the @@KGR_PATCHES_FUNCS@@ expansion but require the individual KGR_PATCH_<XY>_FUNCS macros to already contain trailing ones as needed. Fixes: 4e8dc885be22 ("scripts: create kgr_patch_main.c dynamically") Signed-off-by: Nicolai Stange <nstange@suse.de>
2017-06-08scripts: create kgr_patch_main.c dynamicallyNicolai Stange
The kgraft-patches repository has got many branches, each corresponding to a supported codestream. Each of those carries a potentially different set of live (sub)patches which are controlled through the entry points in kgr_patch_main.c. According to Miroslav, merging of a new (sub)patch based on the pristine master is a pita due to conflicts. Since all (sub)patches stick to certain conventions already, the required modifications of the merging-hotspot kgr_patch_main.c are quite mechanic. Let a script do the work. Namely, - insert some special @@-embraced placeholders at the few places depending on the actual set of (sub)patches, - let register-patches.sh discover the available (sub)patches by searching for directories - and let register-patches.sh replace those placeholders in kgr_patch_main.c Finally, add a register-patches.sh invocation to tar-up.sh. This procedure requires that a SUBPATCH located in directory SUBPATCH/ adheres to the following conventions: - It must provide a provide a SUBPATCH/kgr_patch_SUBPATCH.h header. - This header must provide declarations for kgr_patch_SUBPATCH_init() and kgr_patch_SUBPATCH_cleanup(). - This header must also #define a KGR_PATCH_SUBPATCH_FUNCS macro. It should expand to a comma separated list of KGR_PATCH*() entries, each corresponding to a function the subpatch wants to replace. Signed-off-by: Nicolai Stange <nstange@suse.de> [mbenes: fixed typos, empty line removed] Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-04-24Replace $(PWD) with $(CURDIR) in MakefileMiroslav Benes
CURDIR is an internal variable of make and more suitable. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-04-19Create Makefile automaticallyMiroslav Benes
Introduce scripts/create-makefile.sh script to automatically create a makefile. The scripts is called from tar-up.sh or could be called manually. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2016-10-24Better to use SUSE:SLE-12:Update than Devel:kGraft:SLE12 projectMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2016-05-10Add compat.h to deal with changes of KGR_PATCH macroMiroslav Benes
Sympos patch set for kGraft redefined KGR_PATCH macro and added two new ones. Add new compat.h which contains macro magic so that all kGraft patches would work on both old and new kernels with the patch set merged. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2016-05-06Fix the number of parameters of KGR_PATCH macroMiroslav Benes
New kernels contain kGraft's sympos patch set which changed number of paramaters of KGR_PATCH macro and introduced new macros. Fix it in master so it will be ok for new branches. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-09-01Include the RPM version number in the module nameMichal Marek
Signed-off-by: Michal Marek <mmarek@suse.com> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-08-26Remove forgotten debug option in the MakefileMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-08-18Add license and copyright noticesMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-07-15Remove immediate flagMiroslav Benes
Fake signal was merged to kGraft and immediate feature removed. Remove it in kGraft patches from now on too. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-05-20Set immediate flag to falseMiroslav Benes
Using immediate set to true can lead to BUGs and oopses when downgrading, reverting or applying replace_all patches. There is no way how to find out if there is a process in the old code which is being removed. The module would be put, removed and the process will crash. The consistency model guarantees that there is no one in the old code when the finalization ends. Thus use it for all case to be safe. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-05-12Fix description in rpm spec fileMiroslav Benes
Spec file description mentions initial kGraft patch which is only true for real initial patch. Make it more neutral. References: bsc#930408 Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-04-01Generate archives names automatically in tar-up.shMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-04-01Automatically generate .changes file from git logMiroslav Benes
Also add comments to tar-up.sh script to distinguish between sections. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2015-03-26Revert "Require exact kernel version in the patch"Michal Marek
This needs to be done differently, so that modprobe --force works as expected. References: bnc#920615 This reverts commit c62c11aecd4e3f8822e1b835fea403acc3148c5a.
2015-03-25Require exact kernel version in the patchMichal Marek
References: bnc#920615 Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-03-24Add the git commit and branch to the package descriptionMichal Marek
References: bnc#920633 Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-11-26Set immediate flag for the initial patchMiroslav Benes
Setting immediate to true will simplify installation of the initial patch and possibly also of the further updates. References: bnc#907150 Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2014-11-25Add .replace_all set to trueMiroslav Benes
Add .replace_all flag set to true even to the initial patch. Thus we will not forget to add that later. Also .immediate is there as a comment. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2014-11-24Drop the hardcoded kernel release stringMichal Marek
The updated kgraft-devel macros set this during build time, so we do not need to know the kernel release string beforehand. As a name suffix for the source packages, let's use SLE12_Test in the master branch and SLE12_Update_<n> in the update branches. Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-11-21Check that we are building against the set kernel versionMichal Marek
2014-11-12Mark the module as supportedMichal Marek
References: bnc#904970 Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-11-11Build the test packages against Devel:kGraft:SLE12Michal Marek
2014-11-06Add top git commit hash to uname -vMiroslav Benes
Add top git commit hash to version part of uname. This makes the identification of current patch level easy (even in crash: p kgr_tag). References: fate#317769 Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2014-11-04Replace @@RELEASE@@ in kgr_patch->name with @@RPMRELEASE@@Miroslav Benes
We need to replace @@RELEASE@@ in kgr_patch->name with @@RPMRELEASE@@ due to sysfs tree. @@RELEASE@@ changes with each new version of package. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2014-11-03Add a source-timestamp file with the git commit hash and branchMichal Marek
This is required by the bs-upload-kernel script to upload packages to the BS. It can also be used by the specfile in the future. Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-11-03Add config.sh scriptMichal Marek
This tells the automatic builder which IBS project to use.
2014-11-03Initial commitMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>