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:   Sat, 6 Jun 2020 23:48:50 +0800
From:   kernel test robot <rong.a.chen@...el.com>
To:     Eric Biggers <ebiggers@...gle.com>
Cc:     Herbert Xu <herbert@...dor.apana.org.au>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        LKML <linux-kernel@...r.kernel.org>, lkp@...ts.01.org
Subject: [crypto] beeb460cd1:
 WARNING:possible_circular_locking_dependency_detected

Greeting,

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

commit: beeb460cd12ac9b91640b484b6a52dcba9d9fc8f ("crypto: algapi - Avoid spurious modprobe on LOADED")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

in testcase: locktorture
with following parameters:

	runtime: 300s
	test: cpuhotplug

test-description: This torture test consists of creating a number of kernel threads which acquire the lock and hold it for specific amount of time, thus simulating different critical region behaviors.
test-url: https://www.kernel.org/doc/Documentation/locking/locktorture.txt


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

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


+-------------------------------------------------------+------------+------------+
|                                                       | 56b80bdee4 | beeb460cd1 |
+-------------------------------------------------------+------------+------------+
| boot_successes                                        | 12         | 2          |
| boot_failures                                         | 0          | 4          |
| WARNING:possible_circular_locking_dependency_detected | 0          | 4          |
| EIP:_raw_spin_unlock_irqrestore                       | 0          | 4          |
+-------------------------------------------------------+------------+------------+


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


[   12.050156] WARNING: possible circular locking dependency detected
[   12.051389] 5.7.0-rc1-00021-gbeeb460cd12ac #1 Not tainted
[   12.052500] ------------------------------------------------------
[   12.053760] lkp-setup-rootf/109 is trying to acquire lock:
[   12.054886] c01280bc (&port->lock#2){-...}-{2:2}, at: tty_port_tty_get+0x1e/0x80
[   12.056425] 
[   12.056425] but task is already holding lock:
[   12.057652] c2504850 (&port->lock){-...}-{2:2}, at: serial8250_handle_irq+0x13/0xe0
[   12.059304] 
[   12.059304] which lock already depends on the new lock.
[   12.059304] 
[   12.060955] 
[   12.060955] the existing dependency chain (in reverse order) is:
[   12.062450] 
[   12.062450] -> #2 (&port->lock){-...}-{2:2}:
[   12.063611]        __lock_acquire+0x4af/0xa50
[   12.064502]        lock_acquire+0x98/0x2d0
[   12.065326]        _raw_spin_lock_irqsave+0x41/0x60
[   12.066287]        serial8250_console_write+0x67/0x310
[   12.067708]        univ8250_console_write+0x1c/0x20
[   12.068686]        console_unlock+0x3ae/0x5b0
[   12.069552]        register_console+0x173/0x350
[   12.070558]        register_console+0x55/0x60
[   12.071427]        univ8250_console_init+0x1b/0x25
[   12.072436]        console_init+0x118/0x1ab
[   12.073324]        start_kernel+0x445/0x550
[   12.074036]        i386_start_kernel+0x42/0x44
[   12.074589]        startup_32_smp+0x15f/0x164
[   12.075129] 
[   12.075129] -> #1 (console_owner){....}-{0:0}:
[   12.075847]        __lock_acquire+0x4af/0xa50
[   12.076430]        lock_acquire+0x98/0x2d0
[   12.076937]        console_unlock+0x1e6/0x5b0
[   12.077476]        vprintk_emit+0x169/0x360
[   12.077999]        vprintk_default+0x2f/0x40
[   12.078524]        vprintk_func+0x35/0xb8
[   12.079021]        printk+0xe/0x10
[   12.079448]        __queue_work.cold+0xc/0x18
[   12.079992]        queue_work_on+0x79/0x80
[   12.080562]        tty_flip_buffer_push+0x22/0x30
[   12.081153]        pty_write+0xab/0xb0
[   12.081628]        n_tty_write+0xfb/0x430
[   12.082159]        tty_write+0x155/0x260
[   12.082651]        __vfs_write+0x22/0x1e0
[   12.083147]        vfs_write+0xc5/0x1b0
[   12.083631]        ksys_write+0x5c/0xd0
[   12.084107]        __ia32_sys_write+0x10/0x20
[   12.084668]        do_fast_syscall_32+0x82/0x2e0
[   12.085245]        entry_SYSENTER_32+0xad/0x100
[   12.085808] 
[   12.085808] -> #0 (&port->lock#2){-...}-{2:2}:
[   12.086525]        check_prev_add+0x71/0x9b0
[   12.087061]        validate_chain+0x6e9/0xf10
[   12.087610]        __lock_acquire+0x4af/0xa50
[   12.088159]        lock_acquire+0x98/0x2d0
[   12.088708]        _raw_spin_lock_irqsave+0x41/0x60
[   12.089513]        tty_port_tty_get+0x1e/0x80
[   12.090057]        tty_port_default_wakeup+0xb/0x30
[   12.090650]        tty_port_tty_wakeup+0x11/0x20
[   12.091214]        uart_write_wakeup+0x12/0x20
[   12.091757]        serial8250_tx_chars+0x10d/0x1d0
[   12.092400]        serial8250_handle_irq+0xd7/0xe0
[   12.093055]        serial8250_default_handle_irq+0x33/0x50
[   12.093723]        serial8250_interrupt+0x61/0x100
[   12.094308]        __handle_irq_event_percpu+0x4a/0x280
[   12.094942]        handle_irq_event_percpu+0x1d/0x60
[   12.095550]        handle_irq_event+0x32/0x53
[   12.096090]        handle_edge_irq+0x6d/0x170
[   12.096676]        handle_irq+0x8c/0xa0
[   12.097164]        do_IRQ+0x44/0xd0
[   12.097605]        common_interrupt+0x120/0x128
[   12.098174]        _raw_spin_unlock_irqrestore+0x47/0x50
[   12.098830]        uart_write+0x17d/0x270
[   12.099335]        n_tty_write+0xfb/0x430
[   12.099842]        tty_write+0x155/0x260
[   12.100486]        __vfs_write+0x22/0x1e0
[   12.101354]        vfs_write+0xc5/0x1b0
[   12.102152]        ksys_write+0x5c/0xd0
[   12.102868]        __ia32_sys_write+0x10/0x20
[   12.103775]        do_fast_syscall_32+0x82/0x2e0
[   12.104856]        entry_SYSENTER_32+0xad/0x100
[   12.105868] 
[   12.105868] other info that might help us debug this:
[   12.105868] 
[   12.107517] Chain exists of:
[   12.107517]   &port->lock#2 --> console_owner --> &port->lock
[   12.107517] 
[   12.109719]  Possible unsafe locking scenario:
[   12.109719] 
[   12.110997]        CPU0                    CPU1
[   12.111997]        ----                    ----
[   12.113002]   lock(&port->lock);
[   12.113716]                                lock(console_owner);
[   12.114999]                                lock(&port->lock);
[   12.116320]   lock(&port->lock#2);
[   12.117082] 
[   12.117082]  *** DEADLOCK ***
[   12.117082] 
[   12.118354] 6 locks held by lkp-setup-rootf/109:
[   12.119363]  #0: ef390454 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x2c/0x40
[   12.121138]  #1: ef3904a0 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock+0x18/0x50


To reproduce:

        # build kernel
	cd linux
	cp config-5.7.0-rc1-00021-gbeeb460cd12ac .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



Thanks,
Rong Chen


View attachment "config-5.7.0-rc1-00021-gbeeb460cd12ac" of type "text/plain" (123941 bytes)

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

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

View attachment "locktorture" of type "text/plain" (76 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ