Hello community, here is the log from the commit of package crash for openSUSE:Factory checked in at 2020-09-06 00:02:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crash (Old) and /work/SRC/openSUSE:Factory/.crash.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "crash" Sun Sep 6 00:02:40 2020 rev:164 rq:832084 version:7.2.8 Changes: -------- --- /work/SRC/openSUSE:Factory/crash/crash.changes 2020-05-12 22:37:22.896501639 +0200 +++ /work/SRC/openSUSE:Factory/.crash.new.3399/crash.changes 2020-09-06 00:02:58.259270923 +0200 @@ -1,0 +2,17 @@ +Fri Sep 4 10:53:39 UTC 2020 - Petr Tesařík <[email protected]> + +- Add eppic-remove-duplicate-symbols.patch + Fix eppic extension build. + +------------------------------------------------------------------- +Fri Sep 4 10:27:51 UTC 2020 - Petr Tesařík <[email protected]> + +- Add crash-fix-memory_driver-build-kernel-5.8.patch + Fix memory driver build failure with kernels 5.8+. + +------------------------------------------------------------------- +Thu Sep 3 13:18:53 UTC 2020 - Petr Tesařík <[email protected]> + +- Always build crash KMPs. + +------------------------------------------------------------------- New: ---- crash-fix-memory_driver-build-kernel-5.8.patch eppic-remove-duplicate-symbols.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crash.spec ++++++ --- /var/tmp/diff_new_pack.ZDqh8Z/_old 2020-09-06 00:03:00.391271991 +0200 +++ /var/tmp/diff_new_pack.ZDqh8Z/_new 2020-09-06 00:03:00.395271994 +0200 @@ -42,16 +42,6 @@ %else %define build_gcore 0 %endif -%ifnarch %ix86 s390 -%define build_kmp 1 -%if ! 0%{?is_opensuse} -%ifarch x86_64 -%if 0%{?sle_version} >= 150100 -%define buildrt 1 -%endif -%endif -%endif -%endif URL: http://people.redhat.com/anderson/ Summary: Crash utility for live systems; netdump, diskdump, LKCD or mcore dumpfiles License: GPL-3.0-or-later AND GFDL-1.2-only @@ -89,6 +79,8 @@ Patch25: %{name}-Fix-for-reading-compressed-kdump-dumpfiles-from-syst.patch Patch26: %{name}-fix-kmem-sS-for-caches-created-during-SLUB-bootstrap.patch Patch27: %{name}-Define-fallback-PN_XNUM.patch +Patch28: %{name}-fix-memory_driver-build-kernel-5.8.patch +Patch29: eppic-remove-duplicate-symbols.patch Patch90: %{name}-sial-ps-2.6.29.diff BuildRequires: bison BuildRequires: flex @@ -105,24 +97,20 @@ # Source code says it can do ppc32. Excluded here? ExcludeArch: ppc # crash driver KMP -%if 0%{?build_kmp} BuildRequires: kernel-syms -BuildRequires: module-init-tools -%if 0%{?buildrt} - %if ! 0%{?build_crash_on_obs} +%ifarch x86_64 +%if 0%{?suse_version} >= 1520 && 0%{?suse_version} < 1550 BuildRequires: kernel-syms-rt %endif %endif %if 0%{?suse_version} >= 1130 BuildRequires: kernel-devel %endif -%endif +BuildRequires: module-init-tools -%if 0%{?build_kmp} %suse_kernel_module_package -n crash -p %_sourcedir/%{name}-kmp-preamble um %define arch %_target_cpu %define kmp_pkg KMP -%endif %description The core analysis suite is a self-contained tool that can be used to @@ -241,8 +229,6 @@ %endif -%if 0%{?build_kmp} - %package %kmp_pkg Summary: Memory driver for the crash utility License: GPL-2.0-only @@ -257,8 +243,6 @@ -------- David Anderson <[email protected]> -%endif - # Compatibility cruft # there is no %%license prior to SLE12 %if %{undefined _defaultlicensedir} @@ -292,6 +276,7 @@ %patch25 -p1 %patch26 -p1 %patch27 -p1 +%patch28 -p1 %if %{have_snappy} %patch15 -p1 %endif @@ -311,11 +296,10 @@ cd - %patch12 -p1 %patch16 -p1 +%patch29 -p1 cp %{S:3} . mkdir kbuild -%if ! 0%{?is_opensuse} cp %{S:6} memory_driver -%endif %build %ifarch ppc64le @@ -327,7 +311,6 @@ export GDB="gdb-%{gdb_version}" make RPMPKG="`cat .rh_rpm_package`" %{?jobs:-j%jobs} make extensions %{?jobs:-j%jobs} -%if 0%{?build_kmp} export EXTRA_CFLAGS='-DVERSION=\"%version\"' for flavor in %flavors_to_build; do rm -rf kbuild/$flavor @@ -335,7 +318,6 @@ make -C /usr/src/linux-obj/%arch/$flavor modules \ M=$PWD/kbuild/$flavor done -%endif %install mkdir -p %{buildroot}%{_bindir} @@ -365,7 +347,6 @@ install -m 0644 sial-scripts-%{scripts_version}/*.c \ $RPM_BUILD_ROOT/%{_datadir}/sial/crash %endif -%if 0%{?build_kmp} # memory driver module export INSTALL_MOD_PATH=$RPM_BUILD_ROOT export INSTALL_MOD_DIR=updates @@ -373,7 +354,6 @@ make -C /usr/src/linux-obj/%arch/$flavor modules_install \ M=$PWD/kbuild/$flavor done -%endif %clean rm -rf %{buildroot} ++++++ crash-fix-memory_driver-build-kernel-5.8.patch ++++++ From: Petr Tesarik <[email protected]> Subject: Fix memory driver module build with kernel 5.8+ Upstream: submitted 2020-09-04 Kernel commit fe557319aa06c23cffc9346000f119547e0f289a renamed probe_kernel_{read,write} to copy_{from,to}_kernel_nofault. I'm also adding inline function wrapper to allow building the module with older kernel versions. Additionally, commit 0493cb086353e786be56010780a0b7025b5db34c unexported probe_kernel_write(), so writing kernel memory is no longer possible from a module. Without this patch, build with kernel 5.8 and later fails: kbuild/default/crash.c: In function 'crash_write': kbuild/default/crash.c:189:12: error: implicit declaration of function 'probe_kernel_write'; did you mean 'kernel_write'? [-Werror=implicit-function-declaration] 189 | if (probe_kernel_write(vaddr, buffer, count)) { | ^~~~~~~~~~~~~~~~~~ | kernel_write kbuild/default/crash.c: In function 'crash_read': kbuild/default/crash.c:225:13: error: implicit declaration of function 'probe_kernel_read'; did you mean 'kernel_read'? [-Werror=implicit-function-declaration] 225 | if (probe_kernel_read(buffer, vaddr, count)) { | ^~~~~~~~~~~~~~~~~ | kernel_read Signed-off-by: Petr Tesarik <[email protected]> --- memory_driver/crash.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) --- a/memory_driver/crash.c +++ b/memory_driver/crash.c @@ -25,6 +25,7 @@ *****************************************************************************/ #include <linux/module.h> +#include <linux/version.h> #include <linux/types.h> #include <linux/miscdevice.h> #include <linux/init.h> @@ -37,6 +38,22 @@ extern int page_is_ram(unsigned long); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) + +#define CAN_WRITE_KERNEL 1 + +static inline long copy_from_kernel_nofault(void *dst, const void *src, size_t size) +{ + return probe_kernel_read(dst, src, size); +} + +static inline long copy_to_kernel_nofault(void *dst, const void *src, size_t size) +{ + return probe_kernel_write(dst, src, size); +} + +#endif + #ifdef CONFIG_S390 /* * For swapped prefix pages get bounce buffer using xlate_dev_mem_ptr() @@ -160,6 +177,8 @@ crash_llseek(struct file * file, loff_t } } +#ifdef CAN_WRITE_KERNEL + static ssize_t crash_write(struct file *file, const char *buf, size_t count, loff_t *poff) { @@ -186,7 +205,7 @@ crash_write(struct file *file, const cha return -EFAULT; } - if (probe_kernel_write(vaddr, buffer, count)) { + if (copy_to_kernel_nofault(vaddr, buffer, count)) { unmap_virtual(page); return -EFAULT; } @@ -197,6 +216,8 @@ crash_write(struct file *file, const cha return written; } +#endif + /* * Determine the page address for an address offset value, * get a virtual address for it, and copy it out. @@ -222,7 +243,7 @@ crash_read(struct file *file, char *buf, * Use bounce buffer to bypass the CONFIG_HARDENED_USERCOPY * kernel text restriction. */ - if (probe_kernel_read(buffer, vaddr, count)) { + if (copy_from_kernel_nofault(buffer, vaddr, count)) { unmap_virtual(page); return -EFAULT; } @@ -294,7 +315,9 @@ static struct file_operations crash_fops .owner = THIS_MODULE, .llseek = crash_llseek, .read = crash_read, +#ifdef CAN_WRITE_KERNEL .write = crash_write, +#endif .unlocked_ioctl = crash_ioctl, .open = crash_open, .release = crash_release, ++++++ eppic-remove-duplicate-symbols.patch ++++++ From: Petr Tesarik <[email protected]> Subject: Fix eppic extension build with recent binutils Upstream: submitted 2020-09-04 The eppic extension defines eppicdebug and eppicppdebug, but these symbols are already defined in libeppic. Without this patch, the build fails like this: /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/10/../../../../lib64/libeppic.a(eppicpp.tab.o):(.bss+0x14): multiple definition of `eppicppdebug'; /tmp/ccy1G30m.o:(.bss+0x4): first defined here /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/10/../../../../lib64/libeppic.a(eppic.tab.o):(.bss+0x14): multiple definition of `eppicdebug'; /tmp/ccy1G30m.o:(.bss+0x0): first defined here Signed-off-by: Petr Tesarik <[email protected]> --- extensions/eppic/applications/crash/eppic.c | 3 --- 1 file changed, 3 deletions(-) --- a/extensions/eppic/applications/crash/eppic.c +++ b/extensions/eppic/applications/crash/eppic.c @@ -788,9 +788,6 @@ char *edit_help[]={ }; -// these control debug mode when parsing (pre-processor and compile) -int eppicdebug, eppicppdebug; - void load_cmd(void) {
