lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 17 Feb 2022 22:58:32 +0800
From:   kernel test robot <oliver.sang@...el.com>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     lkp@...ts.01.org, lkp@...el.com,
        LKML <linux-kernel@...r.kernel.org>
Subject: [random]  118386b2ed: BUG:spinlock_bad_magic_on_CPU



Greeting,

FYI, we noticed the following commit (built with gcc-9):

commit: 118386b2ed0e47e303905ced2379bf2c98cde203 ("random: use simpler fast key erasure flow on per-cpu keys")
https://github.com/ammarfaizi2/linux-block crng/random/jd/slow-load

in testcase: boot

on test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 4G

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):


+--------------------------------------------------------------------+------------+------------+
|                                                                    | 086a701cf5 | 118386b2ed |
+--------------------------------------------------------------------+------------+------------+
| BUG:spinlock_bad_magic_on_CPU                                      | 0          | 10         |
+--------------------------------------------------------------------+------------+------------+


If you fix the issue, kindly add following tag
Reported-by: kernel test robot <oliver.sang@...el.com>


[    0.000000][    T0] BUG: spinlock bad magic on CPU#0, swapper/0
[ 0.000000][ T0] lock: base_crng+0x28/0x4c, .magic: 00000000, .owner: swapper/0, .owner_cpu: 0 
[    0.000000][    T0] CPU: 0 PID: 0 Comm: swapper Not tainted 5.17.0-rc3-00015-g118386b2ed0e #1
[    0.000000][    T0] Call Trace:
[ 0.000000][ T0] dump_stack_lvl (lib/dump_stack.c:107) 
[ 0.000000][ T0] dump_stack (lib/dump_stack.c:114) 
[ 0.000000][ T0] spin_dump.cold (kernel/locking/spinlock_debug.c:70 (discriminator 12)) 
[ 0.000000][ T0] do_raw_spin_unlock (kernel/locking/spinlock_debug.c:77 kernel/locking/spinlock_debug.c:99 kernel/locking/spinlock_debug.c:140) 
[ 0.000000][ T0] _raw_spin_unlock_irqrestore (include/linux/spinlock_api_smp.h:151 kernel/locking/spinlock.c:194) 
[ 0.000000][ T0] add_device_randomness (drivers/char/random.c:508 drivers/char/random.c:728) 
[ 0.000000][ T0] ? dmi_format_ids+0xfd/0xfd 
[ 0.000000][ T0] dmi_walk_early (drivers/firmware/dmi_scan.c:151) 
[ 0.000000][ T0] dmi_present (drivers/firmware/dmi_scan.c:605) 
[ 0.000000][ T0] dmi_setup (drivers/firmware/dmi_scan.c:730 drivers/firmware/dmi_scan.c:816) 
[ 0.000000][ T0] setup_arch (arch/x86/kernel/setup.c:673 arch/x86/kernel/setup.c:950) 
[ 0.000000][ T0] ? vprintk (kernel/printk/printk_safe.c:50) 
[ 0.000000][ T0] start_kernel (init/main.c:275 (discriminator 3) init/main.c:473 (discriminator 3) init/main.c:951 (discriminator 3)) 
[ 0.000000][ T0] ? set_intr_gate (arch/x86/kernel/idt.c:199) 
[ 0.000000][ T0] ? early_idt_handler_common (arch/x86/kernel/head_32.S:417) 
[ 0.000000][ T0] i386_start_kernel (arch/x86/kernel/head32.c:57) 
[ 0.000000][ T0] startup_32_smp (arch/x86/kernel/head_32.S:328) 
[    0.000000][    T0] SMBIOS 2.8 present.
[    0.000000][    T0] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[    0.000000][    T0] Hypervisor detected: KVM
[    0.000000][    T0] kvm-clock: Using msrs 4b564d01 and 4b564d00
[    0.000004][    T0] kvm-clock: using sched offset of 2724083838 cycles
[    0.000596][    T0] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[    0.002279][    T0] tsc: Detected 2394.374 MHz processor
[    0.003988][    T0] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.004698][    T0] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.005268][    T0] last_pfn = 0x140000 max_arch_pfn = 0x1000000
[    0.005882][    T0] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT
[    0.006627][    T0] Scan for SMP in [mem 0x00000000-0x000003ff]
[    0.007228][    T0] Scan for SMP in [mem 0x0009fc00-0x0009ffff]
[    0.007855][    T0] Scan for SMP in [mem 0x000f0000-0x000fffff]
[    0.012852][    T0] found SMP MP-table at [mem 0x000f5a80-0x000f5a8f]
[    0.013485][    T0]   mpc: f5a90-f5b74
[    0.013857][    T0] initial memory mapped: [mem 0x00000000-0x0e7fffff]
[    0.014556][    T0] RAMDISK: [mem 0x6067e000-0x7fffffff]
[    0.015061][    T0] Allocated new RAMDISK: [mem 0x16e7c000-0x367fdd2c]
[    0.320327][    T0] Move RAMDISK from [mem 0x6067e000-0x7ffffd2c] to [mem 0x16e7c000-0x367fdd2c]
[    0.321272][    T0] ACPI: Early table checksum verification disabled
[    0.321868][    T0] ACPI: RSDP 0x00000000000F5850 000014 (v00 BOCHS )
[    0.322492][    T0] ACPI: RSDT 0x00000000BFFE15C9 000030 (v01 BOCHS  BXPCRSDT 00000001 BXPC 00000001)
[    0.323390][    T0] ACPI: FACP 0x00000000BFFE149D 000074 (v01 BOCHS  BXPCFACP 00000001 BXPC 00000001)
[    0.324325][    T0] ACPI: DSDT 0x00000000BFFE0040 00145D (v01 BOCHS  BXPCDSDT 00000001 BXPC 00000001)
[    0.325236][    T0] ACPI: FACS 0x00000000BFFE0000 000040
[    0.325751][    T0] ACPI: APIC 0x00000000BFFE1511 000080 (v01 BOCHS  BXPCAPIC 00000001 BXPC 00000001)
[    0.326634][    T0] ACPI: HPET 0x00000000BFFE1591 000038 (v01 BOCHS  BXPCHPET 00000001 BXPC 00000001)
[    0.327525][    T0] ACPI: Reserving FACP table memory at [mem 0xbffe149d-0xbffe1510]
[    0.328280][    T0] ACPI: Reserving DSDT table memory at [mem 0xbffe0040-0xbffe149c]
[    0.328995][    T0] ACPI: Reserving FACS table memory at [mem 0xbffe0000-0xbffe003f]
[    0.329723][    T0] ACPI: Reserving APIC table memory at [mem 0xbffe1511-0xbffe1590]
[    0.330460][    T0] ACPI: Reserving HPET table memory at [mem 0xbffe1591-0xbffe15c8]
[    0.331193][    T0] mapped APIC to         ffffc000 (        fee00000)
[    0.331814][    T0] No NUMA configuration found
[    0.332270][    T0] Faking a node at [mem 0x0000000000000000-0x000000013fffffff]
[    0.332950][    T0] NODE_DATA(0) allocated [mem 0x16e7a000-0x16e7bfff]
[    0.333561][    T0] 4248MB HIGHMEM available.
[    0.334003][    T0] 871MB LOWMEM available.
[    0.334396][    T0] max_low_pfn = 367fe, highstart_pfn = 367fe
[    0.334946][    T0] Low memory ends at vaddr f67fe000
[    0.335433][    T0] High memory starts at vaddr f67fe000
[    0.335938][    T0]   mapped low ram: 0 - 367fe000
[    0.336415][    T0]   low ram: 0 - 367fe000
[    0.336896][    T0] Zone ranges:
[    0.337227][    T0]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.337816][    T0]   Normal   [mem 0x0000000001000000-0x00000000367fdfff]
[    0.338425][    T0]   HighMem  [mem 0x00000000367fe000-0x000000013fffffff]
[    0.339059][    T0] Movable zone start for each node
[    0.339527][    T0] Early memory node ranges
[    0.339933][    T0]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.340606][    T0]   node   0: [mem 0x0000000000100000-0x00000000bffdffff]
[    0.341280][    T0]   node   0: [mem 0x0000000100000000-0x000000013fffffff]
[    0.341949][    T0] Initmem setup node 0 [mem 0x0000000000001000-0x000000013fffffff]
[    0.343492][    T0] On node 0, zone DMA: 1 pages in unavailable ranges
[    0.343597][    T0] On node 0, zone DMA: 97 pages in unavailable ranges
[    0.384897][    T0] On node 0, zone HighMem: 32 pages in unavailable ranges
[    0.385506][    T0] Using APIC driver default
[    0.386700][    T0] ACPI: PM-Timer IO Port: 0x608
[    0.387103][    T0] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[    0.387717][    T0] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[    0.388446][    T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.389080][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 00, APIC ID 0, APIC INT 02
[    0.389802][    T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[    0.390472][    T0] Int: type 0, pol 1, trig 3, bus 00, IRQ 05, APIC ID 0, APIC INT 05
[    0.391248][    T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.392045][    T0] Int: type 0, pol 1, trig 3, bus 00, IRQ 09, APIC ID 0, APIC INT 09
[    0.392812][    T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[    0.393562][    T0] Int: type 0, pol 1, trig 3, bus 00, IRQ 0a, APIC ID 0, APIC INT 0a
[    0.394272][    T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[    0.394998][    T0] Int: type 0, pol 1, trig 3, bus 00, IRQ 0b, APIC ID 0, APIC INT 0b
[    0.395768][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 01, APIC ID 0, APIC INT 01
[    0.396566][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 03, APIC ID 0, APIC INT 03
[    0.397343][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 04, APIC ID 0, APIC INT 04
[    0.398137][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 06, APIC ID 0, APIC INT 06
[    0.398944][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 07, APIC ID 0, APIC INT 07
[    0.399762][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 08, APIC ID 0, APIC INT 08
[    0.400499][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 0c, APIC ID 0, APIC INT 0c
[    0.401179][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 0d, APIC ID 0, APIC INT 0d
[    0.401887][    T0] Int: type 0, pol 0, trig 0, bus 00, IRQ 0e, APIC ID 0, APIC INT 0e


To reproduce:

        # build kernel
	cd linux
	cp config-5.17.0-rc3-00015-g118386b2ed0e .config
	make HOSTCC=gcc-9 CC=gcc-9 ARCH=i386 olddefconfig prepare modules_prepare bzImage modules
	make HOSTCC=gcc-9 CC=gcc-9 ARCH=i386 INSTALL_MOD_PATH=<mod-install-dir> modules_install
	cd <mod-install-dir>
	find lib/ | cpio -o -H newc --quiet | gzip > modules.cgz


        git clone https://github.com/intel/lkp-tests.git
        cd lkp-tests
        bin/lkp qemu -k <bzImage> -m modules.cgz job-script # job-script is attached in this email

        # if come across any failure that blocks the test,
        # please remove ~/.lkp and /lkp dir to run from a clean state.



---
0DAY/LKP+ Test Infrastructure                   Open Source Technology Center
https://lists.01.org/hyperkitty/list/lkp@lists.01.org       Intel Corporation

Thanks,
Oliver Sang


View attachment "config-5.17.0-rc3-00015-g118386b2ed0e" of type "text/plain" (154031 bytes)

View attachment "job-script" of type "text/plain" (4694 bytes)

Download attachment "dmesg.xz" of type "application/x-xz" (13560 bytes)

Powered by blists - more mailing lists