Home Home > GIT Browse
AgeCommit message (Collapse)Author
9 daysMerge branch 'bsc#1153108_12.4u0-8' into SLE12-SP4_Update_7SLE12-SP4_Update_7Nicolai Stange
9 daysMerge branch 'SLE12-SP4_Update_7_EMBARGO' into SLE12-SP4_Update_7Nicolai Stange
9 daysbsc#1153108: fill in commit idsNicolai Stange
At the time the live patch for CVE-2019-10220 ("Samba servers can inject relative paths in directory entry lists") was being prepared, the backport to kernel-source had not been available. Furthermore, follow-up commit b9959c7a347d ("filldir[64]: remove WARN_ON_ONCE() for bad directory entries") has been merged upstream in the meanwhile. Amend the file header comment by the resp. commit ids now. Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-10-22Bump up the version number in spec fileNicolai Stange
Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-10-22Merge branch 'bsc#1153108_12.4u0-8' into SLE12-SP4_Update_7_EMBARGONicolai Stange
2019-10-22Fix for CVE-2019-10220 ("Samba servers can inject relative paths in ↵Nicolai Stange
directory entry lists") Live patch for CVE-2019-10220. Upstream commit 8a23eb804ca4 ("Make filldir[64]() verify the directory entry filename is valid"). KLP: CVE-2019-10220 References: bsc#1153108 CVE-2019-10220 Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-10-22Merge branch 'bsc#1153161_12.4u0-8' into SLE12-SP4_Update_7Nicolai Stange
2019-10-17Fix for CVE-2019-17133 ("cfg80211_mgd_wext_giwessid in ↵Nicolai Stange
net/wireless/wext-sme.c does not reject a long SSID IE, leading to a Buffer Overflow") Live patch for CVE-2019-17133. Upstream commit 4ac2813cc867 ("cfg80211: wext: avoid copying malformed SSIDs"). KLP: CVE-2019-17133 References: bsc#1153161 CVE-2019-17133 Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-09-30Bump up the version number in spec fileNicolai Stange
Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-09-29Merge branch 'bsc#1151021_12.4u0-7' into SLE12-SP4_Update_7Nicolai Stange
2019-09-29Merge branch 'master-livepatch-sle12' into SLE12-SP4_Update_7Nicolai Stange
2019-09-26Fix for CVE-2019-14835 ("vhost/vhost_net kernel buffer overflow leads to ↵Nicolai Stange
guest to host kernel escape") Live patch for CVE-2019-14835. Upstream commit 060423bfdee3 ("vhost: make sure log_num < in_num"). KLP: CVE-2019-14835 References: bsc#1151021 CVE-2019-14835 Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-09-24Merge branch 'master-livepatch' into master-livepatch-sle12Miroslav Benes
2019-09-24uname_patch: convert to the syscall stub wrapper macros from klp_syscalls.hNicolai Stange
In order to make the live patch to the newuname() syscall work on kernels >= 4.17 again, convert it to the KLP_SYSCALL_*() wrapper macros provided by klp_syscalls.h. References: bsc#1149841 Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2019-09-24Provide wrapper macros for syscall namingNicolai Stange
Live patching syscall stubs is a common task, for example any live patch package modifies the newuname syscall. For the actual definitions of the live patched syscall stubs, the __SYSCALL_DEFINEx() name can always be (and often has been) used like e.g. __SYSCALL_DEFINEx(3, _klp_timer_create, const clockid_t, which_clock, struct sigevent __user *, timer_event_spec, timer_t __user *, created_timer_id) { /* New implementation */ } Up to kernel 4.16, this used to define a function named "SyS_klp_timer_create" which could then be used to live patch the "SyS_timer_create". However, beginning with kernel version 4.17, resp. upstream commits - fa697140f9a2 ("syscalls/x86: Use 'struct pt_regs' based syscall calling convention for 64-bit syscalls") - e145242ea0df ("syscalls/core, syscalls/x86: Clean up syscall stub naming convention") - d5a00528b58c ("syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()"), things became more complex: - The naming of the resulting stubs now varies across architecture. - Some architectures (x86_64, s390x) instantiate an additional compat stub for syscalls sharing a common implementation between 32 and 64 bits. (The 32 bit entry code used to convert from the 32 bit ABI to 64 bit and simply call the 64 bit syscall stub afterwards. That's handled by the new 32 bit stubs now.) - The stubs' signatures have changed: each argument used to get mapped to either long or long long, but on x86_64, the stubs are now receiving a single struct pt_regs only -- it's their responsibility to extract the arguments as appropriate. In order to not require each and every live patch touching syscalls to include an insane amount of ifdeffery, provide a set of #defines hiding it: 1.) KLP_SYSCALL_SYM(name) expands to the syscall stub name for 64 bits as defined by _SYSCALL_DEFINEx(x, _name, ...). 2.) If the architeture requires 32bit specific stubs for syscalls sharing a common implementation between 32 and 64bits, the KLP_ARCH_HAS_SYSCALL_COMPAT_STUBS macro is defined. 3.) If KLP_ARCH_HAS_SYSCALL_COMPAT_STUBS is defined, then KLP_SYSCALL_COMPAT_STUB_SYM(name) expands to the syscall stub name for 32 bits as defined by _SYSCALL_DEFINEx(x, _name, ...). 4.) For syscalls not sharing a common implementation between 32 and 64 bits, i.e. those defined by COMPAT_SYSCALL_DEFINEx(), the macro KLP_COMPAT_SYSCALL_SYM(name) expands to the stub name defined as defined by COMPAT_SYSCALL_DEFINEx(x, _name, ...). 5.) Finally, for hiding differences between the signatures, provide the macro KLP_SYSCALL_DECLx(x, sym, ...) which expands to a declaration of sym, with the x arguments either mapped to long resp. long long each, or collapsed to a single struct pt_regs argument as appropriate for the architecture. Note that these macros are defined as appropriate on kernels before and after 4.17, so that live patch code can be shared. References: bsc#1149841 Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2019-09-05scripts/create-makefile.sh: add -I flag for toplevel directory to ccflags-yNicolai Stange
Since upstream commit 58156ba4468f ("kbuild: skip 'addtree' and 'flags' magic for external module build") Kbuild won't add an -I flag for an external module's toplevel source directory to the compilation flags anymore. This results in compilation errors like the following: uname_patch/livepatch_uname.c:36:10: fatal error: klp_convert.h: No such file or directory #include "klp_convert.h" ^~~~~~~~~~~~~~~ Fix this by appending '-I$(obj)' to ccflags-y within the Makefile created by scripts/create-makefile.sh. Note that "$(obj)" is set to the current source directory before the Makefile is sourced by Kbuild. Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-08-05Update IBS_PROJECT to correct maintenance incident after initial submissionMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2019-07-25New branch for SLE12-SP4_Update_7Nicolai Stange
Signed-off-by: Nicolai Stange <nstange@suse.de>
2019-03-07Merge branch 'master-livepatch' into master-livepatch-sle12Miroslav Benes
2019-03-07livepatch_main.c: Adaptation to a new livepatch APIMiroslav Benes
The atomic replace patch set among others removed the two-stage API. There is no (un)registration step needed now. SLES backport defines KLP_NOREG_API macro to easily distinguish whether the kernel provides the old or the new API. Use it and change the module init and exit functions accordingly. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2019-02-13Merge branch 'master-livepatch' into master-livepatch-sle12Miroslav Benes
Conflicts: rpm/kgraft-patch.spec scripts/tar-up.sh
2019-02-13uname_patch: Use klp-convert macros and rely on klp-convert whereMiroslav Benes
possible Signed-off-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Nicolai Stange <nstange@suse.de>
2019-02-13Define macros to switch easily between klp-convert and kallsymsMiroslav Benes
Kallsyms trick does not have to be used for resolving undefined symbols when klp-convert is available. It would be great though to share live patches sources between both modes of operation. Define macros to help with the task. Their definitions depend on whether USE_KLP_CONVERT macro is defined. tar-up.sh script is responsible to decide. Signed-off-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Nicolai Stange <nstange@suse.de>
2019-02-13Use klp-convert where providedMiroslav Benes
klp-convert tool converts undefined symbols in a live patch kernel module to special relocation records which are resolved by the kernel. It allows to omit kallsyms tricks. Wire it to the spec file and let tar-up.sh script decide if it is to be used depending on a codestream. SLE15-SP1 is supported currently. Signed-off-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Nicolai Stange <nstange@suse.de>
2018-12-31Merge branch 'master-livepatch' into master-livepatch-sle12Miroslav Benes
2018-12-11Merge branch 'master' into master-livepatchMiroslav Benes
2018-12-11uname_patch: don't hold uts_sem while accessing userspace memoryHEADmasterMiroslav Benes
Backport upstream patch 42a0cc347858 ("sys: don't hold uts_sem while accessing userspace memory"). Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-08-09Merge branch 'master-livepatch' into master-livepatch-sle12Miroslav Benes
2018-08-09Provide common kallsyms wrapper APINicolai Stange
With bsc#1103203, the need for disambiguating between a multiply defined symbol arose. This is something the kallsyms_lookup_name() based code snippet we used to copy&paste to every individual CVE fix can't handle. Implement a proper wrapper API for doing the kallsyms lookups. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-07-19Rename .spec and .changes files from kernel-livepatch to kgraft-patchMiroslav Benes
Someone/something might get confused otherwise. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-07-11Merge branch 'master-livepatch' into master-livepatch-sle12Miroslav Benes
2018-07-11provide KLP_SHADOW_ID() helper macroNicolai Stange
In analogy to the KGR_SHADOW_ID() macro, introduce KLP_SHADOW_ID() for the construction of unique shadow variable id's. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-07-10Merge branch 'master-livepatch' into master-livepatch-sle12Miroslav Benes
2018-07-10scripts/register-patches.sh: implement conditional inclusionNicolai Stange
Currently, subpatches provide a patched_funcs.csv file describing what needs to be patched. register-patches.sh inspects those to assemble one global klp_patch structure. The current format for these patched_funcs.csv's is obj old_func(,sympos) newfun However, sometimes subpatches depend on some kernel configuration values like CONFIG_X86_64 and functions shall get patched only if the target kernel configuration matches. Extends the patched_funcs.csv format to obj old_func(,sympos) newfun (cpp condition) where everything coming after 'newfun' is taken to be a CPP condition to be used for conditional inclusion. In case there's no condition specified, assign that entry the same semantics as if a '1' had been given. Make register-patches.sh guard the corresponding klp_func entries with #if pragmas. Furthermore, let it guard the enclosing klp_object instances by or'ing together all its klp_funcs' conditions. For the sake of better readability, omit redundant #if pragmas as well as condition clauses. In particular, - if a function entry hasn't got any condition explicitly specified, there won't be any #if pragma, neither at the klp_func nor at the klp_object level, - if multiple function entries for an object are protected by the same condition, it'll be or'ed in at the klp_object level only once, - if all of an object's functions share the same condition, no #if pragmas will be emitted at the klp_func level because they would only duplicate what's already there for the enclosing object and - multiple subsequent function entries sharing the same condition get collated. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-07-10scripts/register-patches.sh: allow spaces as patched_funcs.csv separatorsNicolai Stange
Currently there's one single cut(1) usage which requires that (single) tabs are used as field separators for the patched_funcs.csv. As the rest of the code can deal with sequences of any whitespace already, this imposes an unnecessary restriction on the format. Substitute that cut(1) usage by a sed(1) invocation as appropriate. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-07-10rpm/config.sh: Change IBS_PROJECT to SLE12-SP4Miroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-07-10Partial livepatch to kGraft migrationMiroslav Benes
SLE12-SP4 is going to be based on upstream livepatch implementation. Same as SLE15. However we need to preserve at least kGraft outer appearance. Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-06-04livepatch_main.c: Set .replace to trueMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2018-05-14Merge branch 'master' into master-livepatchMiroslav Benes
2018-05-14scrips/create-makefile.sh: add support for assembly filesNicolai Stange
Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-08Revert "shadow variables: introduce upstream patch"Miroslav Benes
This reverts commit e899c4fd3fe7602ebd70f578d8475f1049de7c78.
2017-12-08Revert "shadow variables: drop EXPORT_SYMBOL()s"Miroslav Benes
This reverts commit ac6cfebd7f831213ebcd4b2690672871572ec49e.
2017-12-08Revert "shadow variables: share shadow data among KGraft modules"Miroslav Benes
This reverts commit 8e1e705d4d56981949f7ae3854d8e1cc2be7f40f.
2017-12-08Revert "shadow variables: add KGR_SHADOW_ID helper"Miroslav Benes
This reverts commit 237c8f3d13c382321d3e65d138d328eae0b82f6c.
2017-12-08livepatch_main.c: klp_patch_init(): fix error handlingNicolai Stange
In case either of the invocations of klp_register_patch() or klp_enable_patch() fails, anything which has been setup by the prior per-(sub-)patch initialiation code, i.e. the expansion of @@KLP_PATCHES_INIT_CALLS@@, won't get undone. Fix this. Also make klp_patch_init() look more like the common 'goto err' idiom and adjust scripts/register_patches.sh accordingly. Fix for commit 7e20201cdcb8 ("kGraft to livepatch migration. API change."). Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-08scripts/register_patches.sh: generate klp_object arrayNicolai Stange
The KLP API doesn't take a flat list of to be patched functions like KGraft did, but introduces an intermediate layer: struct klp_object. Each klp_patch instance is supposed to reference an array of klp_object's which in turn provide an array of klp_func's each. To facilitate merging, we want to generate this list of klp_object's automatically, exactly like we did for the flat function list with KGraft. For each klp_patch instance, there must be at most one klp_object entry referring to the same object. Hence care must be taken not to add an entry for the same object twice in case two different (sub-)patches both patch some functions therein. Require from each (sub-)patch to provide the list of to be patched symbols in a file named SUBPATCH/patched_funcs.csv with each line conforming to the obj old_func(,sympos) new_func pattern. Make scripts/register.sh generate an klp_object array initializer based on this and let it expand the @@KLP_PATCHES_OBJS@@ tag within livepatch_main.c accordingly. Do not replace the now obsolete @@KLP_PATCHES_FUNCS@@ anymore. Add and remove the @@KLP_PATCHES_OBJS@@ and @@KLP_PATCHES_FUNCS@@ markers to and from livepatch_main.c respectively. Signed-off-by: Nicolai Stange <nstange@suse.de> [ mb: amend copy&paste error ($newfun at the end of uname klp_func[]) ] Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-08rpm/config.sh: Use SUSE:SLE-15:GA projectMiroslav Benes
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2017-12-08Revert "scripts: Generate ExclusiveArch in spec file dynamically"Miroslav Benes
This reverts commit 95ed856ea8f99b4e48d7d324278b3628d2ac2fa2. SLE15 will support ppc64le arch from the beginning.
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>