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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141223030956.GA26839@wfg-t540p.sh.intel.com>
Date:	Mon, 22 Dec 2014 19:09:56 -0800
From:	Fengguang Wu <fengguang.wu@...el.com>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	Herbert Xu <herbert@...dor.apana.org.au>, LKP <lkp@...org>,
	linux-kernel@...r.kernel.org
Subject: [hwrng] WARNING: CPU: 0 PID: 1 at include/linux/kref.h:47
 set_current_rng()

Greetings,

0day kernel testing robot got the below dmesg and the first bad commit is

git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master

commit 3a2c0ba5ad00c018c0bef39a2224aca950aa33f2
Author:     Rusty Russell <rusty@...tcorp.com.au>
AuthorDate: Mon Dec 8 16:50:37 2014 +0800
Commit:     Herbert Xu <herbert@...dor.apana.org.au>
CommitDate: Mon Dec 22 23:02:39 2014 +1100

    hwrng: use reference counts on each struct hwrng.
    
    current_rng holds one reference, and we bump it every time we want
    to do a read from it.
    
    This means we only hold the rng_mutex to grab or drop a reference,
    so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn't
    block on read of /dev/hwrng.
    
    Using a kref is overkill (we're always under the rng_mutex), but
    a standard pattern.
    
    This also solves the problem that the hwrng_fillfn thread was
    accessing current_rng without a lock, which could change (eg. to NULL)
    underneath it.
    
    Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
    Signed-off-by: Amos Kong <akong@...hat.com>
    Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>

+----------------------------------------------------+------------+------------+------------+
|                                                    | 1dacb395d6 | 3a2c0ba5ad | 02e375a39e |
+----------------------------------------------------+------------+------------+------------+
| boot_successes                                     | 60         | 0          | 0          |
| boot_failures                                      | 0          | 20         | 12         |
| WARNING:at_include/linux/kref.h:#set_current_rng() | 0          | 20         | 12         |
| backtrace:hwrng_register                           | 0          | 20         | 12         |
| backtrace:rng_init                                 | 0          | 20         | 12         |
| backtrace:kernel_init_freeable                     | 0          | 20         | 12         |
| Out_of_memory:Kill_process                         | 0          | 0          | 1          |
+----------------------------------------------------+------------+------------+------------+

[    0.408729] Initializing Nozomi driver 2.1d
[    0.410251] Non-volatile memory driver v1.3
[    0.411671] ------------[ cut here ]------------
[    0.413180] WARNING: CPU: 0 PID: 1 at include/linux/kref.h:47 set_current_rng+0x62/0x70()
[    0.416125] Modules linked in:
[    0.417407] CPU: 0 PID: 1 Comm: swapper Not tainted 3.19.0-rc1-g3a2c0ba #38
[    0.419428] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[    0.421136]  ffffffff81a21a30 ffff880013857de8 ffffffff816f758d ffff880013857e28
[    0.424127]  ffffffff8107ce9a ffff880013857e38 ffffffff81c661c0 ffff880011caae10
[    0.426581]  ffffffff81c661c0 ffffffff81d129f1 0000000000000000 ffff880013857e38
[    0.429174] Call Trace:
[    0.430154]  [<ffffffff816f758d>] dump_stack+0x19/0x1b
[    0.431748]  [<ffffffff8107ce9a>] warn_slowpath_common+0x7a/0xb0
[    0.433367]  [<ffffffff81d129f1>] ? mod_init+0x12b/0x12b
[    0.434353]  [<ffffffff8107cf75>] warn_slowpath_null+0x15/0x20
[    0.435558]  [<ffffffff8136f772>] set_current_rng+0x62/0x70
[    0.436957]  [<ffffffff81370057>] hwrng_register+0x1c7/0x290
[    0.437944]  [<ffffffff81d12a01>] rng_init+0x10/0x12
[    0.439449]  [<ffffffff810002a4>] do_one_initcall+0x84/0x1c0
[    0.440413]  [<ffffffff81cec07a>] kernel_init_freeable+0xfd/0x185
[    0.441653]  [<ffffffff816f0840>] ? rest_init+0x80/0x80
[    0.442925]  [<ffffffff816f0849>] kernel_init+0x9/0xf0
[    0.444286]  [<ffffffff816fea7a>] ret_from_fork+0x7a/0xb0
[    0.445536]  [<ffffffff816f0840>] ? rest_init+0x80/0x80
[    0.446958] ---[ end trace 34fb80111662e761 ]---
[    0.447923] Linux agpgart interface v0.103

git bisect start 02e375a39e183e3f08e12de435a1970b78c4174c 97bf6af1f928216fd6c5a66e8a57bfa95a659672 --
git bisect good 8a29ac1839a7d7d6f680617f870045ce58be3712  # 06:41     20+      0  Merge 'asoc/topic/omap' into devel-lkp-nhm1-smoke-201412230619
git bisect good 5d49b0ab0d9968efbf70afe11f9fffe7d86e21d1  # 06:49     20+      0  Merge 'perf/perf/core' into devel-lkp-nhm1-smoke-201412230619
git bisect good 04b5f77135fd1646b65d9e73733e61859cf72add  # 06:56     20+      0  Merge 'ard.biesheuvel/efi-for-3.20' into devel-lkp-nhm1-smoke-201412230619
git bisect  bad c50aef250e8f1ff63132fd1d1a919b6774ff8635  # 06:59      0-      1  Merge 'asoc/topic/wm8750' into devel-lkp-nhm1-smoke-201412230619
git bisect good 8505c1fd22b13ebe27a4f76ab0db8dba9b10260a  # 07:07     20+      0  Merge 'hid/for-next' into devel-lkp-nhm1-smoke-201412230619
git bisect  bad f1954fab801041ec34f97557b8482bb3f2ea2a8d  # 07:15      0-     13  Merge 'cryptodev/master' into devel-lkp-nhm1-smoke-201412230619
git bisect good 9372b35e11149c5314f56f939775e67d83057604  # 07:23     20+      0  hwrng: place mutex around read functions and buffers.
git bisect  bad 2d2ec0642a85966b6a299bbcd94707982327ace8  # 07:26      0-     20  hwrng: don't init list element we're about to add to list.
git bisect  bad 3a2c0ba5ad00c018c0bef39a2224aca950aa33f2  # 07:31      0-     20  hwrng: use reference counts on each struct hwrng.
git bisect good 1dacb395d68a14825ee48c0843335e3181aea675  # 07:38     20+      0  hwrng: move some code out mutex_lock for avoiding underlying deadlock
# first bad commit: [3a2c0ba5ad00c018c0bef39a2224aca950aa33f2] hwrng: use reference counts on each struct hwrng.
git bisect good 1dacb395d68a14825ee48c0843335e3181aea675  # 07:40     60+      0  hwrng: move some code out mutex_lock for avoiding underlying deadlock
# extra tests on HEAD of linux-devel/devel-lkp-nhm1-smoke-201412230619
git bisect  bad 02e375a39e183e3f08e12de435a1970b78c4174c  # 07:40      0-     12  0day head guard for 'devel-lkp-nhm1-smoke-201412230619'
# extra tests on tree/branch cryptodev/master
git bisect  bad d3f6c142865badc82fa4d151766634b895d693e8  # 07:44      0-     22  crypto: ux500 - fix checkpatch errors
# extra tests on tree/branch linus/master
git bisect good 97bf6af1f928216fd6c5a66e8a57bfa95a659672  # 07:46     60+      1  Linux 3.19-rc1
# extra tests on tree/branch next/master
git bisect good f9f7b9d7aeedb0f6150bc9df08542c3a0b67a4ef  # 07:54     60+      0  Add linux-next specific files for 20141221


This script may reproduce the error.

----------------------------------------------------------------------------
#!/bin/bash

kernel=$1
initrd=yocto-minimal-x86_64.cgz

wget --no-clobber https://github.com/fengguang/reproduce-kernel-bug/raw/master/initrd/$initrd

kvm=(
	qemu-system-x86_64
	-enable-kvm
	-cpu Haswell,+smep,+smap
	-kernel $kernel
	-initrd $initrd
	-m 320
	-smp 1
	-net nic,vlan=1,model=e1000
	-net user,vlan=1
	-boot order=nc
	-no-reboot
	-watchdog i6300esb
	-rtc base=localtime
	-serial stdio
	-display none
	-monitor null 
)

append=(
	hung_task_panic=1
	earlyprintk=ttyS0,115200
	debug
	apic=debug
	sysrq_always_enabled
	rcupdate.rcu_cpu_stall_timeout=100
	panic=-1
	softlockup_panic=1
	nmi_watchdog=panic
	oops=panic
	load_ramdisk=2
	prompt_ramdisk=0
	console=ttyS0,115200
	console=tty0
	vga=normal
	root=/dev/ram0
	rw
	drbd.minor_count=8
)

"${kvm[@]}" --append "${append[*]}"
----------------------------------------------------------------------------

Thanks,
Fengguang

View attachment "dmesg-yocto-kbuild-32:20141223072944:x86_64-randconfig-n0-12230617:3.19.0-rc1-g3a2c0ba:38" of type "text/plain" (49170 bytes)

_______________________________________________
LKP mailing list
LKP@...ux.intel.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ