Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_hash_find() PANIC #5233

Closed
behlendorf opened this issue Oct 5, 2016 · 5 comments
Closed

mod_hash_find() PANIC #5233

behlendorf opened this issue Oct 5, 2016 · 5 comments
Milestone

Comments

@behlendorf
Copy link
Contributor

Observed on a Linux 4.8 kernel with debugging enabled.

[ 2355.523406] spl: loading out-of-tree module taints kernel.
[ 2355.530790] SPL: Loaded module v0.7.0-rc1_6_g341dfdb (DEBUG mode)
[ 2355.534971] zavl: module license 'CDDL' taints kernel.
[ 2355.538357] Disabling lock debugging due to kernel taint
[ 2355.848771] VERIFY(RW_READ_HELD(&hash->mh_contents)) failed
[ 2355.852468] PANIC at modhash.c:817:mod_hash_find()
[ 2355.855626] Showing stack for process 6596
[ 2355.858287] CPU: 1 PID: 6596 Comm: modprobe Tainted: P           O    4.8.0-1.el7.elrepo.x86_64 #1
[ 2355.859277] Hardware name: Xen HVM domU, BIOS 4.2.amazon 05/12/2016
[ 2355.859277]  0000000000000286 00000000095cec7c ffff8801e0cef898 ffffffff81353baf
[ 2355.859277]  ffffffffa05a2e5d 0000000000000331 ffff8801e0cef8a8 ffffffffa0505084
[ 2355.859277]  ffff8801e0cefa30 ffffffffa050514f ffffffff81062d20 ffffffff00000028
[ 2355.859277] Call Trace:
[ 2355.859277]  [<ffffffff81353baf>] dump_stack+0x63/0x84
[ 2355.859277]  [<ffffffffa0505084>] spl_dumpstack+0x44/0x50 [spl]
[ 2355.859277]  [<ffffffffa050514f>] spl_panic+0xbf/0xf0 [spl]
[ 2355.859277]  [<ffffffff81062d20>] ? __ptep_modify_prot_commit+0x10/0x10
[ 2355.859277]  [<ffffffff81359ef4>] ? __radix_tree_lookup+0x84/0xf0
[ 2355.859277]  [<ffffffff81369d7e>] ? find_next_zero_bit+0x1e/0x20
[ 2355.859277]  [<ffffffff813552c5>] ? idr_get_empty_slot+0x165/0x3a0
[ 2355.859277]  [<ffffffff811f3f0c>] ? ___slab_alloc+0x1ec/0x4c0
[ 2355.859277]  [<ffffffff813558fe>] ? ida_get_new_above+0x21e/0x280
[ 2355.859277]  [<ffffffffa04fe0f4>] ? spl_kmem_alloc+0xf4/0x1a0 [spl]
[ 2355.859277]  [<ffffffffa0584a7e>] ? mod_hash_strkey_cmp+0xe/0x10 [icp]
[ 2355.859277]  [<ffffffffa05857ff>] mod_hash_find+0x6f/0xa0 [icp]
[ 2355.859277]  [<ffffffffa057b977>] kcf_mech_hash_find+0x37/0x90 [icp]
[ 2355.859277]  [<ffffffffa057bfbe>] kcf_add_mech_provider+0x5e/0x940 [icp]
[ 2355.859277]  [<ffffffff811f4d8a>] ? __kmalloc_node+0x1ea/0x260
[ 2355.859277]  [<ffffffffa04fe28b>] ? spl_kmem_zalloc+0xeb/0x190 [spl]
[ 2355.859277]  [<ffffffffa057d334>] init_prov_mechs+0x194/0x360 [icp]
[ 2355.859277]  [<ffffffffa05776e5>] ? kcf_alloc_provider_desc+0x395/0x3e0 [icp]
[ 2355.859277]  [<ffffffffa057df1f>] crypto_register_provider+0x4cf/0x920 [icp]
[ 2355.859277]  [<ffffffff8128f355>] ? proc_alloc_inum+0x55/0xe0
[ 2355.859277]  [<ffffffff8128f4e5>] ? proc_register+0xb5/0x110
[ 2355.859277]  [<ffffffff8128f73a>] ? proc_create_data+0x7a/0xd0
[ 2355.859277]  [<ffffffffa050710a>] ? __kstat_install+0xfa/0x2e0 [spl]
[ 2355.859277]  [<ffffffffa05b9000>] ? 0xffffffffa05b9000
[ 2355.859277]  [<ffffffffa058078e>] aes_mod_init+0x2e/0x50 [icp]
[ 2355.859277]  [<ffffffffa05b901d>] icp_init+0x1d/0x1000 [icp]
[ 2355.859277]  [<ffffffff81002190>] do_one_initcall+0x50/0x190
[ 2355.859277]  [<ffffffff811f44cb>] ? kmem_cache_alloc_trace+0x14b/0x1b0
[ 2355.859277]  [<ffffffff8118cacc>] do_init_module+0x60/0x1f1
[ 2355.859277]  [<ffffffff8110e9c1>] load_module+0x1f31/0x2700
[ 2355.859277]  [<ffffffff8110b8c0>] ? __symbol_put+0x60/0x60
[ 2355.859277]  [<ffffffff812fbebd>] ? ima_post_read_file+0x3d/0x80
[ 2355.859277]  [<ffffffff812ca17b>] ? security_kernel_post_read_file+0x6b/0x80
[ 2355.859277]  [<ffffffff8110f3b6>] SYSC_finit_module+0xa6/0xf0
[ 2355.859277]  [<ffffffff8110f41e>] SyS_finit_module+0xe/0x10
[ 2355.859277]  [<ffffffff81003a47>] do_syscall_64+0x67/0x160
[ 2355.859277]  [<ffffffff8173abe1>] entry_SYSCALL64_slow_path+0x25/0x25
@behlendorf behlendorf added this to the 0.7.0 milestone Oct 5, 2016
@behlendorf
Copy link
Contributor Author

@tcaputi @tonyhutter we'll want to run this one to ground right away if you have a few minutes to look at it.

@tuxoko
Copy link
Contributor

tuxoko commented Oct 7, 2016

@behlendorf
This might not be icp specific, but the rwlock/rwsem compatibility in general.

@tcaputi
Copy link
Contributor

tcaputi commented Oct 7, 2016

Sorry. I just saw the email now. I'd need to look into it a little more on Monday, but I can't think of a reason why this would break unless RW_READ_HELD() is also broken. The ICP really doesn't use anything in the Linux kernel itself. It should go through the SPL for everything.

@behlendorf
Copy link
Contributor Author

It looks to be a more generic Linux 4.8 issue. @tuxoko has proposed a fix in #5240 .

@tcaputi
Copy link
Contributor

tcaputi commented Oct 7, 2016

OK. Good. Sorry I'm late to this. I need to unsubscribe from all the ZoL emails so that I don''t skim over thhem anymore.

behlendorf pushed a commit to behlendorf/spl that referenced this issue Jan 20, 2017
Linux 4.8, starting from torvalds/linux@19c5d690e, will set owner to 1 when
read held instead of leave it NULL. So we change the condition to
`rw_owner(rwp) <= 1` in RW_READ_HELD.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs/zfs#5233 
Closes openzfs#577
behlendorf pushed a commit to behlendorf/spl that referenced this issue Feb 2, 2017
Linux 4.8, starting from torvalds/linux@19c5d690e, will set owner to 1 when
read held instead of leave it NULL. So we change the condition to
`rw_owner(rwp) <= 1` in RW_READ_HELD.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs/zfs#5233
Closes openzfs#577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants