Skip to content

issues on xu4 with branch: odroidxu4-v4.2 #2

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

Open
qknight opened this issue Dec 7, 2015 · 5 comments
Open

issues on xu4 with branch: odroidxu4-v4.2 #2

qknight opened this issue Dec 7, 2015 · 5 comments

Comments

@qknight
Copy link

qknight commented Dec 7, 2015

as described here:
http://forum.odroid.com/viewtopic.php?f=95&t=15277#p116655

i'm having problems with usb attached 2,5" harddrives. the kernel reports:

Buffer I/O error on dev sda1, logical block 121667584, lost sync page write

i'm also seeing:

Nov 22 19:08:44 nixos systemd-journal[424]: Missed 219 kernel messages
Nov 22 19:08:44 nixos kernel: Emergency Thaw on mmcblk0p2

see the forum post for more information on my configuration, kernel config, u-boot version and bug-report!

thanks for the effort in porting xu4 support into kernel 4.2.0!

@qknight
Copy link
Author

qknight commented Dec 7, 2015

there, it just happened again!

[ 8603.550289] usb 3-1.1: USB disconnect, device number 3
[ 8613.257422] Buffer I/O error on dev sda1, logical block 121667584, lost sync page write
[ 8613.257506] JBD2: Error -5 detected when updating journal superblock for sda1-8.
[ 8613.257556] Aborting journal on device sda1-8.
[ 8613.257648] Buffer I/O error on dev sda1, logical block 121667584, lost sync page write
[ 8613.257709] JBD2: Error -5 detected when updating journal superblock for sda1-8.
[ 8613.301858] Unable to handle kernel paging request at virtual address 2da4b000
[ 8613.301871] pgd = de044000
[ 8613.301880] [2da4b000] *pgd=00000000
[ 8613.301898] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 8613.305730] Modules linked in: cfg80211 nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack xt_pkttype nf_log_ipv6 nf_log_ipv4 nf_log_common
[ 8613.320146] usb 3-1.1: new high-speed USB device number 4 using xhci-hcd
[ 8613.327131]  xt_LOG
[ 8613.329206]  ip6table_filter ip6_tables usb_storage cdc_ether usbnet r8152 spi_s3c64xx leds_pwm nf_conntrack_ftp nf_conntrack atkbd cpufreq_ondemand ipv6 autofs4 dm_mod
[ 8613.342901] CPU: 3 PID: 1007 Comm: umount Not tainted 4.2.0 #1-NixOS
[ 8613.349227] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[ 8613.355294] task: de095a00 ti: de1fc000 task.ti: de1fc000
[ 8613.360673] PC is at __percpu_counter_add+0x38/0x10c
[ 8613.365605] LR is at 0x2da4b000
[ 8613.368724] pc : [<c04d9324>]    lr : [<2da4b000>]    psr: 20000093
               sp : de1fddc0  ip : 00000000  fp : de1fdde4
[ 8613.380168] r10: c0b6d830  r9 : 00000000  r8 : 00000001
[ 8613.385362] r7 : dd5ec828  r6 : eec7f4dc  r5 : 00000020  r4 : dd1f5570
[ 8613.391862] r3 : de1fc000  r2 : 00000002  r1 : c0956314  r0 : 00000003
[ 8613.398362] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 8613.405555] Control: 10c5387d  Table: 5e04406a  DAC: 00000015
[ 8613.406167] usb 3-1.1: New USB device found, idVendor=152d, idProduct=2509
[ 8613.406188] usb 3-1.1: New USB device strings: Mfr=1, Product=11, SerialNumber=3
[ 8613.406204] usb 3-1.1: Product: Usb production
[ 8613.406220] usb 3-1.1: Manufacturer: JMicron
[ 8613.406236] usb 3-1.1: SerialNumber: 20120912000A
[ 8613.409292] usb-storage 3-1.1:1.0: USB Mass Storage device detected
[ 8613.410157] scsi host1: usb-storage 3-1.1:1.0
[ 8613.449404] Process umount (pid: 1007, stack limit = 0xde1fc210)
[ 8613.455379] Stack: (0xde1fddc0 to 0xde1fe000)
[ 8613.459712] ddc0: c0b6ce78 dd1f5530 eec7f4dc dd5ec828 ee03b400 00000000 de1fde14 de1fdde8
[ 8613.467862] dde0: c0114f24 c04d92f8 00000020 00000000 de1fde14 dd5ec928 eec7f4dc dd5ec938
[ 8613.476008] de00: a0000013 ee03b400 de1fde3c de1fde18 c019d4b0 c0114e60 eec7f4dc ee03b400
[ 8613.484153] de20: 00000000 dd5ec928 ddcecd80 ed33f400 de1fde5c de1fde40 c019d760 c019d454
[ 8613.492298] de40: 00000000 de500000 c0b6ce78 c0b6c5ac de1fde9c de1fde60 c0231e84 c019d608
[ 8613.500444] de60: 0a369bd2 00000000 ed33f400 00000001 de095a00 ed0fc800 ed33f400 de500000
[ 8613.508589] de80: de095a00 c00109c4 de1fc000 00000000 de1fded4 de1fdea0 c0232c74 c0231d18
[ 8613.516735] dea0: c018474c c0183820 de1fdea8 de1fdea8 de500078 de500000 de500078 c07a7470
[ 8613.524880] dec0: de095a00 c00109c4 de1fdef4 de1fded8 c016b704 c0232ba8 c016ba0c dd5ec780
[ 8613.533025] dee0: 00000083 c0bfe2c0 de1fdf14 de1fdef8 c016ba34 c016b690 c016ba0c de500000
[ 8613.541171] df00: c0b9aaa8 c0bfe2c0 de1fdf2c de1fdf18 c016bd8c c016ba18 de500000 00000000
[ 8613.549317] df20: de1fdf44 de1fdf30 c016c21c c016bd30 de1fdf10 dd907100 de1fdf5c de1fdf48
[ 8613.557462] df40: c01880c8 c016c1c0 c0188164 de095dcc de1fdf6c de1fdf60 c0188180 c0188088
[ 8613.565608] df60: de1fdf8c de1fdf70 c004a1a8 c0188170 de1fc010 c00109c4 de1fdfb0 de1fc000
[ 8613.573754] df80: de1fdfac de1fdf90 c00141b4 c004a0f8 00016028 00015170 b6f6f7e8 00000034
[ 8613.581899] dfa0: 00000000 de1fdfb0 c001086c c001411c 00000000 00000000 00000000 00000002
[ 8613.590045] dfc0: 00016028 00015170 b6f6f7e8 00000034 00000000 00000000 bef91e44 ffffffff
[ 8613.598190] dfe0: b6e80ae4 bef91bec b6f50964 b6e80afc 60080010 00015170 00000000 00000000
[ 8613.606347] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8613.615356] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8613.623931] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8613.632429] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8613.641001] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8613.649238] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8613.657812] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8613.666565] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8613.675403] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8613.684242] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8613.692038] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8613.699578] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8613.707292] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8613.715180] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8613.722886] Code: e34c0095 ebffcc24 e594c020 ee1def90 (e79ec00c) 
[ 8613.728956] ---[ end trace 82fd5a2db3fb4c93 ]---
[ 8613.733541] note: umount[1007] exited with preempt_count 2
[ 8614.410706] scsi 1:0:0:0: Direct-Access     Jmicron  Corp.                 PQ: 0 ANSI: 2 CCS
[ 8634.310160] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8634.314402]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P1007
[ 8634.320363]  (detected by 1, t=4204 jiffies, g=67405, c=67404, q=699)
[ 8634.326802] umount          x c078689c     0  1007      0 0x00000004
[ 8634.333155] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8634.340183] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8634.347102] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8634.353601] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8634.361425] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8634.370268] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8634.378581] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8634.386819] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8634.394161] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8634.399161] dd60:                                                       00000003 c0956314
[ 8634.407345] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8634.415490] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8634.423665] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8634.431797] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8634.440814] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8634.449388] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8634.457891] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8634.466460] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8634.474695] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8634.483269] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8634.492023] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8634.500862] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8634.509697] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8634.517485] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8634.525022] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8634.532735] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8634.540633] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8634.548323] umount          x c078689c     0  1007      0 0x00000004
[ 8634.554624] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8634.561658] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8634.568584] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8634.575085] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8634.582908] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8634.591749] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8634.600067] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8634.608304] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8634.615649] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8634.620646] dd60:                                                       00000003 c0956314
[ 8634.628832] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8634.636975] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8634.645140] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8634.653281] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8634.662297] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8634.670874] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8634.679370] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8634.687944] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8634.696177] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8634.704756] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8634.713509] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8634.722347] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8634.731184] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8634.738969] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8634.746507] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8634.754222] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8634.762112] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8697.335576] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8697.344062]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P1007
[ 8697.355987]  (detected by 5, t=16811 jiffies, g=67405, c=67404, q=1009)
[ 8697.369227] umount          x c078689c     0  1007      0 0x00000004
[ 8697.381952] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8697.395998] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8697.409872] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8697.422881] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8697.438546] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8697.456245] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8697.472728] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8697.489212] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8697.503950] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8697.514005] dd60:                                                       00000003 c0956314
[ 8697.530326] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8697.546634] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8697.562952] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8697.579259] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8697.597306] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8697.614476] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8697.631478] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8697.648650] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8697.665135] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8697.682308] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8697.699830] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8697.717527] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8697.735223] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8697.750836] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8697.765929] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8697.781371] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8697.797163] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8697.812596] umount          x c078689c     0  1007      0 0x00000004
[ 8697.825254] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8697.839312] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8697.853191] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8697.866203] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8697.881826] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8697.899522] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8697.916178] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8697.932661] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8697.947402] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8697.957457] dd60:                                                       00000003 c0956314
[ 8697.973778] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8697.990086] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8698.006398] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8698.022706] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8698.040750] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8698.057926] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8698.074929] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8698.092106] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8698.108586] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8698.125764] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8698.143286] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8698.160983] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8698.178679] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8698.194291] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8698.209385] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8698.224826] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8698.240617] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8760.360962] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8760.369434]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P1007
[ 8760.381360]  (detected by 5, t=29416 jiffies, g=67405, c=67404, q=1334)
[ 8760.394599] umount          x c078689c     0  1007      0 0x00000004
[ 8760.407244] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8760.421288] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8760.435166] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8760.448176] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8760.463816] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8760.481513] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8760.498168] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8760.514656] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8760.529379] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8760.539416] dd60:                                                       00000003 c0956314
[ 8760.555694] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8760.572001] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8760.588319] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8760.604626] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8760.622672] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8760.639843] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8760.656850] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8760.674022] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8760.690508] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8760.707680] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8760.725202] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8760.742899] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8760.760596] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8760.776207] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8760.791302] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8760.806743] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8760.822536] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8760.837969] umount          x c078689c     0  1007      0 0x00000004
[ 8760.850627] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8760.864684] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8760.878564] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8760.891575] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8760.907197] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8760.924894] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8760.941549] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8760.958032] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8760.972774] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8760.982830] dd60:                                                       00000003 c0956314
[ 8760.999149] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8761.020328] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8761.044802] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8761.069274] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8761.096350] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8761.122123] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8761.147637] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8761.173410] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8761.198143] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8761.223916] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8761.250210] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8761.276764] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8761.303317] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8761.326746] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8761.349395] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8761.372565] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8761.396258] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8823.386347] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8823.398985]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P1007
[ 8823.416903]  (detected by 5, t=42023 jiffies, g=67405, c=67404, q=1643)
[ 8823.436744] umount          x c078689c     0  1007      0 0x00000004
[ 8823.455806] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8823.476888] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8823.497589] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8823.517111] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8823.540553] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8823.567108] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8823.592099] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8823.616835] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8823.638938] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8823.654031] dd60:                                                       00000003 c0956314
[ 8823.678514] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8823.758603] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8823.856516] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8823.954420] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8824.062743] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8824.165850] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8824.267925] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8824.371034] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8824.469985] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8824.573093] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8824.678288] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8824.784525] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8824.890762] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8824.984498] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8825.075112] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8825.167810] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8825.262594] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8825.355285] umount          x c078689c     0  1007      0 0x00000004
[ 8825.431310] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8825.515677] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8825.599000] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8825.677115] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8825.770862] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8825.877099] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8825.977086] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8826.076034] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8826.164561] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8826.224962] dd60:                                                       00000003 c0956314
[ 8826.322878] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8826.420783] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8826.518692] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8826.616596] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8826.724917] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8826.828029] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8826.930101] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8827.033212] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8827.132158] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8827.235271] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8827.340467] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8827.446705] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8827.552941] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8827.646677] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8827.737291] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8827.829988] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8827.924770] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8886.411716] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8886.461840]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P1007
[ 8886.533692]  (detected by 1, t=54649 jiffies, g=67405, c=67404, q=1993)
[ 8886.612824] umount          x c078689c     0  1007      0 0x00000004
[ 8886.688867] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8886.715903] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8886.722835] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8886.729335] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8886.737136] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8886.745973] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8886.754293] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8886.762526] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8886.769888] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8886.774909] dd60:                                                       00000003 c0956314
[ 8886.783060] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8886.791205] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8886.799359] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8886.807501] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8886.816517] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8886.825091] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8886.833587] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8886.842162] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8886.850402] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8886.858973] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8886.867725] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8886.876562] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8886.885403] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8886.893199] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8886.900738] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8886.908450] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8886.916341] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8886.924047] umount          x c078689c     0  1007      0 0x00000004
[ 8886.930367] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8886.937388] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8886.944320] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8886.950820] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8886.958622] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8886.967461] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8886.975778] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8886.984012] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8886.991375] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8886.996396] dd60:                                                       00000003 c0956314
[ 8887.004548] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8887.012693] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8887.020842] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8887.028986] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8887.037998] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8887.046577] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8887.055070] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8887.063648] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8887.071880] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8887.080460] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8887.089212] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8887.098051] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8887.106888] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8887.114685] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8887.122224] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8887.129936] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8887.137824] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8941.470403] usb 3-1.1: USB disconnect, device number 4
[ 8949.437115] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8949.445603]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P1007
[ 8949.457524]  (detected by 6, t=67231 jiffies, g=67405, c=67404, q=2700)
[ 8949.470765] umount          x c078689c     0  1007      0 0x00000004
[ 8949.483495] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8949.497551] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8949.511303] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8949.524314] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8949.539945] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8949.557643] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8949.574297] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8949.590784] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8949.605515] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8949.615560] dd60:                                                       00000003 c0956314
[ 8949.631894] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8949.648203] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8949.664483] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8949.680790] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8949.698839] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8949.716008] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8949.733014] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8949.750186] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8949.766672] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8949.783844] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8949.801366] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8949.819063] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8949.836760] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8949.852371] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8949.867465] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8949.882907] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8949.898700] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)
[ 8949.914134] umount          x c078689c     0  1007      0 0x00000004
[ 8949.926794] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8949.940848] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8949.954748] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8949.967742] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8949.983363] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8950.001059] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8950.017714] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8950.034199] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8950.048939] Exception stack(0xde1fdd78 to 0xde1fddc0)
[ 8950.058994] dd60:                                                       00000003 c0956314
[ 8950.075313] dd80: 00000002 de1fc000 dd1f5570 00000020 eec7f4dc dd5ec828 00000001 00000000
[ 8950.091622] dda0: c0b6d830 de1fdde4 00000000 de1fddc0 2da4b000 c04d9324 20000093 ffffffff
[ 8950.107939] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8950.124246] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8950.142292] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8950.159463] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8950.176469] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8950.193642] [<c0231e84>] (ext4_commit_super) from [<c0232c74>] (ext4_put_super+0xd8/0x30c)
[ 8950.210126] [<c0232c74>] (ext4_put_super) from [<c016b704>] (generic_shutdown_super+0x80/0xec)
[ 8950.227300] [<c016b704>] (generic_shutdown_super) from [<c016ba34>] (kill_block_super+0x28/0x78)
[ 8950.244823] [<c016ba34>] (kill_block_super) from [<c016bd8c>] (deactivate_locked_super+0x68/0x8c)
[ 8950.262519] [<c016bd8c>] (deactivate_locked_super) from [<c016c21c>] (deactivate_super+0x68/0x6c)
[ 8950.280215] [<c016c21c>] (deactivate_super) from [<c01880c8>] (cleanup_mnt+0x4c/0x90)
[ 8950.295827] [<c01880c8>] (cleanup_mnt) from [<c0188180>] (__cleanup_mnt+0x1c/0x20)
[ 8950.310921] [<c0188180>] (__cleanup_mnt) from [<c004a1a8>] (task_work_run+0xbc/0xf4)
[ 8950.326363] [<c004a1a8>] (task_work_run) from [<c00141b4>] (do_work_pending+0xa4/0xc4)
[ 8950.342155] [<c00141b4>] (do_work_pending) from [<c001086c>] (work_pending+0xc/0x20)

@qknight
Copy link
Author

qknight commented Dec 8, 2015

another OOPS:

this time:
sync --progress -av /tmp/z/* /b
/tmp/z was the 500GB WD
/b the 2TB WD

[    0.000000] Booting Linux on physical CPU 0x100
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.2.0 (nixbld1@xu4-nixi) (gcc version 4.9.3 (GCC) ) #1-NixOS SMP PREEMPT Thu Jan 1 00:00:01 UTC 1970
[    0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Hardkernel Odroid XU4
[    0.000000] cma: Reserved 128 MiB at 0xb6800000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Samsung CPU ID: 0xe5422001
[    0.000000] On node 0 totalpages: 514560
[    0.000000] free_area_init_node: node 0, pgdat c0bf3100, node_mem_map ee624000
[    0.000000]   Normal zone: 1710 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 190464 pages, LIFO batch:31
[    0.000000]   HighMem zone: 324096 pages, LIFO batch:31
[    0.000000] Running under secure firmware.
[    0.000000] PERCPU: Embedded 12 pages/cpu @ee58c000 s20416 r8192 d20544 u49152
[    0.000000] pcpu-alloc: s20416 r8192 d20544 u49152 alloc=12*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 512850
[    0.000000] Kernel command line: systemConfig=/nix/store/rbs05d0pc7g8cyssyrnigfh2k19azlmc-nixos-15.09.git.ba8f33fM init=/nix/store/rbs05d0pc7g8cyssyrnigfh2k19azlmc-nixos-15.09.git.ba8f33fM/init loglevel=4
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1891516K/2058240K available (8313K kernel code, 575K rwdata, 2676K rodata, 664K init, 396K bss, 35652K reserved, 131072K cma-reserved, 1165312K highmem)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
                   lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
                   pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
                   modules : 0xbf000000 - 0xbfe00000   (  14 MB)
                     .text : 0xc0008000 - 0xc0ac3910   (10991 kB)
                     .init : 0xc0ac4000 - 0xc0b6a000   ( 664 kB)
                     .data : 0xc0b6a000 - 0xc0bf9e7c   ( 576 kB)
                      .bss : 0xc0bfc000 - 0xc0c5f350   ( 397 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C: failed to init: -19
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000000] clocksource: mct-frc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000009] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000972] Console: colour dummy device 80x30
[    0.001190] console [tty0] enabled
[    0.001227] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=120000)
[    0.001251] pid_max: default: 32768 minimum: 301
[    0.001439] Security Framework initialized
[    0.001480] AppArmor: AppArmor initialized
[    0.001493] Yama: becoming mindful.
[    0.001599] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001620] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.002903] Initializing cgroup subsys blkio
[    0.002939] Initializing cgroup subsys memory
[    0.003009] Initializing cgroup subsys devices
[    0.003039] Initializing cgroup subsys freezer
[    0.003067] Initializing cgroup subsys net_cls
[    0.003093] Initializing cgroup subsys perf_event
[    0.003120] Initializing cgroup subsys debug
[    0.003214] CPU: Testing write buffer coherency: ok
[    0.003270] ftrace: allocating 25779 entries in 76 pages
[    0.053716] CPU0: update cpu_capacity 448
[    0.053740] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.054095] Setting up static identity map for 0x40008280 - 0x400082d8
[    0.054560] ARM CCI driver probed
[    0.054813] Exynos MCPM support installed
[    0.075680] CPU1: update cpu_capacity 1535
[    0.075689] CPU1: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.080660] CPU2: update cpu_capacity 1535
[    0.080669] CPU2: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.085683] CPU3: update cpu_capacity 1535
[    0.085691] CPU3: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.090656] CPU4: update cpu_capacity 1535
[    0.090665] CPU4: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095769] CPU5: update cpu_capacity 448
[    0.095779] CPU5: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.100766] CPU6: update cpu_capacity 448
[    0.100775] CPU6: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.105747] CPU7: update cpu_capacity 448
[    0.105756] CPU7: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.105878] Brought up 8 CPUs
[    0.105946] SMP: Total of 8 processors activated (384.00 BogoMIPS).
[    0.105959] CPU: WARNING: CPU(s) started in wrong/inconsistent modes (primary CPU mode 0x1a)
[    0.105970] CPU: This may indicate a broken bootloader or firmware.
[    0.107068] devtmpfs: initialized
[    0.138911] evm: security.SMACK64
[    0.138931] evm: security.SMACK64EXEC
[    0.138943] evm: security.SMACK64TRANSMUTE
[    0.138954] evm: security.SMACK64MMAP
[    0.138964] evm: security.ima
[    0.138975] evm: security.capability
[    0.139478] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 3
[    0.141288] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns
[    0.149801] xor: measuring software checksum speed
[    0.194967]    arm4regs  :  1052.000 MB/sec
[    0.244966]    8regs     :   680.000 MB/sec
[    0.294965]    32regs    :   660.000 MB/sec
[    0.294980] xor: using function: arm4regs (1052.000 MB/sec)
[    0.295185] pinctrl core: initialized pinctrl subsystem
[    0.296042] regulator-dummy: no parameters
[    0.297008] NET: Registered protocol family 16
[    0.299241] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.315014] cpuidle: using governor ladder
[    0.330006] cpuidle: using governor menu
[    0.335724] gpiochip_add: registered GPIOs 0 to 7 on device: gpy7
[    0.335984] gpiochip_add: registered GPIOs 8 to 15 on device: gpx0
[    0.336221] gpiochip_add: registered GPIOs 16 to 23 on device: gpx1
[    0.336471] gpiochip_add: registered GPIOs 24 to 31 on device: gpx2
[    0.336717] gpiochip_add: registered GPIOs 32 to 39 on device: gpx3
[    0.338512] gpiochip_add: registered GPIOs 40 to 47 on device: gpc0
[    0.338759] gpiochip_add: registered GPIOs 48 to 55 on device: gpc1
[    0.339006] gpiochip_add: registered GPIOs 56 to 62 on device: gpc2
[    0.339264] gpiochip_add: registered GPIOs 63 to 66 on device: gpc3
[    0.339510] gpiochip_add: registered GPIOs 67 to 68 on device: gpc4
[    0.339741] gpiochip_add: registered GPIOs 69 to 76 on device: gpd1
[    0.340009] gpiochip_add: registered GPIOs 77 to 82 on device: gpy0
[    0.340240] gpiochip_add: registered GPIOs 83 to 86 on device: gpy1
[    0.340470] gpiochip_add: registered GPIOs 87 to 92 on device: gpy2
[    0.340693] gpiochip_add: registered GPIOs 93 to 100 on device: gpy3
[    0.340918] gpiochip_add: registered GPIOs 101 to 108 on device: gpy4
[    0.341156] gpiochip_add: registered GPIOs 109 to 116 on device: gpy5
[    0.341387] gpiochip_add: registered GPIOs 117 to 124 on device: gpy6
[    0.342800] gpiochip_add: registered GPIOs 125 to 132 on device: gpe0
[    0.343032] gpiochip_add: registered GPIOs 133 to 134 on device: gpe1
[    0.343260] gpiochip_add: registered GPIOs 135 to 140 on device: gpf0
[    0.343495] gpiochip_add: registered GPIOs 141 to 148 on device: gpf1
[    0.343722] gpiochip_add: registered GPIOs 149 to 156 on device: gpg0
[    0.343958] gpiochip_add: registered GPIOs 157 to 164 on device: gpg1
[    0.344187] gpiochip_add: registered GPIOs 165 to 166 on device: gpg2
[    0.344414] gpiochip_add: registered GPIOs 167 to 170 on device: gpj4
[    0.345807] gpiochip_add: registered GPIOs 171 to 178 on device: gpa0
[    0.346041] gpiochip_add: registered GPIOs 179 to 184 on device: gpa1
[    0.346287] gpiochip_add: registered GPIOs 185 to 192 on device: gpa2
[    0.346520] gpiochip_add: registered GPIOs 193 to 197 on device: gpb0
[    0.346757] gpiochip_add: registered GPIOs 198 to 202 on device: gpb1
[    0.347001] gpiochip_add: registered GPIOs 203 to 206 on device: gpb2
[    0.347239] gpiochip_add: registered GPIOs 207 to 214 on device: gpb3
[    0.347472] gpiochip_add: registered GPIOs 215 to 216 on device: gpb4
[    0.347712] gpiochip_add: registered GPIOs 217 to 224 on device: gph0
[    0.349149] gpiochip_add: registered GPIOs 225 to 231 on device: gpz
[    0.352712] exynos-audss-clk 3810000.audss-clock-controller:: setup completed
[    0.364397] EXYNOS5420 PMU initialized
[    0.377458] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.377475] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.490347] raid6: int32x1  gen()   121 MB/s
[    0.575220] raid6: int32x1  xor()    91 MB/s
[    0.660319] raid6: int32x2  gen()   146 MB/s
[    0.745291] raid6: int32x2  xor()    97 MB/s
[    0.830353] raid6: int32x4  gen()   142 MB/s
[    0.915265] raid6: int32x4  xor()    98 MB/s
[    1.000404] raid6: int32x8  gen()   144 MB/s
[    1.085264] raid6: int32x8  xor()    91 MB/s
[    1.085279] raid6: using algorithm int32x2 gen() 146 MB/s
[    1.085291] raid6: .... xor() 97 MB/s, rmw enabled
[    1.085303] raid6: using intx1 recovery algorithm
[    1.087413] SCSI subsystem initialized
[    1.087959] usbcore: registered new interface driver usbfs
[    1.088091] usbcore: registered new interface driver hub
[    1.088331] usbcore: registered new device driver usb
[    1.089425] s3c-i2c 12c80000.i2c:: slave address 0x00
[    1.089449] s3c-i2c 12c80000.i2c:: bus frequency set to 65 KHz
[    1.090206] s3c-i2c 12c80000.i2c:: i2c-2: S3C I2C adapter
[    1.093084] NetLabel: Initializing
[    1.093101] NetLabel:  domain hash size = 128
[    1.093112] NetLabel:  protocols = UNLABELED CIPSOv4
[    1.093199] NetLabel:  unlabeled traffic allowed by default
[    1.093502] clocksource: Switched to clocksource mct-frc
[    1.211054] AppArmor: AppArmor Filesystem Enabled
[    1.236684] NET: Registered protocol family 2
[    1.237687] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    1.237793] TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
[    1.238014] TCP: Hash tables configured (established 8192 bind 8192)
[    1.238089] UDP hash table entries: 512 (order: 2, 24576 bytes)
[    1.238145] UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
[    1.238547] NET: Registered protocol family 1
[    1.239198] RPC: Registered named UNIX socket transport module.
[    1.239214] RPC: Registered udp transport module.
[    1.239227] RPC: Registered tcp transport module.
[    1.239240] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.239621] Trying to unpack rootfs image as initramfs...
[    1.503406] Freeing initrd memory: 3416K (cfcaa000 - d0000000)
[    1.507920] futex hash table entries: 2048 (order: 5, 131072 bytes)
[    1.508099] audit: initializing netlink subsys (disabled)
[    1.508161] audit: type=2000 audit(1.485:1): initialized
[    1.528381] VFS: Disk quotas dquot_6.6.0
[    1.528885] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.535414] NFS: Registering the id_resolver key type
[    1.535461] Key type id_resolver registered
[    1.535475] Key type id_legacy registered
[    1.535513] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.536805] Key type cifs.idmap registered
[    1.536833] ntfs: driver 2.1.32 [Flags: R/W].
[    1.538014] JFS: nTxBlock = 8192, nTxLock = 65536
[    1.545236] Key type big_key registered
[    1.547585] Key type asymmetric registered
[    1.547610] Asymmetric key parser 'x509' registered
[    1.547735] bounce: pool size: 64 pages
[    1.548190] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    1.548539] io scheduler noop registered
[    1.548566] io scheduler deadline registered
[    1.548655] io scheduler cfq registered (default)
[    1.549135] phy phy-video-phy@10040728:.0: Looking up phy-supply from device tree
[    1.549156] phy phy-video-phy@10040728:.0: Looking up phy-supply property in node /video-phy@10040728 failed
[    1.549875] phy phy-video-phy@10040714:.1: Looking up phy-supply from device tree
[    1.549895] phy phy-video-phy@10040714:.1: Looking up phy-supply property in node /video-phy@10040714 failed
[    1.550153] phy phy-video-phy@10040714:.2: Looking up phy-supply from device tree
[    1.550172] phy phy-video-phy@10040714:.2: Looking up phy-supply property in node /video-phy@10040714 failed
[    1.550406] phy phy-video-phy@10040714:.3: Looking up phy-supply from device tree
[    1.550425] phy phy-video-phy@10040714:.3: Looking up phy-supply property in node /video-phy@10040714 failed
[    1.550657] phy phy-video-phy@10040714:.4: Looking up phy-supply from device tree
[    1.550674] phy phy-video-phy@10040714:.4: Looking up phy-supply property in node /video-phy@10040714 failed
[    1.551848] phy phy-12130000.phy:.5: Looking up phy-supply from device tree
[    1.551868] phy phy-12130000.phy:.5: Looking up phy-supply property in node /phy@12130000 failed
[    1.552121] phy phy-12130000.phy:.6: Looking up phy-supply from device tree
[    1.552140] phy phy-12130000.phy:.6: Looking up phy-supply property in node /phy@12130000 failed
[    1.552380] phy phy-12130000.phy:.7: Looking up phy-supply from device tree
[    1.552399] phy phy-12130000.phy:.7: Looking up phy-supply property in node /phy@12130000 failed
[    1.552633] phy phy-12130000.phy:.8: Looking up phy-supply from device tree
[    1.552651] phy phy-12130000.phy:.8: Looking up phy-supply property in node /phy@12130000 failed
[    1.553433] exynos5_usb3drd_phy 12100000.phy:: Looking up vbus-supply from device tree
[    1.553454] exynos5_usb3drd_phy 12100000.phy:: Looking up vbus-supply property in node /phy@12100000 failed
[    1.553469] 12100000.phy: supply vbus not found, using dummy regulator
[    1.553640] exynos5_usb3drd_phy 12100000.phy:: Looking up vbus-boost-supply from device tree
[    1.553660] exynos5_usb3drd_phy 12100000.phy:: Looking up vbus-boost-supply property in node /phy@12100000 failed
[    1.553675] 12100000.phy: supply vbus-boost not found, using dummy regulator
[    1.553791] phy phy-12100000.phy:.9: Looking up phy-supply from device tree
[    1.553811] phy phy-12100000.phy:.9: Looking up phy-supply property in node /phy@12100000 failed
[    1.554076] phy phy-12100000.phy:.10: Looking up phy-supply from device tree
[    1.554096] phy phy-12100000.phy:.10: Looking up phy-supply property in node /phy@12100000 failed
[    1.554495] exynos5_usb3drd_phy 12500000.phy:: Looking up vbus-supply from device tree
[    1.554515] exynos5_usb3drd_phy 12500000.phy:: Looking up vbus-supply property in node /phy@12500000 failed
[    1.554529] 12500000.phy: supply vbus not found, using dummy regulator
[    1.554635] exynos5_usb3drd_phy 12500000.phy:: Looking up vbus-boost-supply from device tree
[    1.554655] exynos5_usb3drd_phy 12500000.phy:: Looking up vbus-boost-supply property in node /phy@12500000 failed
[    1.554669] 12500000.phy: supply vbus-boost not found, using dummy regulator
[    1.554780] phy phy-12500000.phy:.11: Looking up phy-supply from device tree
[    1.554799] phy phy-12500000.phy:.11: Looking up phy-supply property in node /phy@12500000 failed
[    1.555063] phy phy-12500000.phy:.12: Looking up phy-supply from device tree
[    1.555082] phy phy-12500000.phy:.12: Looking up phy-supply property in node /phy@12500000 failed
[    1.561527] dma-pl330 3880000.adma: Loaded driver for PL330 DMAC-241330
[    1.561547] dma-pl330 3880000.adma:  DBUFF-4x8bytes Num_Chans-6 Num_Peri-16 Num_Events-6
[    1.569352] dma-pl330 121a0000.pdma: Loaded driver for PL330 DMAC-241330
[    1.569372] dma-pl330 121a0000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    1.576914] dma-pl330 121b0000.pdma: Loaded driver for PL330 DMAC-241330
[    1.576935] dma-pl330 121b0000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    1.579207] dma-pl330 10800000.mdma: Loaded driver for PL330 DMAC-241330
[    1.579227] dma-pl330 10800000.mdma:         DBUFF-64x8bytes Num_Chans-8 Num_Peri-1 Num_Events-32
[    1.579365] xenfs: not registering filesystem on non-xen platform
[    1.737359] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.740618] 12c00000.serial:: ttySAC0 at MMIO 0x12c00000 (irq = 58, base_baud = 0) is a S3C6400/10
[    1.741447] 12c10000.serial:: ttySAC1 at MMIO 0x12c10000 (irq = 59, base_baud = 0) is a S3C6400/10
[    1.742260] 12c20000.serial:: ttySAC2 at MMIO 0x12c20000 (irq = 60, base_baud = 0) is a S3C6400/10
[    1.745278] console [ttySAC2] enabled
[    1.746174] 12c30000.serial:: ttySAC3 at MMIO 0x12c30000 (irq = 61, base_baud = 0) is a S3C6400/10
[    1.768982] brd: module loaded
[    1.782692] loop: module loaded
[    1.784737] exynos-dwc3 usb@12000000:: no suspend clk specified
[    1.784762] exynos-dwc3 usb@12000000:: Looking up vdd33-supply from device tree
[    1.785467] exynos-dwc3 usb@12400000:: no suspend clk specified
[    1.785490] exynos-dwc3 usb@12400000:: Looking up vdd33-supply from device tree
[    1.786126] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.786150] ehci-exynos: EHCI EXYNOS driver
[    1.786445] of_get_named_gpiod_flags: can't parse 'samsung,vbus-gpio' property of node '/usb@12110000[0]'
[    1.786744] exynos-ehci 12110000.usb:: EHCI Host Controller
[    1.786801] exynos-ehci 12110000.usb:: new USB bus registered, assigned bus number 1
[    1.787126] exynos-ehci 12110000.usb:: irq 116, io mem 0x12110000
[    1.793555] exynos-ehci 12110000.usb:: USB 2.0 started, EHCI 1.00
[    1.793901] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.793919] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.793934] usb usb1: Product: EHCI Host Controller
[    1.793950] usb usb1: Manufacturer: Linux 4.2.0 ehci_hcd
[    1.793964] usb usb1: SerialNumber: 12110000.usb:
[    1.795330] hub 1-0:1.0: USB hub found
[    1.795397] hub 1-0:1.0: 3 ports detected
[    1.796985] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.797030] ohci-exynos: OHCI EXYNOS driver
[    1.797456] exynos-ohci 12120000.usb:: USB Host Controller
[    1.797511] exynos-ohci 12120000.usb:: new USB bus registered, assigned bus number 2
[    1.797701] exynos-ohci 12120000.usb:: irq 116, io mem 0x12120000
[    1.852902] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    1.852920] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.852936] usb usb2: Product: USB Host Controller
[    1.852950] usb usb2: Manufacturer: Linux 4.2.0 ohci_hcd
[    1.852965] usb usb2: SerialNumber: 12120000.usb:
[    1.854352] hub 2-0:1.0: USB hub found
[    1.854421] hub 2-0:1.0: 3 ports detected
[    1.856492] s3c-rtc 101e0000.rtc:: failed to find rtc source clock
[    1.867564] vdd_ldo1: 1000 mV 
[    1.869035] LDO2: at 1800 mV 
[    1.870982] vdd_ldo3: 1800 mV 
[    1.872389] LDO4: at 1800 mV 
[    1.874336] vdd_ldo5: 1800 mV 
[    1.876300] vdd_ldo6: 1000 mV 
[    1.878241] vdd_ldo7: 1800 mV 
[    1.880172] vdd_ldo8: 1800 mV 
[    1.883985] vdd_ldo9: ramp_delay not set
[    1.884518] vdd_ldo9: 3000 mV 
[    1.886458] vdd_ldo10: 1800 mV 
[    1.888398] vdd_ldo11: 1000 mV 
[    1.890281] vdd_ldo12: 1800 mV 
[    1.892108] vdd_ldo13: 1800 <--> 3300 mV at 3300 mV 
[    1.893438] LDO14: at 3000 mV 
[    1.897952] vdd_ldo15: ramp_delay not set
[    1.898531] vdd_ldo15: 3100 mV 
[    1.900838] vdd_ldo16: 2200 mV 
[    1.902783] tsp_avdd: 3300 mV 
[    1.904248] LDO18: at 1800 mV 
[    1.908627] vdd_sd: 2800 mV 
[    1.910039] LDO20: at 1800 mV 
[    1.911459] LDO21: at 1800 mV 
[    1.912868] LDO22: at 1200 mV 
[    1.914300] LDO23: at 1100 mV 
[    1.916588] tsp_io: 2800 mV 
[    1.918037] LDO25: at 1800 mV 
[    1.920383] vdd_ldo26: 3000 mV 
[    1.921803] LDO27: at 1000 mV 
[    1.923217] LDO28: at 3300 mV 
[    1.924647] LDO29: at 1800 mV 
[    1.926063] LDO30: at 1800 mV 
[    1.927482] LDO31: at 1800 mV 
[    1.928908] LDO32: at 1800 mV 
[    1.930329] LDO33: at 1800 mV 
[    1.931750] LDO34: at 3000 mV 
[    1.933200] LDO35: at 1600 mV 
[    1.934622] LDO36: at 1800 mV 
[    1.936044] LDO37: at 1800 mV 
[    1.937466] LDO38: at 2800 mV 
[    1.939429] vdd_mif: 800 <--> 1300 mV at 1100 mV 
[    1.941370] vdd_arm: 800 <--> 1500 mV at 1000 mV 
[    1.943318] vdd_int: 800 <--> 1400 mV at 1000 mV 
[    1.945319] vdd_g3d: 800 <--> 1400 mV at 1000 mV 
[    1.947266] vdd_mem: 800 <--> 1400 mV at 1200 mV 
[    1.949177] vdd_kfc: 800 <--> 1500 mV at 1025 mV 
[    1.951040] vdd_1.0v_ldo: 800 <--> 1500 mV at 900 mV 
[    1.952863] vdd_1.8v_ldo: 800 <--> 1500 mV at 1225 mV 
[    1.955091] vdd_2.8v_ldo: 3000 <--> 3750 mV at 5000 mV 
[    1.957379] vdd_vmem: 2850 mV 
[    1.964515] s5m-rtc s2mps14-rtc: rtc core: registered s5m-rtc as rtc0
[    1.969068] thermal thermal_zone0: failed to read out thermal zone (-22)
[    1.969115] exynos-tmu 10060000.tmu:: Looking up vtmu-supply from device tree
[    1.970132] thermal thermal_zone1: failed to read out thermal zone (-22)
[    1.970175] exynos-tmu 10064000.tmu:: Looking up vtmu-supply from device tree
[    1.971199] thermal thermal_zone2: failed to read out thermal zone (-22)
[    1.971241] exynos-tmu 10068000.tmu:: Looking up vtmu-supply from device tree
[    1.972307] thermal thermal_zone3: failed to read out thermal zone (-22)
[    1.972349] exynos-tmu 1006c000.tmu:: Looking up vtmu-supply from device tree
[    1.973455] thermal thermal_zone4: failed to read out thermal zone (-22)
[    1.973551] exynos-tmu 100a0000.tmu:: Looking up vtmu-supply from device tree
[    1.975932] s3c2410-wdt 101d0000.watchdog:: watchdog inactive, reset disabled, irq disabled
[    1.976626] cpu cpu0: Looking up cpu-cluster.1-supply from device tree
[    1.979539] cpu cpu0: bL_cpufreq_init: CPU 0 initialized
[    1.982969] cpu cpu1: Looking up cpu-cluster.0-supply from device tree
[    1.986405] cpu cpu1: bL_cpufreq_init: CPU 1 initialized
[    1.989597] arm_big_little: bL_cpufreq_register: Registered platform driver: dt-bl
[    1.989841] sdhci: Secure Digital Host Controller Interface driver
[    1.989848] sdhci: Copyright(c) Pierre Ossman
[    1.990039] Synopsys Designware Multimedia Card Interface Driver
[    1.990547] dwmmc_exynos 12200000.mmc:: num-slots property not found, assuming 1 slot is available
[    1.990610] dwmmc_exynos 12200000.mmc:: IDMAC supports 32-bit address mode.
[    1.990670] dwmmc_exynos 12200000.mmc:: Using internal DMA controller.
[    1.990683] dwmmc_exynos 12200000.mmc:: Version ID is 250a
[    1.990726] dwmmc_exynos 12200000.mmc:: DW MMC controller at irq 90, 64 bit host data width, 64 deep fifo
[    1.990748] dwmmc_exynos 12200000.mmc:: Looking up vmmc-supply from device tree
[    1.991288] dwmmc_exynos 12200000.mmc:: Looking up vqmmc-supply from device tree
[    1.991298] dwmmc_exynos 12200000.mmc:: Looking up vqmmc-supply property in node /mmc@12200000 failed
[    1.991375] dwmmc_exynos 12200000.mmc:: No vqmmc regulator found
[    1.991391] dwmmc_exynos 12200000.mmc:: GPIO lookup for consumer cd
[    1.991398] dwmmc_exynos 12200000.mmc:: using device tree for GPIO lookup
[    1.991412] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/mmc@12200000[0]' - status (0)
[    1.991430] dwmmc_exynos 12200000.mmc:: Got CD GPIO
[    1.991439] dwmmc_exynos 12200000.mmc:: GPIO lookup for consumer wp
[    1.991446] dwmmc_exynos 12200000.mmc:: using device tree for GPIO lookup
[    1.991455] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/mmc@12200000[0]'
[    1.991463] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/mmc@12200000[0]'
[    1.991470] dwmmc_exynos 12200000.mmc:: using lookup tables for GPIO lookup
[    1.991478] dwmmc_exynos 12200000.mmc:: lookup for GPIO wp failed
[    1.991575] platform pwrseq:: GPIO lookup for consumer reset
[    1.991582] platform pwrseq:: using device tree for GPIO lookup
[    1.991594] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/pwrseq[0]' - status (0)
[    1.991613] dwmmc_exynos 12200000.mmc:: allocated mmc-pwrseq
[    2.018801] dwmmc_exynos 12200000.mmc:: 1 slots initialized
[    2.018998] dwmmc_exynos 12220000.mmc:: num-slots property not found, assuming 1 slot is available
[    2.019055] dwmmc_exynos 12220000.mmc:: IDMAC supports 32-bit address mode.
[    2.019093] dwmmc_exynos 12220000.mmc:: Using internal DMA controller.
[    2.019106] dwmmc_exynos 12220000.mmc:: Version ID is 250a
[    2.019147] dwmmc_exynos 12220000.mmc:: DW MMC controller at irq 91, 64 bit host data width, 64 deep fifo
[    2.019167] dwmmc_exynos 12220000.mmc:: Looking up vmmc-supply from device tree
[    2.019704] dwmmc_exynos 12220000.mmc:: Looking up vqmmc-supply from device tree
[    2.020304] dwmmc_exynos 12220000.mmc:: GPIO lookup for consumer cd
[    2.020312] dwmmc_exynos 12220000.mmc:: using device tree for GPIO lookup
[    2.020324] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/mmc@12220000[0]' - status (0)
[    2.020341] dwmmc_exynos 12220000.mmc:: Got CD GPIO
[    2.020349] dwmmc_exynos 12220000.mmc:: GPIO lookup for consumer wp
[    2.020356] dwmmc_exynos 12220000.mmc:: using device tree for GPIO lookup
[    2.020365] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/mmc@12220000[0]'
[    2.020373] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/mmc@12220000[0]'
[    2.020380] dwmmc_exynos 12220000.mmc:: using lookup tables for GPIO lookup
[    2.020388] dwmmc_exynos 12220000.mmc:: lookup for GPIO wp failed
[    2.048798] dwmmc_exynos 12220000.mmc:: 1 slots initialized
[    2.050274] s5p-sss driver registered
[    2.050987] usbcore: registered new interface driver usbhid
[    2.050994] usbhid: USB HID core driver
[    2.051847] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.051954] NET: Registered protocol family 17
[    2.051986] NET: Registered protocol family 15
[    2.052316] Registering SWP/SWPB emulation handler
[    2.053145] registered taskstats version 1
[    2.055451] Btrfs loaded, debug=on, assert=on, integrity-checker=on
[    2.055507] BTRFS: selftest: Running btrfs free space cache tests
[    2.055515] BTRFS: selftest: Running extent only tests
[    2.055537] BTRFS: selftest: Running bitmap only tests
[    2.055558] BTRFS: selftest: Running bitmap and extent tests
[    2.055593] BTRFS: selftest: Running space stealing from bitmap to extent
[    2.056043] BTRFS: selftest: Free space cache tests finished
[    2.056049] BTRFS: selftest: Running extent buffer operation tests
[    2.056055] BTRFS: selftest: Running btrfs_split_item tests
[    2.056090] BTRFS: selftest: Running find delalloc tests
[    2.403881] BTRFS: selftest: Running btrfs_get_extent tests
[    2.404130] BTRFS: selftest: Running hole first btrfs_get_extent test
[    2.404179] BTRFS: selftest: Running outstanding_extents tests
[    2.404263] BTRFS: selftest: Running qgroup tests
[    2.404270] BTRFS: selftest: Qgroup basic add
[    2.404344] BTRFS: selftest: Qgroup multiple refs test
[    2.447499] mmc0: MAN_BKOPS_EN bit is not set
[    2.449839] Key type encrypted registered
[    2.449859] AppArmor: AppArmor sha1 policy hashing enabled
[    2.449871] ima: No TPM chip found, activating TPM-bypass!
[    2.449954] evm: HMAC attrs: 0x1
[    2.450631] exynos-dwc3 usb@12000000:: no suspend clk specified
[    2.450643] exynos-dwc3 usb@12000000:: Looking up vdd33-supply from device tree
[    2.451170] exynos-dwc3 usb@12000000:: Looking up vdd10-supply from device tree
[    2.454759] mmc_host mmc0: Bus speed (slot 0) = 200000000Hz (slot req 200000000Hz, actual 200000000HZ div = 0)
[    2.455385] mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 52000000Hz, actual 50000000HZ div = 0)
[    2.456564] mmc_host mmc0: Bus speed (slot 0) = 100000000Hz (slot req 52000000Hz, actual 50000000HZ div = 1)
[    2.456596] mmc_host mmc0: Bus speed (slot 0) = 400000000Hz (slot req 200000000Hz, actual 200000000HZ div = 1)
[    2.456814] mmc0: new HS400 MMC card at address 0001
[    2.463692] mmcblk0: mmc0:0001 SDW16G 14.6 GiB 
[    2.463908] mmcblk0boot0: mmc0:0001 SDW16G partition 1 4.00 MiB
[    2.464102] mmcblk0boot1: mmc0:0001 SDW16G partition 2 4.00 MiB
[    2.464281] mmcblk0rpmb: mmc0:0001 SDW16G partition 3 4.00 MiB
[    2.465468]  mmcblk0: p1 p2
[    2.654509] dwc3 12000000.dwc3:: No power optimization available
[    2.654534] dwc3 12000000.dwc3:: Event buf f06e6000 dma b684a000 length 256
[    2.654736] xhci-hcd xhci-hcd.6.auto: xHCI Host Controller
[    2.654766] xhci-hcd xhci-hcd.6.auto: new USB bus registered, assigned bus number 3
[    2.655092] xhci-hcd xhci-hcd.6.auto: hcc params 0x0220f04c hci version 0x100 quirks 0x00010010
[    2.655142] xhci-hcd xhci-hcd.6.auto: irq 138, io mem 0x12000000
[    2.655317] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002
[    2.655326] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.655333] usb usb3: Product: xHCI Host Controller
[    2.655341] usb usb3: Manufacturer: Linux 4.2.0 xhci-hcd
[    2.655348] usb usb3: SerialNumber: xhci-hcd.6.auto
[    2.655992] hub 3-0:1.0: USB hub found
[    2.656024] hub 3-0:1.0: 1 port detected
[    2.656511] xhci-hcd xhci-hcd.6.auto: xHCI Host Controller
[    2.656532] xhci-hcd xhci-hcd.6.auto: new USB bus registered, assigned bus number 4
[    2.656613] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.656737] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003
[    2.656745] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.656752] usb usb4: Product: xHCI Host Controller
[    2.656760] usb usb4: Manufacturer: Linux 4.2.0 xhci-hcd
[    2.656767] usb usb4: SerialNumber: xhci-hcd.6.auto
[    2.657411] hub 4-0:1.0: USB hub found
[    2.657442] hub 4-0:1.0: 1 port detected
[    2.658422] exynos-dwc3 usb@12400000:: no suspend clk specified
[    2.658433] exynos-dwc3 usb@12400000:: Looking up vdd33-supply from device tree
[    2.658979] exynos-dwc3 usb@12400000:: Looking up vdd10-supply from device tree
[    2.862171] dwc3 12400000.dwc3:: No power optimization available
[    2.862194] dwc3 12400000.dwc3:: Event buf f0719000 dma b6852000 length 256
[    2.862390] xhci-hcd xhci-hcd.9.auto: xHCI Host Controller
[    2.862417] xhci-hcd xhci-hcd.9.auto: new USB bus registered, assigned bus number 5
[    2.862725] xhci-hcd xhci-hcd.9.auto: hcc params 0x0220f04c hci version 0x100 quirks 0x00010010
[    2.862769] xhci-hcd xhci-hcd.9.auto: irq 139, io mem 0x12400000
[    2.862930] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002
[    2.862938] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.862945] usb usb5: Product: xHCI Host Controller
[    2.862952] usb usb5: Manufacturer: Linux 4.2.0 xhci-hcd
[    2.862959] usb usb5: SerialNumber: xhci-hcd.9.auto
[    2.863607] hub 5-0:1.0: USB hub found
[    2.863640] hub 5-0:1.0: 1 port detected
[    2.864166] xhci-hcd xhci-hcd.9.auto: xHCI Host Controller
[    2.864187] xhci-hcd xhci-hcd.9.auto: new USB bus registered, assigned bus number 6
[    2.864273] usb usb6: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.864396] usb usb6: New USB device found, idVendor=1d6b, idProduct=0003
[    2.864405] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.864412] usb usb6: Product: xHCI Host Controller
[    2.864419] usb usb6: Manufacturer: Linux 4.2.0 xhci-hcd
[    2.864426] usb usb6: SerialNumber: xhci-hcd.9.auto
[    2.865057] hub 6-0:1.0: USB hub found
[    2.865088] hub 6-0:1.0: 1 port detected
[    2.866263] s3c-rtc 101e0000.rtc:: rtc disabled, re-enabling
[    2.866581] s3c-rtc 101e0000.rtc:: rtc core: registered s3c as rtc1
[    2.868693] s5m-rtc s2mps14-rtc: setting system clock to 2015-12-08 11:55:22 UTC (1449575722)
[    2.897418] Freeing unused kernel memory: 664K (c0ac4000 - c0b6a000)
[    2.963560] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[    2.963787] usb 4-1: new SuperSpeed USB device number 2 using xhci-hcd
[    2.981333] usb 4-1: New USB device found, idVendor=05e3, idProduct=0616
[    2.981343] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.981350] usb 4-1: Product: USB3.0 Hub
[    2.981357] usb 4-1: Manufacturer: GenesysLogic
[    2.984300] device-mapper: ioctl: 4.32.0-ioctl (2015-6-26) initialised: [email protected]
[    2.993274] hub 4-1:1.0: USB hub found
[    2.993591] hub 4-1:1.0: 2 ports detected
[    3.007125] random: systemd-udevd urandom read with 92 bits of entropy available
[    3.096465] usb 3-1: New USB device found, idVendor=05e3, idProduct=0610
[    3.096474] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.096482] usb 3-1: Product: USB2.0 Hub
[    3.096489] usb 3-1: Manufacturer: GenesysLogic
[    3.105778] hub 3-1:1.0: USB hub found
[    3.106294] hub 3-1:1.0: 2 ports detected
[    3.298658] usb 6-1: new SuperSpeed USB device number 2 using xhci-hcd
[    3.314426] usb 6-1: New USB device found, idVendor=0bda, idProduct=8153
[    3.314446] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[    3.314457] usb 6-1: Product: USB 10/100/1000 LAN
[    3.314467] usb 6-1: Manufacturer: Realtek
[    3.314478] usb 6-1: SerialNumber: 000001000000
[    3.895530] random: nonblocking pool is initialized
[    3.968065] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    4.167582] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    4.168787] booting system configuration /nix/store/rbs05d0pc7g8cyssyrnigfh2k19azlmc-nixos-15.09.git.ba8f33fM
[    5.488398] systemd[1]: systemd 217 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK -SYSVINIT +UTMP -LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN )
[    5.488917] systemd[1]: Detected architecture 'arm'.
[    5.533009] systemd[1]: Inserted module 'autofs4'
[    5.548202] NET: Registered protocol family 10
[    5.549212] systemd[1]: Inserted module 'ipv6'
[    5.757160] systemd[1]: Starting Swap.
[    5.768709] systemd[1]: Reached target Swap.
[    5.768799] systemd[1]: Expecting device dev-mmcblk0p1.device...
[    5.778633] systemd[1]: Expecting device dev-disk-by\x2duuid-1ac955d7\x2dbdc6\x2d4c1c\x2d83cd\x2de5b438c7f6bf.device...
[    5.793635] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    5.793948] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    5.794004] systemd[1]: Expecting device dev-ttySAC2.device...
[    5.803630] systemd[1]: Starting Remote File Systems (Pre).
[    5.818611] systemd[1]: Reached target Remote File Systems (Pre).
[    5.818663] systemd[1]: Starting Remote File Systems.
[    5.828611] systemd[1]: Reached target Remote File Systems.
[    5.828710] systemd[1]: Starting Dispatch Password Requests to Console Directory Watch.
[    5.828968] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    5.829014] systemd[1]: Starting Paths.
[    5.838617] systemd[1]: Reached target Paths.
[    5.838673] systemd[1]: Starting Root Slice.
[    5.928668] systemd[1]: Created slice Root Slice.
[    5.928739] systemd[1]: Starting User and Session Slice.
[    5.943646] systemd[1]: Created slice User and Session Slice.
[    5.943708] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[    5.958629] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    5.958684] systemd[1]: Starting Delayed Shutdown Socket.
[    5.968619] systemd[1]: Listening on Delayed Shutdown Socket.
[    5.968672] systemd[1]: Starting Journal Socket (/dev/log).
[    5.983617] systemd[1]: Listening on Journal Socket (/dev/log).
[    5.983697] systemd[1]: Starting udev Kernel Socket.
[    5.993617] systemd[1]: Listening on udev Kernel Socket.
[    5.993691] systemd[1]: Starting udev Control Socket.
[    6.003614] systemd[1]: Listening on udev Control Socket.
[    6.003679] systemd[1]: Starting Journal Socket.
[    6.013616] systemd[1]: Listening on Journal Socket.
[    6.013700] systemd[1]: Starting System Slice.
[    6.028647] systemd[1]: Created slice System Slice.
[    6.028752] systemd[1]: Starting Remount Root and Kernel File Systems...
[    6.046381] systemd[1]: Starting system-getty.slice.
[    6.058728] systemd[1]: Created slice system-getty.slice.
[    6.058838] systemd[1]: Starting system-serial\x2dgetty.slice.
[    6.073289] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    6.073650] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    6.073758] systemd[1]: Starting Setup Virtual Console...
[    6.087257] systemd[1]: Starting Load Kernel Modules...
[    6.102210] systemd[1]: Mounting POSIX Message Queue File System...
[    6.117500] systemd[1]: Mounted Huge Pages File System.
[    6.118140] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[    6.126429] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[    6.137639] systemd[1]: Mounting Debug File System...
[    6.151962] systemd[1]: Starting udev Coldplug all Devices...
[    6.165896] systemd[1]: Starting Journal Service...
[    6.182271] systemd[1]: Starting Slices.
[    6.193621] systemd[1]: Reached target Slices.
[    6.213742] systemd[1]: Mounted Debug File System.
[    6.228682] systemd[1]: Mounted POSIX Message Queue File System.
[    6.243649] systemd[1]: Started Remount Root and Kernel File Systems.
[    6.258681] systemd[1]: Started Setup Virtual Console.
[    6.273711] systemd[1]: Started Load Kernel Modules.
[    6.293686] systemd[1]: Started Create list of required static device nodes for the current kernel.
[    6.368853] systemd[1]: Starting Create Static Device Nodes in /dev...
[    6.389652] systemd[1]: Mounting Configuration File System...
[    6.409938] systemd[1]: Mounted FUSE Control File System.
[    6.410167] systemd[1]: Starting Apply Kernel Variables...
[    6.427734] systemd[1]: Starting Load/Save Random Seed...
[    6.442722] systemd[1]: Starting Update UTMP about System Boot/Shutdown...
[    6.473797] systemd[1]: Mounted Configuration File System.
[    6.488699] systemd[1]: Started Create Static Device Nodes in /dev.
[    6.503692] systemd[1]: Started Apply Kernel Variables.
[    6.518682] systemd[1]: Started Load/Save Random Seed.
[    6.533717] systemd[1]: Started udev Coldplug all Devices.
[    6.543708] systemd[1]: Started Journal Service.
[    6.696795] systemd-journald[431]: Received request to flush runtime journal from PID 1
[    6.942581] s3c64xx-spi 12d30000.spi:: spi bus clock parent not specified, using clock at index 0 as parent
[    6.942597] s3c64xx-spi 12d30000.spi:: number of chip select lines not specified, assuming 1 chip select line
[    7.050186] EXT4-fs (mmcblk0p1): recovery complete
[    7.050218] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[    7.215383] usbcore: registered new interface driver r8152
[    7.234245] usbcore: registered new interface driver cdc_ether
[    7.360360] usb 6-1: reset SuperSpeed USB device number 2 using xhci-hcd
[    7.404950] r8152 6-1:1.0 eth0: v2.04.0 (2015/03/06)
[    7.404965] r8152 6-1:1.0 eth0: This product is covered by one or more of the following patents:
                        US6,570,884, US6,115,776, and US6,327,625.

[    7.908560] usb 3-1.1: new high-speed USB device number 3 using xhci-hcd
[    7.994442] usb 3-1.1: New USB device found, idVendor=152d, idProduct=2509
[    7.994462] usb 3-1.1: New USB device strings: Mfr=1, Product=11, SerialNumber=3
[    7.994472] usb 3-1.1: Product: Usb production
[    7.994482] usb 3-1.1: Manufacturer: JMicron
[    7.994492] usb 3-1.1: SerialNumber: 20120912000A
[    8.010137] usb-storage 3-1.1:1.0: USB Mass Storage device detected
[    8.011061] scsi host0: usb-storage 3-1.1:1.0
[    8.011549] usbcore: registered new interface driver usb-storage
[    8.042682] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    9.009309] scsi 0:0:0:0: Direct-Access     Jmicron  Corp.                 PQ: 0 ANSI: 2 CCS
[    9.012212] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    9.012437] sd 0:0:0:0: [sda] 976773120 512-byte logical blocks: (500 GB/465 GiB)
[    9.012932] sd 0:0:0:0: [sda] Write Protect is off
[    9.012951] sd 0:0:0:0: [sda] Mode Sense: 28 00 00 00
[    9.013397] sd 0:0:0:0: [sda] No Caching mode page found
[    9.013413] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.113840]  sda: sda1
[    9.116813] sd 0:0:0:0: [sda] Attached SCSI disk
[   10.163847] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   14.067195] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  389.561879] usb 4-1.2: new SuperSpeed USB device number 3 using xhci-hcd
[  389.579651] usb 4-1.2: New USB device found, idVendor=1058, idProduct=0827
[  389.579734] usb 4-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[  389.579796] usb 4-1.2: Product: My Passport 0827
[  389.579856] usb 4-1.2: Manufacturer: Western Digital
[  389.579916] usb 4-1.2: SerialNumber: 575844314535353452464C57
[  389.589284] usb-storage 4-1.2:1.0: USB Mass Storage device detected
[  389.600135] scsi host1: usb-storage 4-1.2:1.0
[  390.604318] scsi 1:0:0:0: Direct-Access     WD       My Passport 0827 1012 PQ: 0 ANSI: 6
[  390.606018] scsi 1:0:0:1: Enclosure         WD       SES Device       1012 PQ: 0 ANSI: 6
[  390.620989] sd 1:0:0:0: Attached scsi generic sg1 type 0
[  390.621116] sd 1:0:0:0: [sdb] 3906963456 512-byte logical blocks: (2.00 TB/1.81 TiB)
[  390.622573] sd 1:0:0:0: [sdb] Write Protect is off
[  390.622610] sd 1:0:0:0: [sdb] Mode Sense: 47 00 10 08
[  390.623957] sd 1:0:0:0: [sdb] No Caching mode page found
[  390.623990] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[  390.633190] scsi 1:0:0:1: Attached scsi generic sg2 type 13
[  390.698198]  sdb: sdb1
[  390.707898] sd 1:0:0:0: [sdb] Attached SCSI disk
[  405.743266]  sdb: sdb1
[  492.802227] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[ 7748.208181] EXT4-fs (sda1): recovery complete
[ 7748.209564] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 7773.270132] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 7782.730315] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 7783.651388] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 7784.256823] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 7839.588773] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 8109.981071] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 8121.465361] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 8145.000097] usb 3-1.1: USB disconnect, device number 3
[ 8145.005427] sd 0:0:0:0: [sda] UNKNOWN(0x2003) Result: hostbyte=0x01 driverbyte=0x00
[ 8145.005444] sd 0:0:0:0: [sda] CDB: opcode=0x28 28 00 03 25 c2 00 00 00 f0 00
[ 8145.005455] blk_update_request: I/O error, dev sda, sector 52806144
[ 8145.005594] sd 0:0:0:0: [sda] UNKNOWN(0x2003) Result: hostbyte=0x01 driverbyte=0x00
[ 8145.005609] sd 0:0:0:0: [sda] CDB: opcode=0x28 28 00 03 25 c2 f0 00 00 10 00
[ 8145.005622] blk_update_request: I/O error, dev sda, sector 52806384
[ 8145.545496] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.545586] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.545663] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.545738] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.545813] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.545888] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.545961] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.546034] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.546107] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.546180] EXT4-fs warning (device sda1): dx_probe:740: inode #17306567: lblock 0: comm rsync: error -5 reading directory block
[ 8145.844001] EXT4-fs error (device sda1): ext4_find_entry:1451: inode #2: comm rsync: reading directory lblock 0
[ 8145.844050] Unable to handle kernel paging request at virtual address 2da63000
[ 8145.844059] pgd = e21b0000
[ 8145.844066] [2da63000] *pgd=00000000
[ 8145.844082] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 8145.847918] Modules linked in: drbg xts gf128mul dm_crypt cfg80211 nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack xt_pkttype nf_log_ipv6 nf_log_ipv4 nf_log_common xt_LOG ip6table_filter ip6_tables usb_storage cdc_ether usbnet r8152 leds_pwm spi_s3c64xx nf_conntrack_ftp nf_conntrack atkbd cpufreq_ondemand ipv6 autofs4 dm_mod
[ 8145.879283] CPU: 5 PID: 2264 Comm: rsync Not tainted 4.2.0 #1-NixOS
[ 8145.885525] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[ 8145.891592] task: dd02aa00 ti: cf58c000 task.ti: cf58c000
[ 8145.896976] PC is at __percpu_counter_add+0x38/0x10c
[ 8145.901903] LR is at 0x2da63000
[ 8145.905020] pc : [<c04d9324>]    lr : [<2da63000>]    psr: 20030093
               sp : cf58db68  ip : 00000000  fp : cf58db8c
[ 8145.916469] r10: c0b6d830  r9 : 00000000  r8 : 00000001
[ 8145.921660] r7 : dd575228  r6 : eeab2094  r5 : 00000020  r4 : dda7ed70
[ 8145.928160] r3 : cf58c000  r2 : 00000002  r1 : c0956314  r0 : 00000005
[ 8145.934661] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 8145.941853] Control: 10c5387d  Table: 621b006a  DAC: 00000015
[ 8145.947570] Process rsync (pid: 2264, stack limit = 0xcf58c210)
[ 8145.953462] Stack: (0xcf58db68 to 0xcf58e000)
[ 8145.957797] db60:                   c0b6ce78 dda7ed30 eeab2094 dd575228 ee03b400 00000000
[ 8145.965948] db80: cf58dbbc cf58db90 c0114f24 c04d92f8 00000020 00000000 cf58dbbc dd575328
[ 8145.974094] dba0: eeab2094 dd575338 a0030013 ee03b400 cf58dbe4 cf58dbc0 c019d4b0 c0114e60
[ 8145.982239] dbc0: eeab2094 ee03b400 00000000 dd575328 e6a877c0 e063d400 cf58dc04 cf58dbe8
[ 8145.990402] dbe0: c019d760 c019d454 7fffecdc ed24bc00 c0b6ce78 c0b6c5ac cf58dc44 cf58dc08
[ 8145.998545] dc00: c0231e84 c019d608 00022718 00000000 cf58dc44 00000001 c022f7c8 de294eb8
[ 8146.006691] dc20: ed24bc00 00000000 00000000 000005ab c07a66a4 00000001 cf58dc94 cf58dc48
[ 8146.014825] dc40: c0232378 c0231d18 00000002 dd02ad58 cf58dc68 cf58dc60 c01a04b8 c019fdfc
[ 8146.022971] dc60: 00000000 cf58dca4 c09611d8 cf58dc64 00000001 00000000 00000001 de294eb8
[ 8146.031116] dc80: 00000001 00000001 cf58dd34 cf58dc98 c02200f0 c0232300 00000000 00000000
[ 8146.039261] dca0: c09611d8 00000000 c09611f8 00000000 e6516310 cf58dd4c ed24bc00 00000000
[ 8146.047408] dcc0: dd465000 dd465000 00000000 c0054340 dd02c800 ee5cc480 cf58dcfc 000000d0
[ 8146.055552] dce0: cf58c010 e6516310 e6516324 0000000c 00000000 00000000 00000000 00000000
[ 8146.063698] dd00: 00000000 00000000 de01ef28 e65162f8 e65162f8 de294eb8 0000000c de01eed8
[ 8146.071844] dd20: cf58deb0 cf58df5c cf58dd6c cf58dd38 c02203c0 c021fd48 c0181118 c078bb1c
[ 8146.079989] dd40: 00007520 00000000 cf58deb8 00000000 e65162f8 de01eed8 00000000 0000000c
[ 8146.088135] dd60: cf58dd84 cf58dd70 c0172bd0 c0220384 00000011 de01eed8 cf58dda4 cf58dd88
[ 8146.096280] dd80: c01731f0 c0172bac c0789ec0 01789a84 cf58deb0 00000001 cf58dddc cf58dda8
[ 8146.104426] dda0: c0175cd4 c01731b4 c01738a4 c043ad08 ed24bc00 dd294010 00000000 dd29401d
[ 8146.112571] ddc0: 00000062 00000000 0000000c ddf0dd00 cf58de24 cf58dde0 c0175f0c c0175b24
[ 8146.120717] dde0: ffffffff ddf0dd00 00000000 c0173e84 cf58de24 cf58de00 c0173e84 dd294010
[ 8146.128862] de00: 00000000 fffffdfa cf58deb0 ddf0dd00 cf58c000 cf58df5c cf58deac cf58de28
[ 8146.137008] de20: c01768d4 c0175dc4 00000000 c078bb84 cf58de54 cf58de40 c078bb84 c0054340
[ 8146.145153] de40: 00000000 dd323dec 00000000 fffffdfa cf58c028 ddf0dd00 00000004 dd323c00
[ 8146.153299] de60: 00000041 dd323c00 dd323c00 00000000 00000013 dd946200 cf58de9c c053aa78
[ 8146.161445] de80: cf58de9c 00000003 cf58df5c cf58deb0 00000001 c00109c4 cf58c000 00000000
[ 8146.169590] dea0: cf58df4c cf58deb0 c0178b54 c0176854 e0705310 de01eed8 6d432a22 0000000c
[ 8146.177736] dec0: dd294010 c078ba78 00000000 e30e0900 de294eb8 00000011 00000002 000001a0
[ 8146.185880] dee0: 00000000 00000000 00000000 cf58def0 c078bb30 c0054340 cf58df3c cf58df08
[ 8146.194026] df00: c01862b0 c078bb1c c0177e7c 00020000 00020000 00020000 ffffff9c dd294000
[ 8146.202172] df20: dd294000 00000000 cf58c000 ffffff9c 00000003 ffffff9c dd294000 00000005
[ 8146.210318] df40: cf58df94 cf58df50 c0168b0c c0178af0 00000000 00000000 dd946200 00020000
[ 8146.218463] df60: 00000000 00000024 00000100 00000001 00000000 b6c023b0 0006453c 00000005
[ 8146.226608] df80: c00109c4 cf58c000 cf58dfa4 cf58df98 c0168bfc c0168a00 00000000 cf58dfa8
[ 8146.234754] dfa0: c0010820 c0168bdc 00000000 b6c023b0 be956af0 00020000 00000000 00000000
[ 8146.242899] dfc0: 00000000 b6c023b0 0006453c 00000005 000cec60 00000004 00082fe8 00083874
[ 8146.251045] dfe0: 00073228 be9569c8 0001f2f8 b6f16fb0 60030010 be956af0 e7034c47 1adb8a73
[ 8146.259211] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8146.268217] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8146.276787] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8146.285287] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8146.293856] [<c0231e84>] (ext4_commit_super) from [<c0232378>] (__ext4_error_inode+0x84/0x150)
[ 8146.302439] [<c0232378>] (__ext4_error_inode) from [<c02200f0>] (ext4_find_entry+0x3b4/0x63c)
[ 8146.310925] [<c02200f0>] (ext4_find_entry) from [<c02203c0>] (ext4_lookup+0x48/0x1f0)
[ 8146.318729] [<c02203c0>] (ext4_lookup) from [<c0172bd0>] (lookup_real+0x30/0x5c)
[ 8146.326092] [<c0172bd0>] (lookup_real) from [<c01731f0>] (__lookup_hash+0x48/0x50)
[ 8146.333629] [<c01731f0>] (__lookup_hash) from [<c0175cd4>] (walk_component+0x1bc/0x2a0)
[ 8146.341601] [<c0175cd4>] (walk_component) from [<c0175f0c>] (link_path_walk+0x154/0x514)
[ 8146.349660] [<c0175f0c>] (link_path_walk) from [<c01768d4>] (path_openat+0x8c/0x1024)
[ 8146.357459] [<c01768d4>] (path_openat) from [<c0178b54>] (do_filp_open+0x70/0xd4)
[ 8146.364920] [<c0178b54>] (do_filp_open) from [<c0168b0c>] (do_sys_open+0x118/0x1dc)
[ 8146.372536] [<c0168b0c>] (do_sys_open) from [<c0168bfc>] (SyS_open+0x2c/0x30)
[ 8146.379647] [<c0168bfc>] (SyS_open) from [<c0010820>] (ret_fast_syscall+0x0/0x3c)
[ 8146.387095] Code: e34c0095 ebffcc24 e594c020 ee1def90 (e79ec00c) 
[ 8146.393162] ---[ end trace 22da93d3110f0894 ]---
[ 8146.397746] note: rsync[2264] exited with preempt_count 2
[ 8147.915517] usb 3-1.1: new high-speed USB device number 4 using xhci-hcd
[ 8148.011922] usb 3-1.1: New USB device found, idVendor=152d, idProduct=2509
[ 8148.017636] usb 3-1.1: New USB device strings: Mfr=1, Product=11, SerialNumber=3
[ 8148.040422] usb 3-1.1: Product: Usb production
[ 8148.043450] usb 3-1.1: Manufacturer: JMicron
[ 8148.047894] usb 3-1.1: SerialNumber: 20120912000A
[ 8148.055178] usb-storage 3-1.1:1.0: USB Mass Storage device detected
[ 8148.060776] scsi host2: usb-storage 3-1.1:1.0
[ 8149.066056] scsi 2:0:0:0: Direct-Access     Jmicron  Corp.                 PQ: 0 ANSI: 2 CCS
[ 8167.410453] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8167.414681]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P2264
[ 8167.420631]  (detected by 5, t=4204 jiffies, g=214624, c=214623, q=10847)
[ 8167.427402] rsync           x c078689c     0  2264      0 0x00000004
[ 8167.433765] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8167.440756] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8167.447689] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8167.454184] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8167.461992] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8167.470828] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8167.479146] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8167.487385] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8167.494737] Exception stack(0xcf58db20 to 0xcf58db68)
[ 8167.499758] db20: 00000005 c0956314 00000002 cf58c000 dda7ed70 00000020 eeab2094 dd575228
[ 8167.507912] db40: 00000001 00000000 c0b6d830 cf58db8c 00000000 cf58db68 2da63000 c04d9324
[ 8167.516053] db60: 20030093 ffffffff
[ 8167.519529] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8167.527683] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8167.536700] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8167.545272] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8167.553775] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8167.562340] [<c0231e84>] (ext4_commit_super) from [<c0232378>] (__ext4_error_inode+0x84/0x150)
[ 8167.570923] [<c0232378>] (__ext4_error_inode) from [<c02200f0>] (ext4_find_entry+0x3b4/0x63c)
[ 8167.579407] [<c02200f0>] (ext4_find_entry) from [<c02203c0>] (ext4_lookup+0x48/0x1f0)
[ 8167.587211] [<c02203c0>] (ext4_lookup) from [<c0172bd0>] (lookup_real+0x30/0x5c)
[ 8167.594572] [<c0172bd0>] (lookup_real) from [<c01731f0>] (__lookup_hash+0x48/0x50)
[ 8167.602109] [<c01731f0>] (__lookup_hash) from [<c0175cd4>] (walk_component+0x1bc/0x2a0)
[ 8167.610082] [<c0175cd4>] (walk_component) from [<c0175f0c>] (link_path_walk+0x154/0x514)
[ 8167.618141] [<c0175f0c>] (link_path_walk) from [<c01768d4>] (path_openat+0x8c/0x1024)
[ 8167.625940] [<c01768d4>] (path_openat) from [<c0178b54>] (do_filp_open+0x70/0xd4)
[ 8167.633401] [<c0178b54>] (do_filp_open) from [<c0168b0c>] (do_sys_open+0x118/0x1dc)
[ 8167.641017] [<c0168b0c>] (do_sys_open) from [<c0168bfc>] (SyS_open+0x2c/0x30)
[ 8167.648126] [<c0168bfc>] (SyS_open) from [<c0010820>] (ret_fast_syscall+0x0/0x3c)
[ 8167.655572] rsync           x c078689c     0  2264      0 0x00000004
[ 8167.661891] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8167.668912] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8167.675845] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8167.682341] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8167.690149] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8167.698988] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8167.707305] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8167.715541] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8167.722896] Exception stack(0xcf58db20 to 0xcf58db68)
[ 8167.727917] db20: 00000005 c0956314 00000002 cf58c000 dda7ed70 00000020 eeab2094 dd575228
[ 8167.736072] db40: 00000001 00000000 c0b6d830 cf58db8c 00000000 cf58db68 2da63000 c04d9324
[ 8167.744214] db60: 20030093 ffffffff
[ 8167.747680] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8167.755834] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8167.764847] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8167.773424] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8167.781917] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8167.790499] [<c0231e84>] (ext4_commit_super) from [<c0232378>] (__ext4_error_inode+0x84/0x150)
[ 8167.799073] [<c0232378>] (__ext4_error_inode) from [<c02200f0>] (ext4_find_entry+0x3b4/0x63c)
[ 8167.807563] [<c02200f0>] (ext4_find_entry) from [<c02203c0>] (ext4_lookup+0x48/0x1f0)
[ 8167.815362] [<c02203c0>] (ext4_lookup) from [<c0172bd0>] (lookup_real+0x30/0x5c)
[ 8167.822726] [<c0172bd0>] (lookup_real) from [<c01731f0>] (__lookup_hash+0x48/0x50)
[ 8167.830266] [<c01731f0>] (__lookup_hash) from [<c0175cd4>] (walk_component+0x1bc/0x2a0)
[ 8167.838239] [<c0175cd4>] (walk_component) from [<c0175f0c>] (link_path_walk+0x154/0x514)
[ 8167.846297] [<c0175f0c>] (link_path_walk) from [<c01768d4>] (path_openat+0x8c/0x1024)
[ 8167.854096] [<c01768d4>] (path_openat) from [<c0178b54>] (do_filp_open+0x70/0xd4)
[ 8167.861548] [<c0178b54>] (do_filp_open) from [<c0168b0c>] (do_sys_open+0x118/0x1dc)
[ 8167.869174] [<c0168b0c>] (do_sys_open) from [<c0168bfc>] (SyS_open+0x2c/0x30)
[ 8167.876274] [<c0168bfc>] (SyS_open) from [<c0010820>] (ret_fast_syscall+0x0/0x3c)
[ 8230.435794] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8230.439990]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P2264
[ 8230.445964]  (detected by 1, t=16809 jiffies, g=214624, c=214623, q=40046)
[ 8230.452820] rsync           x c078689c     0  2264      0 0x00000004
[ 8230.459156] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8230.466175] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8230.473105] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8230.479603] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8230.487421] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8230.496259] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8230.504578] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8230.512811] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8230.520168] Exception stack(0xcf58db20 to 0xcf58db68)
[ 8230.525185] db20: 00000005 c0956314 00000002 cf58c000 dda7ed70 00000020 eeab2094 dd575228
[ 8230.533344] db40: 00000001 00000000 c0b6d830 cf58db8c 00000000 cf58db68 2da63000 c04d9324
[ 8230.541486] db60: 20030093 ffffffff
[ 8230.544948] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8230.553109] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8230.562122] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8230.570699] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8230.579193] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8230.587770] [<c0231e84>] (ext4_commit_super) from [<c0232378>] (__ext4_error_inode+0x84/0x150)
[ 8230.596349] [<c0232378>] (__ext4_error_inode) from [<c02200f0>] (ext4_find_entry+0x3b4/0x63c)
[ 8230.604838] [<c02200f0>] (ext4_find_entry) from [<c02203c0>] (ext4_lookup+0x48/0x1f0)
[ 8230.612637] [<c02203c0>] (ext4_lookup) from [<c0172bd0>] (lookup_real+0x30/0x5c)
[ 8230.620001] [<c0172bd0>] (lookup_real) from [<c01731f0>] (__lookup_hash+0x48/0x50)
[ 8230.627540] [<c01731f0>] (__lookup_hash) from [<c0175cd4>] (walk_component+0x1bc/0x2a0)
[ 8230.635513] [<c0175cd4>] (walk_component) from [<c0175f0c>] (link_path_walk+0x154/0x514)
[ 8230.643540] [<c0175f0c>] (link_path_walk) from [<c01768d4>] (path_openat+0x8c/0x1024)
[ 8230.651340] [<c01768d4>] (path_openat) from [<c0178b54>] (do_filp_open+0x70/0xd4)
[ 8230.658794] [<c0178b54>] (do_filp_open) from [<c0168b0c>] (do_sys_open+0x118/0x1dc)
[ 8230.666417] [<c0168b0c>] (do_sys_open) from [<c0168bfc>] (SyS_open+0x2c/0x30)
[ 8230.673523] [<c0168bfc>] (SyS_open) from [<c0010820>] (ret_fast_syscall+0x0/0x3c)
[ 8230.680972] rsync           x c078689c     0  2264      0 0x00000004
[ 8230.687294] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8230.694315] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8230.701247] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8230.707746] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8230.715548] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8230.724388] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8230.732706] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8230.740939] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8230.748302] Exception stack(0xcf58db20 to 0xcf58db68)
[ 8230.753324] db20: 00000005 c0956314 00000002 cf58c000 dda7ed70 00000020 eeab2094 dd575228
[ 8230.761475] db40: 00000001 00000000 c0b6d830 cf58db8c 00000000 cf58db68 2da63000 c04d9324
[ 8230.769619] db60: 20030093 ffffffff
[ 8230.773083] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8230.781234] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8230.790246] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8230.798825] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8230.807318] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8230.815896] [<c0231e84>] (ext4_commit_super) from [<c0232378>] (__ext4_error_inode+0x84/0x150)
[ 8230.824475] [<c0232378>] (__ext4_error_inode) from [<c02200f0>] (ext4_find_entry+0x3b4/0x63c)
[ 8230.832966] [<c02200f0>] (ext4_find_entry) from [<c02203c0>] (ext4_lookup+0x48/0x1f0)
[ 8230.840766] [<c02203c0>] (ext4_lookup) from [<c0172bd0>] (lookup_real+0x30/0x5c)
[ 8230.848129] [<c0172bd0>] (lookup_real) from [<c01731f0>] (__lookup_hash+0x48/0x50)
[ 8230.855669] [<c01731f0>] (__lookup_hash) from [<c0175cd4>] (walk_component+0x1bc/0x2a0)
[ 8230.863641] [<c0175cd4>] (walk_component) from [<c0175f0c>] (link_path_walk+0x154/0x514)
[ 8230.871700] [<c0175f0c>] (link_path_walk) from [<c01768d4>] (path_openat+0x8c/0x1024)
[ 8230.879499] [<c01768d4>] (path_openat) from [<c0178b54>] (do_filp_open+0x70/0xd4)
[ 8230.886951] [<c0178b54>] (do_filp_open) from [<c0168b0c>] (do_sys_open+0x118/0x1dc)
[ 8230.894576] [<c0168b0c>] (do_sys_open) from [<c0168bfc>] (SyS_open+0x2c/0x30)
[ 8230.901680] [<c0168bfc>] (SyS_open) from [<c0010820>] (ret_fast_syscall+0x0/0x3c)
[ 8293.461177] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 8293.465495]  Tasks blocked on level-0 rcu_node (CPUs 0-7): P2264
[ 8293.471424]  (detected by 6, t=29414 jiffies, g=214624, c=214623, q=69625)
[ 8293.478330] rsync           x c078689c     0  2264      0 0x00000004
[ 8293.484717] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8293.491725] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8293.498651] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8293.505144] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8293.512994] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8293.521836] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8293.530150] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8293.538395] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8293.545713] Exception stack(0xcf58db20 to 0xcf58db68)
[ 8293.550705] db20: 00000005 c0956314 00000002 cf58c000 dda7ed70 00000020 eeab2094 dd575228
[ 8293.558912] db40: 00000001 00000000 c0b6d830 cf58db8c 00000000 cf58db68 2da63000 c04d9324
[ 8293.567038] db60: 20030093 ffffffff
[ 8293.570562] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8293.578520] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8293.587535] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8293.596109] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8293.604605] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8293.613178] [<c0231e84>] (ext4_commit_super) from [<c0232378>] (__ext4_error_inode+0x84/0x150)
[ 8293.621759] [<c0232378>] (__ext4_error_inode) from [<c02200f0>] (ext4_find_entry+0x3b4/0x63c)
[ 8293.630247] [<c02200f0>] (ext4_find_entry) from [<c02203c0>] (ext4_lookup+0x48/0x1f0)
[ 8293.638048] [<c02203c0>] (ext4_lookup) from [<c0172bd0>] (lookup_real+0x30/0x5c)
[ 8293.645411] [<c0172bd0>] (lookup_real) from [<c01731f0>] (__lookup_hash+0x48/0x50)
[ 8293.652949] [<c01731f0>] (__lookup_hash) from [<c0175cd4>] (walk_component+0x1bc/0x2a0)
[ 8293.660922] [<c0175cd4>] (walk_component) from [<c0175f0c>] (link_path_walk+0x154/0x514)
[ 8293.668981] [<c0175f0c>] (link_path_walk) from [<c01768d4>] (path_openat+0x8c/0x1024)
[ 8293.676779] [<c01768d4>] (path_openat) from [<c0178b54>] (do_filp_open+0x70/0xd4)
[ 8293.684236] [<c0178b54>] (do_filp_open) from [<c0168b0c>] (do_sys_open+0x118/0x1dc)
[ 8293.691857] [<c0168b0c>] (do_sys_open) from [<c0168bfc>] (SyS_open+0x2c/0x30)
[ 8293.698958] [<c0168bfc>] (SyS_open) from [<c0010820>] (ret_fast_syscall+0x0/0x3c)
[ 8293.706411] rsync           x c078689c     0  2264      0 0x00000004
[ 8293.712725] [<c078689c>] (__schedule) from [<c0786db8>] (schedule+0x54/0xb4)
[ 8293.719749] [<c0786db8>] (schedule) from [<c0031660>] (do_exit+0x65c/0x9dc)
[ 8293.726672] [<c0031660>] (do_exit) from [<c0014b64>] (die+0x23c/0x300)
[ 8293.733172] [<c0014b64>] (die) from [<c0782b64>] (__do_kernel_fault.part.8+0x74/0x84)
[ 8293.740978] [<c0782b64>] (__do_kernel_fault.part.8) from [<c078cea0>] (do_page_fault+0x418/0x428)
[ 8293.749819] [<c078cea0>] (do_page_fault) from [<c078cf6c>] (do_translation_fault+0xbc/0xc0)
[ 8293.758135] [<c078cf6c>] (do_translation_fault) from [<c0009240>] (do_DataAbort+0x48/0xc4)
[ 8293.766370] [<c0009240>] (do_DataAbort) from [<c078c3d8>] (__dabt_svc+0x38/0x60)
[ 8293.773727] Exception stack(0xcf58db20 to 0xcf58db68)
[ 8293.778748] db20: 00000005 c0956314 00000002 cf58c000 dda7ed70 00000020 eeab2094 dd575228
[ 8293.786903] db40: 00000001 00000000 c0b6d830 cf58db8c 00000000 cf58db68 2da63000 c04d9324
[ 8293.795045] db60: 20030093 ffffffff
[ 8293.798507] [<c078c3d8>] (__dabt_svc) from [<c04d9324>] (__percpu_counter_add+0x38/0x10c)
[ 8293.806663] [<c04d9324>] (__percpu_counter_add) from [<c0114f24>] (account_page_dirtied+0xd0/0x208)
[ 8293.815676] [<c0114f24>] (account_page_dirtied) from [<c019d4b0>] (__set_page_dirty+0x68/0xc4)
[ 8293.824253] [<c019d4b0>] (__set_page_dirty) from [<c019d760>] (mark_buffer_dirty+0x164/0x17c)
[ 8293.832747] [<c019d760>] (mark_buffer_dirty) from [<c0231e84>] (ext4_commit_super+0x178/0x250)
[ 8293.841325] [<c0231e84>] (ext4_commit_super) from [<c0232378>] (__ext4_error_inode+0x84/0x150)
[ 8293.849903] [<c0232378>] (__ext4_error_inode) from [<c02200f0>] (ext4_find_entry+0x3b4/0x63c)
[ 8293.858394] [<c02200f0>] (ext4_find_entry) from [<c02203c0>] (ext4_lookup+0x48/0x1f0)
[ 8293.866196] [<c02203c0>] (ext4_lookup) from [<c0172bd0>] (lookup_real+0x30/0x5c)
[ 8293.873558] [<c0172bd0>] (lookup_real) from [<c01731f0>] (__lookup_hash+0x48/0x50)
[ 8293.881097] [<c01731f0>] (__lookup_hash) from [<c0175cd4>] (walk_component+0x1bc/0x2a0)
[ 8293.889070] [<c0175cd4>] (walk_component) from [<c0175f0c>] (link_path_walk+0x154/0x514)
[ 8293.897129] [<c0175f0c>] (link_path_walk) from [<c01768d4>] (path_openat+0x8c/0x1024)
[ 8293.904927] [<c01768d4>] (path_openat) from [<c0178b54>] (do_filp_open+0x70/0xd4)
[ 8293.912379] [<c0178b54>] (do_filp_open) from [<c0168b0c>] (do_sys_open+0x118/0x1dc)
[ 8293.920004] [<c0168b0c>] (do_sys_open) from [<c0168bfc>] (SyS_open+0x2c/0x30)
[ 8293.927104] [<c0168bfc>] (SyS_open) from [<c0010820>] (ret_fast_syscall+0x0/0x3c)

@qknight
Copy link
Author

qknight commented Dec 10, 2015

[root@xu4-nixi:/root]# uptime
 04:16am  up 1 day 11:14,  1 user,  load average: 0.10, 0.09, 0.06

since i've attached a new usb 3.0 disk at the usb 3.0 port it seems to be stable. maybe the usb 2.0 sata bridge is making the unstabilities?

@qknight
Copy link
Author

qknight commented Mar 24, 2016

here is another two of them, the

crash 0

#2 (comment)

[ 8145.005427] sd 0:0:0:0: [sda] UNKNOWN(0x2003) Result: hostbyte=0x01 driverbyte=0x00
[ 8145.005444] sd 0:0:0:0: [sda] CDB: opcode=0x28 28 00 03 25 c2 00 00 00 f0 00

crash 1

[198812.806554] sd 0:0:0:0: [sda] UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=0x00 
[198812.806604] sd 0:0:0:0: [sda] CDB: opcode=0x28 28 00 04 70 97 00 00 00 f0 00 

https://lastlog.de/misc/xu4-4.2.20-usb-kernel-issues.html

crash 2

[22108.670116] sd 0:0:0:0: [sda] UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

https://lastlog.de/misc/xu4-4.2.20-usb-kernel-issues1.html

https://lastlog.de/misc/xu4-4.2.20-usb-kernel-issues2.html
Bus 006 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. 
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 05e3:0616 Genesys Logic, Inc. 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 1058:0827 Western Digital Technologies, Inc. 
Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

@qknight
Copy link
Author

qknight commented Mar 24, 2016

and another one:

lsusb:

Bus 003 Device 005: ID 152d:2509 JMicron Technology Corp. / JMicron USA Technology Corp. JMS539 SuperSpeed SATA II 3.0G Bridge
[27436.297052] sd 0:0:0:0: [sda] UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=0x00
[27436.297120] sd 0:0:0:0: [sda] CDB: opcode=0x28 28 00 6f c0 87 10 00 00 08 00

hardkernel#120 (comment)

mhaehnel pushed a commit to mhaehnel/linux that referenced this issue Sep 6, 2016
This patch leverages 'struct pci_host_bridge' from the PCI subsystem
in order to free the pci_controller only after the last reference to
its devices is dropped (avoiding an oops in pcibios_release_device()
if the last reference is dropped after pcibios_free_controller()).

The patch relies on pci_host_bridge.release_fn() (and .release_data),
which is called automatically by the PCI subsystem when the root bus
is released (i.e., the last reference is dropped).  Those fields are
set via pci_set_host_bridge_release() (e.g. in the platform-specific
implementation of pcibios_root_bridge_prepare()).

It introduces the 'pcibios_free_controller_deferred()' .release_fn()
and it expects .release_data to hold a pointer to the pci_controller.

The function implictly calls 'pcibios_free_controller()', so an user
must *NOT* explicitly call it if using the new _deferred() callback.

The functionality is enabled for pseries (although it isn't platform
specific, and may be used by cxl).

Details on not-so-elegant design choices:

 - Use 'pci_host_bridge.release_data' field as pointer to associated
   'struct pci_controller' so *not* to 'pci_bus_to_host(bridge->bus)'
   in pcibios_free_controller_deferred().

   That's because pci_remove_root_bus() sets 'host_bridge->bus = NULL'
   (so, if the last reference is released after pci_remove_root_bus()
   runs, which eventually reaches pcibios_free_controller_deferred(),
   that would hit a null pointer dereference).

   The cxl/vphb.c code calls pci_remove_root_bus(), and the cxl folks
   are interested in this fix.

Test-case tobetter#1 (hold references)

  # ls -ld /sys/block/sd* | grep -m1 0021:01:00.0
  <...> /sys/block/sdaa -> ../devices/pci0021:01/0021:01:00.0/<...>

  # ls -ld /sys/block/sd* | grep -m1 0021:01:00.1
  <...> /sys/block/sdab -> ../devices/pci0021:01/0021:01:00.1/<...>

  # cat >/dev/sdaa & pid1=$!
  # cat >/dev/sdab & pid2=$!

  # drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r
  Validating PHB DLPAR capability...yes.
  [  594.306719] pci_hp_remove_devices: PCI: Removing devices on bus 0021:01
  [  594.306738] pci_hp_remove_devices:    Removing 0021:01:00.0...
  ...
  [  598.236381] pci_hp_remove_devices:    Removing 0021:01:00.1...
  ...
  [  611.972077] pci_bus 0021:01: busn_res: [bus 01-ff] is released
  [  611.972140] rpadlpar_io: slot PHB 33 removed

  # kill -9 $pid1
  # kill -9 $pid2
  [  632.918088] pcibios_free_controller_deferred: domain 33, dynamic 1

Test-case tobetter#2 (don't hold references)

  # drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r
  Validating PHB DLPAR capability...yes.
  [  916.357363] pci_hp_remove_devices: PCI: Removing devices on bus 0021:01
  [  916.357386] pci_hp_remove_devices:    Removing 0021:01:00.0...
  ...
  [  920.566527] pci_hp_remove_devices:    Removing 0021:01:00.1...
  ...
  [  933.955873] pci_bus 0021:01: busn_res: [bus 01-ff] is released
  [  933.955977] pcibios_free_controller_deferred: domain 33, dynamic 1
  [  933.955999] rpadlpar_io: slot PHB 33 removed

Suggested-By: Gavin Shan <[email protected]>
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
Reviewed-by: Gavin Shan <[email protected]>
Reviewed-by: Andrew Donnellan <[email protected]>
Tested-by: Andrew Donnellan <[email protected]> # cxl
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
mhaehnel pushed a commit to mhaehnel/linux that referenced this issue Sep 6, 2016
There are three usercopy warnings which are currently being silenced for
gcc 4.6 and newer:

1) "copy_from_user() buffer size is too small" compile warning/error

   This is a static warning which happens when object size and copy size
   are both const, and copy size > object size.  I didn't see any false
   positives for this one.  So the function warning attribute seems to
   be working fine here.

   Note this scenario is always a bug and so I think it should be
   changed to *always* be an error, regardless of
   CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.

2) "copy_from_user() buffer size is not provably correct" compile warning

   This is another static warning which happens when I enable
   __compiletime_object_size() for new compilers (and
   CONFIG_DEBUG_STRICT_USER_COPY_CHECKS).  It happens when object size
   is const, but copy size is *not*.  In this case there's no way to
   compare the two at build time, so it gives the warning.  (Note the
   warning is a byproduct of the fact that gcc has no way of knowing
   whether the overflow function will be called, so the call isn't dead
   code and the warning attribute is activated.)

   So this warning seems to only indicate "this is an unusual pattern,
   maybe you should check it out" rather than "this is a bug".

   I get 102(!) of these warnings with allyesconfig and the
   __compiletime_object_size() gcc check removed.  I don't know if there
   are any real bugs hiding in there, but from looking at a small
   sample, I didn't see any.  According to Kees, it does sometimes find
   real bugs.  But the false positive rate seems high.

3) "Buffer overflow detected" runtime warning

   This is a runtime warning where object size is const, and copy size >
   object size.

All three warnings (both static and runtime) were completely disabled
for gcc 4.6 with the following commit:

  2fb0815 ("gcc4: disable __compiletime_object_size for GCC 4.6+")

That commit mistakenly assumed that the false positives were caused by a
gcc bug in __compiletime_object_size().  But in fact,
__compiletime_object_size() seems to be working fine.  The false
positives were instead triggered by tobetter#2 above.  (Though I don't have an
explanation for why the warnings supposedly only started showing up in
gcc 4.6.)

So remove warning tobetter#2 to get rid of all the false positives, and re-enable
warnings tobetter#1 and tobetter#3 by reverting the above commit.

Furthermore, since tobetter#1 is a real bug which is detected at compile time,
upgrade it to always be an error.

Having done all that, CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is no longer
needed.

Signed-off-by: Josh Poimboeuf <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H . Peter Anvin" <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Byungchul Park <[email protected]>
Cc: Nilay Vaish <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mhaehnel pushed a commit to mhaehnel/linux that referenced this issue Sep 26, 2016
Every time, ocfs2_extend_trans() included a credit for truncate log
inode, but as that inode had been managed by jbd2 running transaction
first time, it will not consume that credit until
jbd2_journal_restart().

Since total credits to extend always included the un-consumed ones,
there will be more and more un-consumed credit, at last
jbd2_journal_restart() will fail due to credit number over the half of
max transction credit.

The following error was caught when unlinking a large file with many
extents:

  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 13626 at fs/jbd2/transaction.c:269 start_this_handle+0x4c3/0x510 [jbd2]()
  Modules linked in: ocfs2 nfsd lockd grace nfs_acl auth_rpcgss sunrpc autofs4 ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs sd_mod sg ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb4i cxgb4 cxgb3i libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ppdev xen_kbdfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea parport_pc parport pcspkr i2c_piix4 i2c_core acpi_cpufreq ext4 jbd2 mbcache xen_blkfront floppy pata_acpi ata_generic ata_piix dm_mirror dm_region_hash dm_log dm_mod
  CPU: 0 PID: 13626 Comm: unlink Tainted: G        W       4.1.12-37.6.3.el6uek.x86_64 tobetter#2
  Hardware name: Xen HVM domU, BIOS 4.4.4OVM 02/11/2016
  Call Trace:
    dump_stack+0x48/0x5c
    warn_slowpath_common+0x95/0xe0
    warn_slowpath_null+0x1a/0x20
    start_this_handle+0x4c3/0x510 [jbd2]
    jbd2__journal_restart+0x161/0x1b0 [jbd2]
    jbd2_journal_restart+0x13/0x20 [jbd2]
    ocfs2_extend_trans+0x74/0x220 [ocfs2]
    ocfs2_replay_truncate_records+0x93/0x360 [ocfs2]
    __ocfs2_flush_truncate_log+0x13e/0x3a0 [ocfs2]
    ocfs2_remove_btree_range+0x458/0x7f0 [ocfs2]
    ocfs2_commit_truncate+0x1b3/0x6f0 [ocfs2]
    ocfs2_truncate_for_delete+0xbd/0x380 [ocfs2]
    ocfs2_wipe_inode+0x136/0x6a0 [ocfs2]
    ocfs2_delete_inode+0x2a2/0x3e0 [ocfs2]
    ocfs2_evict_inode+0x28/0x60 [ocfs2]
    evict+0xab/0x1a0
    iput_final+0xf6/0x190
    iput+0xc8/0xe0
    do_unlinkat+0x1b7/0x310
    SyS_unlink+0x16/0x20
    system_call_fastpath+0x12/0x71
  ---[ end trace 28aa7410e69369cf ]---
  JBD2: unlink wants too many credits (251 > 128)

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Junxiao Bi <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mhaehnel pushed a commit to mhaehnel/linux that referenced this issue Sep 26, 2016
The root cause of this issue is the same with the one fixed by the last
patch, but this time credits for allocator inode and group descriptor
may not be consumed before trans extend.

The following error was caught:

  WARNING: CPU: 0 PID: 2037 at fs/jbd2/transaction.c:269 start_this_handle+0x4c3/0x510 [jbd2]()
  Modules linked in: ocfs2 nfsd lockd grace nfs_acl auth_rpcgss sunrpc autofs4 ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs sd_mod sg ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb4i cxgb4 cxgb3i libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ppdev xen_kbdfront fb_sys_fops sysimgblt sysfillrect syscopyarea xen_netfront parport_pc parport pcspkr i2c_piix4 i2c_core acpi_cpufreq ext4 jbd2 mbcache xen_blkfront floppy pata_acpi ata_generic ata_piix dm_mirror dm_region_hash dm_log dm_mod
  CPU: 0 PID: 2037 Comm: rm Tainted: G        W       4.1.12-37.6.3.el6uek.bug24573128v2.x86_64 tobetter#2
  Hardware name: Xen HVM domU, BIOS 4.4.4OVM 02/11/2016
  Call Trace:
    dump_stack+0x48/0x5c
    warn_slowpath_common+0x95/0xe0
    warn_slowpath_null+0x1a/0x20
    start_this_handle+0x4c3/0x510 [jbd2]
    jbd2__journal_restart+0x161/0x1b0 [jbd2]
    jbd2_journal_restart+0x13/0x20 [jbd2]
    ocfs2_extend_trans+0x74/0x220 [ocfs2]
    ocfs2_free_cached_blocks+0x16b/0x4e0 [ocfs2]
    ocfs2_run_deallocs+0x70/0x270 [ocfs2]
    ocfs2_commit_truncate+0x474/0x6f0 [ocfs2]
    ocfs2_truncate_for_delete+0xbd/0x380 [ocfs2]
    ocfs2_wipe_inode+0x136/0x6a0 [ocfs2]
    ocfs2_delete_inode+0x2a2/0x3e0 [ocfs2]
    ocfs2_evict_inode+0x28/0x60 [ocfs2]
    evict+0xab/0x1a0
    iput_final+0xf6/0x190
    iput+0xc8/0xe0
    do_unlinkat+0x1b7/0x310
    SyS_unlinkat+0x22/0x40
    system_call_fastpath+0x12/0x71
  ---[ end trace a62437cb060baa71 ]---
  JBD2: rm wants too many credits (149 > 128)

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Junxiao Bi <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mhaehnel pushed a commit to mhaehnel/linux that referenced this issue Sep 26, 2016
Since commit 4d4c474 ("perf/x86/intel/bts: Fix BTS PMI detection")
my box goes boom on boot:

| .... node  #0, CPUs:      tobetter#1 tobetter#2 tobetter#3 tobetter#4 tobetter#5 tobetter#6 tobetter#7
| BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
| IP: [<ffffffff8100c463>] intel_bts_interrupt+0x43/0x130
| Call Trace:
|  <NMI> d [<ffffffff8100b341>] intel_pmu_handle_irq+0x51/0x4b0
|  [<ffffffff81004d47>] perf_event_nmi_handler+0x27/0x40

This happens because the code introduced in this commit dereferences the
debug store pointer unconditionally. The debug store is not guaranteed to
be available, so a NULL pointer check as on other places is required.

Fixes: 4d4c474 ("perf/x86/intel/bts: Fix BTS PMI detection")
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Reviewed-by: Alexander Shishkin <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
mhaehnel pushed a commit to mhaehnel/linux that referenced this issue Sep 26, 2016
In the mipsr2_decoder() function, used to emulate pre-MIPSr6
instructions that were removed in MIPSr6, the init_fpu() function is
called if a removed pre-MIPSr6 floating point instruction is the first
floating point instruction used by the task. However, init_fpu()
performs varous actions that rely upon not being migrated. For example
in the most basic case it sets the coprocessor 0 Status.CU1 bit to
enable the FPU & then loads FP register context into the FPU registers.
If the task were to migrate during this time, it may end up attempting
to load FP register context on a different CPU where it hasn't set the
CU1 bit, leading to errors such as:

    do_cpu invoked from kernel context![tobetter#2]:
    CPU: 2 PID: 7338 Comm: fp-prctl Tainted: G      D         4.7.0-00424-g49b0c82 tobetter#2
    task: 838e4000 ti: 88d38000 task.ti: 88d38000
    $ 0   : 00000000 00000001 ffffffff 88d3fef8
    $ 4   : 838e4000 88d38004 00000000 00000001
    $ 8   : 3400fc01 801f8020 808e9100 24000000
    $12   : dbffffff 807b69d8 807b0000 00000000
    $16   : 00000000 80786150 00400fc4 809c0398
    $20   : 809c0338 0040273c 88d3ff28 808e9d30
    $24   : 808e9d30 00400fb4
    $28   : 88d38000 88d3fe88 00000000 8011a2ac
    Hi    : 0040273c
    Lo    : 88d3ff28
    epc   : 80114178 _restore_fp+0x10/0xa0
    ra    : 8011a2ac mipsr2_decoder+0xd5c/0x1660
    Status: 1400fc03	KERNEL EXL IE
    Cause : 1080002c (ExcCode 0b)
    PrId  : 0001a920 (MIPS I6400)
    Modules linked in:
    Process fp-prctl (pid: 7338, threadinfo=88d38000, task=838e4000, tls=766527d0)
    Stack : 00000000 00000000 00000000 88d3fe98 00000000 00000000 809c0398 809c0338
    	  808e9100 00000000 88d3ff28 00400fc4 00400fc4 0040273c 7fb69e18 004a0000
    	  004a0000 004a0000 7664add 8010de18 00000000 00000000 88d3fef8 88d3ff28
    	  808e9100 00000000 766527d0 8010e534 000c0000 85755000 8181d580 00000000
    	  00000000 00000000 004a0000 00000000 766527d0 7fb69e18 004a0000 80105c20
    	  ...
    Call Trace:
    [<80114178>] _restore_fp+0x10/0xa0
    [<8011a2ac>] mipsr2_decoder+0xd5c/0x1660
    [<8010de18>] do_ri+0x90/0x6b8
    [<80105c20>] ret_from_exception+0x0/0x10

Fix this by disabling preemption around the call to init_fpu(), ensuring
that it starts & completes on one CPU.

Signed-off-by: Paul Burton <[email protected]>
Fixes: b0a668f ("MIPS: kernel: mips-r2-to-r6-emul: Add R2 emulator for MIPS R6")
Cc: [email protected]
Cc: [email protected] # v4.0+
Patchwork: https://patchwork.linux-mips.org/patch/14305/
Signed-off-by: Ralf Baechle <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit bd975d1 upstream.

The secmech hmac(md5) structures are present in the TCP_Server_Info
struct and can be shared among multiple CIFS sessions.  However, the
server mutex is not currently held when these structures are allocated
and used, which can lead to a kernel crashes, as in the scenario below:

mount.cifs(8) tobetter#1				mount.cifs(8) tobetter#2

Is secmech.sdeschmaccmd5 allocated?
// false

						Is secmech.sdeschmaccmd5 allocated?
						// false

secmech.hmacmd = crypto_alloc_shash..
secmech.sdeschmaccmd5 = kzalloc..
sdeschmaccmd5->shash.tfm = &secmec.hmacmd;

						secmech.sdeschmaccmd5 = kzalloc
						// sdeschmaccmd5->shash.tfm
						// not yet assigned

crypto_shash_update()
 deref NULL sdeschmaccmd5->shash.tfm

 Unable to handle kernel paging request at virtual address 00000030
 epc   : 8027ba34 crypto_shash_update+0x38/0x158
 ra    : 8020f2e8 setup_ntlmv2_rsp+0x4bc/0xa84
 Call Trace:
  crypto_shash_update+0x38/0x158
  setup_ntlmv2_rsp+0x4bc/0xa84
  build_ntlmssp_auth_blob+0xbc/0x34c
  sess_auth_rawntlmssp_authenticate+0xac/0x248
  CIFS_SessSetup+0xf0/0x178
  cifs_setup_session+0x4c/0x84
  cifs_get_smb_ses+0x2c8/0x314
  cifs_mount+0x38c/0x76c
  cifs_do_mount+0x98/0x440
  mount_fs+0x20/0xc0
  vfs_kern_mount+0x58/0x138
  do_mount+0x1e8/0xccc
  SyS_mount+0x88/0xd4
  syscall_common+0x30/0x54

Fix this by locking the srv_mutex around the code which uses these
hmac(md5) structures.  All the other secmech algos already have similar
locking.

Fixes: 95dc8dd ("Limit allocation of crypto mechanisms to dialect which requires")
Signed-off-by: Rabin Vincent <[email protected]>
Acked-by: Sachin Prabhu <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit 6039892 upstream.

With debugobjects enabled and using SLAB_DESTROY_BY_RCU, when a
kmem_cache_node is destroyed the call_rcu() may trigger a slab
allocation to fill the debug object pool (__debug_object_init:fill_pool).

Everywhere but during kmem_cache_destroy(), discard_slab() is performed
outside of the kmem_cache_node->list_lock and avoids a lockdep warning
about potential recursion:

  =============================================
  [ INFO: possible recursive locking detected ]
  4.8.0-rc1-gfxbench+ tobetter#1 Tainted: G     U
  ---------------------------------------------
  rmmod/8895 is trying to acquire lock:
   (&(&n->list_lock)->rlock){-.-...}, at: [<ffffffff811c80d7>] get_partial_node.isra.63+0x47/0x430

  but task is already holding lock:
   (&(&n->list_lock)->rlock){-.-...}, at: [<ffffffff811cbda4>] __kmem_cache_shutdown+0x54/0x320

  other info that might help us debug this:
  Possible unsafe locking scenario:
        CPU0
        ----
   lock(&(&n->list_lock)->rlock);
   lock(&(&n->list_lock)->rlock);

   *** DEADLOCK ***
   May be due to missing lock nesting notation
   5 locks held by rmmod/8895:
   #0:  (&dev->mutex){......}, at: driver_detach+0x42/0xc0
   tobetter#1:  (&dev->mutex){......}, at: driver_detach+0x50/0xc0
   tobetter#2:  (cpu_hotplug.dep_map){++++++}, at: get_online_cpus+0x2d/0x80
   tobetter#3:  (slab_mutex){+.+.+.}, at: kmem_cache_destroy+0x3c/0x220
   tobetter#4:  (&(&n->list_lock)->rlock){-.-...}, at: __kmem_cache_shutdown+0x54/0x320

  stack backtrace:
  CPU: 6 PID: 8895 Comm: rmmod Tainted: G     U          4.8.0-rc1-gfxbench+ tobetter#1
  Hardware name: Gigabyte Technology Co., Ltd. H87M-D3H/H87M-D3H, BIOS F11 08/18/2015
  Call Trace:
    __lock_acquire+0x1646/0x1ad0
    lock_acquire+0xb2/0x200
    _raw_spin_lock+0x36/0x50
    get_partial_node.isra.63+0x47/0x430
    ___slab_alloc.constprop.67+0x1a7/0x3b0
    __slab_alloc.isra.64.constprop.66+0x43/0x80
    kmem_cache_alloc+0x236/0x2d0
    __debug_object_init+0x2de/0x400
    debug_object_activate+0x109/0x1e0
    __call_rcu.constprop.63+0x32/0x2f0
    call_rcu+0x12/0x20
    discard_slab+0x3d/0x40
    __kmem_cache_shutdown+0xdb/0x320
    shutdown_cache+0x19/0x60
    kmem_cache_destroy+0x1ae/0x220
    i915_gem_load_cleanup+0x14/0x40 [i915]
    i915_driver_unload+0x151/0x180 [i915]
    i915_pci_remove+0x14/0x20 [i915]
    pci_device_remove+0x34/0xb0
    __device_release_driver+0x95/0x140
    driver_detach+0xb6/0xc0
    bus_remove_driver+0x53/0xd0
    driver_unregister+0x27/0x50
    pci_unregister_driver+0x25/0x70
    i915_exit+0x1a/0x1e2 [i915]
    SyS_delete_module+0x193/0x1f0
    entry_SYSCALL_64_fastpath+0x1c/0xac

Fixes: 52b4b95 ("mm: slab: free kmem_cache_node after destroy sysfs file")
Link: http://lkml.kernel.org/r/[email protected]
Reported-by: Dave Gordon <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Vladimir Davydov <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Dmitry Safonov <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Dave Gordon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit adc8a43 upstream.

Done, because line6_stream_stop() locks and calls line6_unlink_audio_urbs(),
which in turn invokes audio_out_callback(), which tries to lock 2nd time.

Fixes:

=============================================
[ INFO: possible recursive locking detected ]
4.4.15+ tobetter#15 Not tainted
---------------------------------------------
mplayer/3591 is trying to acquire lock:
 (&(&line6pcm->out.lock)->rlock){-.-...}, at: [<bfa27655>] audio_out_callback+0x70/0x110 [snd_usb_line6]

but task is already holding lock:
 (&(&line6pcm->out.lock)->rlock){-.-...}, at: [<bfa26aad>] line6_stream_stop+0x24/0x5c [snd_usb_line6]

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(&line6pcm->out.lock)->rlock);
  lock(&(&line6pcm->out.lock)->rlock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by mplayer/3591:
 #0:  (snd_pcm_link_rwlock){.-.-..}, at: [<bf8d49a7>] snd_pcm_stream_lock+0x1e/0x40 [snd_pcm]
 tobetter#1:  (&(&substream->self_group.lock)->rlock){-.-...}, at: [<bf8d49af>] snd_pcm_stream_lock+0x26/0x40 [snd_pcm]
 tobetter#2:  (&(&line6pcm->out.lock)->rlock){-.-...}, at: [<bfa26aad>] line6_stream_stop+0x24/0x5c [snd_usb_line6]

stack backtrace:
CPU: 0 PID: 3591 Comm: mplayer Not tainted 4.4.15+ tobetter#15
Hardware name: Generic AM33XX (Flattened Device Tree)
[<c0015d85>] (unwind_backtrace) from [<c001253d>] (show_stack+0x11/0x14)
[<c001253d>] (show_stack) from [<c02f1bdf>] (dump_stack+0x8b/0xac)
[<c02f1bdf>] (dump_stack) from [<c0076f43>] (__lock_acquire+0xc8b/0x1780)
[<c0076f43>] (__lock_acquire) from [<c007810d>] (lock_acquire+0x99/0x1c0)
[<c007810d>] (lock_acquire) from [<c06171e7>] (_raw_spin_lock_irqsave+0x3f/0x4c)
[<c06171e7>] (_raw_spin_lock_irqsave) from [<bfa27655>] (audio_out_callback+0x70/0x110 [snd_usb_line6])
[<bfa27655>] (audio_out_callback [snd_usb_line6]) from [<c04294db>] (__usb_hcd_giveback_urb+0x53/0xd0)
[<c04294db>] (__usb_hcd_giveback_urb) from [<c046388d>] (musb_giveback+0x3d/0x98)
[<c046388d>] (musb_giveback) from [<c04647f5>] (musb_urb_dequeue+0x6d/0x114)
[<c04647f5>] (musb_urb_dequeue) from [<c042ac11>] (usb_hcd_unlink_urb+0x39/0x98)
[<c042ac11>] (usb_hcd_unlink_urb) from [<bfa26a87>] (line6_unlink_audio_urbs+0x6a/0x6c [snd_usb_line6])
[<bfa26a87>] (line6_unlink_audio_urbs [snd_usb_line6]) from [<bfa26acb>] (line6_stream_stop+0x42/0x5c [snd_usb_line6])
[<bfa26acb>] (line6_stream_stop [snd_usb_line6]) from [<bfa26fe7>] (snd_line6_trigger+0xb6/0xf4 [snd_usb_line6])
[<bfa26fe7>] (snd_line6_trigger [snd_usb_line6]) from [<bf8d47b7>] (snd_pcm_do_stop+0x36/0x38 [snd_pcm])
[<bf8d47b7>] (snd_pcm_do_stop [snd_pcm]) from [<bf8d462f>] (snd_pcm_action_single+0x22/0x40 [snd_pcm])
[<bf8d462f>] (snd_pcm_action_single [snd_pcm]) from [<bf8d46f9>] (snd_pcm_action+0xac/0xb0 [snd_pcm])
[<bf8d46f9>] (snd_pcm_action [snd_pcm]) from [<bf8d4b61>] (snd_pcm_drop+0x38/0x64 [snd_pcm])
[<bf8d4b61>] (snd_pcm_drop [snd_pcm]) from [<bf8d6233>] (snd_pcm_common_ioctl1+0x7fe/0xbe8 [snd_pcm])
[<bf8d6233>] (snd_pcm_common_ioctl1 [snd_pcm]) from [<bf8d6779>] (snd_pcm_playback_ioctl1+0x15c/0x51c [snd_pcm])
[<bf8d6779>] (snd_pcm_playback_ioctl1 [snd_pcm]) from [<bf8d6b59>] (snd_pcm_playback_ioctl+0x20/0x28 [snd_pcm])
[<bf8d6b59>] (snd_pcm_playback_ioctl [snd_pcm]) from [<c016714b>] (do_vfs_ioctl+0x3af/0x5c8)

Fixes: 63e20df ('ALSA: line6: Reorganize PCM stream handling')
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Andrej Krutak <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit c62fb26 upstream.

The qp init function does a kzalloc() while holding the RCU
lock that encounters the following warning with a debug kernel
when a cat of the qp_stats is done:

[  231.723948] rcu_scheduler_active = 1, debug_locks = 0
[  231.731939] 3 locks held by cat/11355:
[  231.736492]  #0:  (debugfs_srcu){......}, at: [<ffffffff813001a5>] debugfs_use_file_start+0x5/0x90
[  231.746955]  tobetter#1:  (&p->lock){+.+.+.}, at: [<ffffffff81289a6c>] seq_read+0x4c/0x3c0
[  231.755873]  tobetter#2:  (rcu_read_lock){......}, at: [<ffffffffa0a0c535>] _qp_stats_seq_start+0x5/0xd0 [hfi1]
[  231.766862]

The init functions do an implicit next which requires the rcu read lock
before the kzalloc().

Fix for both drivers is to change the scope of the init function to only
do the allocation and the initialization of the just allocated iter.

The implict next is moved back into the respective start functions to fix
the issue.

Signed-off-by: Ira Weiny <[email protected]>
Signed-off-by: Mike Marciniszyn <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit 7e95630 upstream.

In the mipsr2_decoder() function, used to emulate pre-MIPSr6
instructions that were removed in MIPSr6, the init_fpu() function is
called if a removed pre-MIPSr6 floating point instruction is the first
floating point instruction used by the task. However, init_fpu()
performs varous actions that rely upon not being migrated. For example
in the most basic case it sets the coprocessor 0 Status.CU1 bit to
enable the FPU & then loads FP register context into the FPU registers.
If the task were to migrate during this time, it may end up attempting
to load FP register context on a different CPU where it hasn't set the
CU1 bit, leading to errors such as:

    do_cpu invoked from kernel context![tobetter#2]:
    CPU: 2 PID: 7338 Comm: fp-prctl Tainted: G      D         4.7.0-00424-g49b0c82 tobetter#2
    task: 838e4000 ti: 88d38000 task.ti: 88d38000
    $ 0   : 00000000 00000001 ffffffff 88d3fef8
    $ 4   : 838e4000 88d38004 00000000 00000001
    $ 8   : 3400fc01 801f8020 808e9100 24000000
    $12   : dbffffff 807b69d8 807b0000 00000000
    $16   : 00000000 80786150 00400fc4 809c0398
    $20   : 809c0338 0040273c 88d3ff28 808e9d30
    $24   : 808e9d30 00400fb4
    $28   : 88d38000 88d3fe88 00000000 8011a2ac
    Hi    : 0040273c
    Lo    : 88d3ff28
    epc   : 80114178 _restore_fp+0x10/0xa0
    ra    : 8011a2ac mipsr2_decoder+0xd5c/0x1660
    Status: 1400fc03	KERNEL EXL IE
    Cause : 1080002c (ExcCode 0b)
    PrId  : 0001a920 (MIPS I6400)
    Modules linked in:
    Process fp-prctl (pid: 7338, threadinfo=88d38000, task=838e4000, tls=766527d0)
    Stack : 00000000 00000000 00000000 88d3fe98 00000000 00000000 809c0398 809c0338
    	  808e9100 00000000 88d3ff28 00400fc4 00400fc4 0040273c 7fb69e18 004a0000
    	  004a0000 004a0000 7664add 8010de18 00000000 00000000 88d3fef8 88d3ff28
    	  808e9100 00000000 766527d0 8010e534 000c0000 85755000 8181d580 00000000
    	  00000000 00000000 004a0000 00000000 766527d0 7fb69e18 004a0000 80105c20
    	  ...
    Call Trace:
    [<80114178>] _restore_fp+0x10/0xa0
    [<8011a2ac>] mipsr2_decoder+0xd5c/0x1660
    [<8010de18>] do_ri+0x90/0x6b8
    [<80105c20>] ret_from_exception+0x0/0x10

Fix this by disabling preemption around the call to init_fpu(), ensuring
that it starts & completes on one CPU.

Signed-off-by: Paul Burton <[email protected]>
Fixes: b0a668f ("MIPS: kernel: mips-r2-to-r6-emul: Add R2 emulator for MIPS R6")
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/14305/
Signed-off-by: Ralf Baechle <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit 61dc0a4 upstream.

pm_runtime_get_sync does return a error value that must be checked for
error conditions, else, due to various reasons, the device maynot be
enabled and the system will crash due to lack of clock to the hardware
module.

Before:
12.562784] [00000000] *pgd=fe193835
12.562792] Internal error: : 1406 [tobetter#1] SMP ARM
[...]
12.562864] CPU: 1 PID: 241 Comm: modprobe Not tainted 4.7.0-rc4-next-20160624 tobetter#2
12.562867] Hardware name: Generic DRA74X (Flattened Device Tree)
12.562872] task: ed51f140 ti: ed44c000 task.ti: ed44c000
12.562886] PC is at omap4_rng_init+0x20/0x84 [omap_rng]
12.562899] LR is at set_current_rng+0xc0/0x154 [rng_core]
[...]

After the proper checks:
[   94.366705] omap_rng 48090000.rng: _od_fail_runtime_resume: FIXME:
missing hwmod/omap_dev info
[   94.375767] omap_rng 48090000.rng: Failed to runtime_get device -19
[   94.382351] omap_rng 48090000.rng: initialization failed.

Fixes: 665d92f ("hwrng: OMAP: convert to use runtime PM")
Cc: Paul Walmsley <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit 2dd9c11 upstream.

This patch leverages 'struct pci_host_bridge' from the PCI subsystem
in order to free the pci_controller only after the last reference to
its devices is dropped (avoiding an oops in pcibios_release_device()
if the last reference is dropped after pcibios_free_controller()).

The patch relies on pci_host_bridge.release_fn() (and .release_data),
which is called automatically by the PCI subsystem when the root bus
is released (i.e., the last reference is dropped).  Those fields are
set via pci_set_host_bridge_release() (e.g. in the platform-specific
implementation of pcibios_root_bridge_prepare()).

It introduces the 'pcibios_free_controller_deferred()' .release_fn()
and it expects .release_data to hold a pointer to the pci_controller.

The function implictly calls 'pcibios_free_controller()', so an user
must *NOT* explicitly call it if using the new _deferred() callback.

The functionality is enabled for pseries (although it isn't platform
specific, and may be used by cxl).

Details on not-so-elegant design choices:

 - Use 'pci_host_bridge.release_data' field as pointer to associated
   'struct pci_controller' so *not* to 'pci_bus_to_host(bridge->bus)'
   in pcibios_free_controller_deferred().

   That's because pci_remove_root_bus() sets 'host_bridge->bus = NULL'
   (so, if the last reference is released after pci_remove_root_bus()
   runs, which eventually reaches pcibios_free_controller_deferred(),
   that would hit a null pointer dereference).

   The cxl/vphb.c code calls pci_remove_root_bus(), and the cxl folks
   are interested in this fix.

Test-case tobetter#1 (hold references)

  # ls -ld /sys/block/sd* | grep -m1 0021:01:00.0
  <...> /sys/block/sdaa -> ../devices/pci0021:01/0021:01:00.0/<...>

  # ls -ld /sys/block/sd* | grep -m1 0021:01:00.1
  <...> /sys/block/sdab -> ../devices/pci0021:01/0021:01:00.1/<...>

  # cat >/dev/sdaa & pid1=$!
  # cat >/dev/sdab & pid2=$!

  # drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r
  Validating PHB DLPAR capability...yes.
  [  594.306719] pci_hp_remove_devices: PCI: Removing devices on bus 0021:01
  [  594.306738] pci_hp_remove_devices:    Removing 0021:01:00.0...
  ...
  [  598.236381] pci_hp_remove_devices:    Removing 0021:01:00.1...
  ...
  [  611.972077] pci_bus 0021:01: busn_res: [bus 01-ff] is released
  [  611.972140] rpadlpar_io: slot PHB 33 removed

  # kill -9 $pid1
  # kill -9 $pid2
  [  632.918088] pcibios_free_controller_deferred: domain 33, dynamic 1

Test-case tobetter#2 (don't hold references)

  # drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r
  Validating PHB DLPAR capability...yes.
  [  916.357363] pci_hp_remove_devices: PCI: Removing devices on bus 0021:01
  [  916.357386] pci_hp_remove_devices:    Removing 0021:01:00.0...
  ...
  [  920.566527] pci_hp_remove_devices:    Removing 0021:01:00.1...
  ...
  [  933.955873] pci_bus 0021:01: busn_res: [bus 01-ff] is released
  [  933.955977] pcibios_free_controller_deferred: domain 33, dynamic 1
  [  933.955999] rpadlpar_io: slot PHB 33 removed

Suggested-By: Gavin Shan <[email protected]>
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
Reviewed-by: Gavin Shan <[email protected]>
Reviewed-by: Andrew Donnellan <[email protected]>
Tested-by: Andrew Donnellan <[email protected]> # cxl
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
commit 420902c upstream.

If we hold the superblock lock while calling reiserfs_quota_on_mount(), we can
deadlock our own worker - mount blocks kworker/3:2, sleeps forever more.

crash> ps|grep UN
    715      2   3  ffff880220734d30  UN   0.0       0      0  [kworker/3:2]
   9369   9341   2  ffff88021ffb7560  UN   1.3  493404 123184  Xorg
   9665   9664   3  ffff880225b92ab0  UN   0.0   47368    812  udisks-daemon
  10635  10403   3  ffff880222f22c70  UN   0.0   14904    936  mount
crash> bt ffff880220734d30
PID: 715    TASK: ffff880220734d30  CPU: 3   COMMAND: "kworker/3:2"
 #0 [ffff8802244c3c20] schedule at ffffffff8144584b
 tobetter#1 [ffff8802244c3cc8] __rt_mutex_slowlock at ffffffff814472b3
 tobetter#2 [ffff8802244c3d28] rt_mutex_slowlock at ffffffff814473f5
 tobetter#3 [ffff8802244c3dc8] reiserfs_write_lock at ffffffffa05f28fd [reiserfs]
 tobetter#4 [ffff8802244c3de8] flush_async_commits at ffffffffa05ec91d [reiserfs]
 tobetter#5 [ffff8802244c3e08] process_one_work at ffffffff81073726
 tobetter#6 [ffff8802244c3e68] worker_thread at ffffffff81073eba
 tobetter#7 [ffff8802244c3ec8] kthread at ffffffff810782e0
 tobetter#8 [ffff8802244c3f48] kernel_thread_helper at ffffffff81450064
crash> rd ffff8802244c3cc8 10
ffff8802244c3cc8:  ffffffff814472b3 ffff880222f23250   .rD.....P2."....
ffff8802244c3cd8:  0000000000000000 0000000000000286   ................
ffff8802244c3ce8:  ffff8802244c3d30 ffff880220734d80   0=L$.....Ms ....
ffff8802244c3cf8:  ffff880222e8f628 0000000000000000   (.."............
ffff8802244c3d08:  0000000000000000 0000000000000002   ................
crash> struct rt_mutex ffff880222e8f628
struct rt_mutex {
  wait_lock = {
    raw_lock = {
      slock = 65537
    }
  },
  wait_list = {
    node_list = {
      next = 0xffff8802244c3d48,
      prev = 0xffff8802244c3d48
    }
  },
  owner = 0xffff880222f22c71,
  save_state = 0
}
crash> bt 0xffff880222f22c70
PID: 10635  TASK: ffff880222f22c70  CPU: 3   COMMAND: "mount"
 #0 [ffff8802216a9868] schedule at ffffffff8144584b
 tobetter#1 [ffff8802216a9910] schedule_timeout at ffffffff81446865
 tobetter#2 [ffff8802216a99a0] wait_for_common at ffffffff81445f74
 tobetter#3 [ffff8802216a9a30] flush_work at ffffffff810712d3
 tobetter#4 [ffff8802216a9ab0] schedule_on_each_cpu at ffffffff81074463
 tobetter#5 [ffff8802216a9ae0] invalidate_bdev at ffffffff81178aba
 tobetter#6 [ffff8802216a9af0] vfs_load_quota_inode at ffffffff811a3632
 tobetter#7 [ffff8802216a9b50] dquot_quota_on_mount at ffffffff811a375c
 tobetter#8 [ffff8802216a9b80] finish_unfinished at ffffffffa05dd8b0 [reiserfs]
 tobetter#9 [ffff8802216a9cc0] reiserfs_fill_super at ffffffffa05de825 [reiserfs]
    RIP: 00007f7b9303997a  RSP: 00007ffff443c7a8  RFLAGS: 00010202
    RAX: 00000000000000a5  RBX: ffffffff8144ef12  RCX: 00007f7b932e9ee0
    RDX: 00007f7b93d9a400  RSI: 00007f7b93d9a3e0  RDI: 00007f7b93d9a3c0
    RBP: 00007f7b93d9a2c0   R8: 00007f7b93d9a550   R9: 0000000000000001
    R10: ffffffffc0ed040e  R11: 0000000000000202  R12: 000000000000040e
    R13: 0000000000000000  R14: 00000000c0ed040e  R15: 00007ffff443ca20
    ORIG_RAX: 00000000000000a5  CS: 0033  SS: 002b

Signed-off-by: Mike Galbraith <[email protected]>
Acked-by: Frederic Weisbecker <[email protected]>
Acked-by: Mike Galbraith <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
bkrepo pushed a commit to bkrepo/linux that referenced this issue Oct 28, 2016
…etter#2]

commit a818101 upstream.

An NULL-pointer dereference happens in cachefiles_mark_object_inactive()
when it tries to read i_blocks so that it can tell the cachefilesd daemon
how much space it's making available.

The problem is that cachefiles_drop_object() calls
cachefiles_mark_object_inactive() after calling cachefiles_delete_object()
because the object being marked active staves off attempts to (re-)use the
file at that filename until after it has been deleted.  This means that
d_inode is NULL by the time we come to try to access it.

To fix the problem, have the caller of cachefiles_mark_object_inactive()
supply the number of blocks freed up.

Without this, the following oops may occur:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000098
IP: [<ffffffffa06c5cc1>] cachefiles_mark_object_inactive+0x61/0xb0 [cachefiles]
...
CPU: 11 PID: 527 Comm: kworker/u64:4 Tainted: G          I    ------------   3.10.0-470.el7.x86_64 tobetter#1
Hardware name: Hewlett-Packard HP Z600 Workstation/0B54h, BIOS 786G4 v03.19 03/11/2011
Workqueue: fscache_object fscache_object_work_func [fscache]
task: ffff880035edaf10 ti: ffff8800b77c0000 task.ti: ffff8800b77c0000
RIP: 0010:[<ffffffffa06c5cc1>] cachefiles_mark_object_inactive+0x61/0xb0 [cachefiles]
RSP: 0018:ffff8800b77c3d70  EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8800bf6cc400 RCX: 0000000000000034
RDX: 0000000000000000 RSI: ffff880090ffc710 RDI: ffff8800bf761ef8
RBP: ffff8800b77c3d88 R08: 2000000000000000 R09: 0090ffc710000000
R10: ff51005d2ff1c400 R11: 0000000000000000 R12: ffff880090ffc600
R13: ffff8800bf6cc520 R14: ffff8800bf6cc400 R15: ffff8800bf6cc498
FS:  0000000000000000(0000) GS:ffff8800bb8c0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000098 CR3: 00000000019ba000 CR4: 00000000000007e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Stack:
 ffff880090ffc600 ffff8800bf6cc400 ffff8800867df140 ffff8800b77c3db0
 ffffffffa06c48cb ffff880090ffc600 ffff880090ffc180 ffff880090ffc658
 ffff8800b77c3df0 ffffffffa085d846 ffff8800a96b8150 ffff880090ffc600
Call Trace:
 [<ffffffffa06c48cb>] cachefiles_drop_object+0x6b/0xf0 [cachefiles]
 [<ffffffffa085d846>] fscache_drop_object+0xd6/0x1e0 [fscache]
 [<ffffffffa085d615>] fscache_object_work_func+0xa5/0x200 [fscache]
 [<ffffffff810a605b>] process_one_work+0x17b/0x470
 [<ffffffff810a6e96>] worker_thread+0x126/0x410
 [<ffffffff810a6d70>] ? rescuer_thread+0x460/0x460
 [<ffffffff810ae64f>] kthread+0xcf/0xe0
 [<ffffffff810ae580>] ? kthread_create_on_node+0x140/0x140
 [<ffffffff81695418>] ret_from_fork+0x58/0x90
 [<ffffffff810ae580>] ? kthread_create_on_node+0x140/0x140

The oopsing code shows:

	callq  0xffffffff810af6a0 <wake_up_bit>
	mov    0xf8(%r12),%rax
	mov    0x30(%rax),%rax
	mov    0x98(%rax),%rax   <---- oops here
	lock add %rax,0x130(%rbx)

where this is:

	d_backing_inode(object->dentry)->i_blocks

Fixes: a5b3a80 (CacheFiles: Provide read-and-reset release counters for cachefilesd)
Reported-by: Jianhong Yin <[email protected]>
Signed-off-by: David Howells <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Reviewed-by: Steve Dickson <[email protected]>
Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue Oct 16, 2017
…p state

Driver calls request_firmware() whenever the device is opened for the
first time. As the device gets opened and closed, dev->num_inst == 1
is true several times. This is not necessary since the firmware is saved
in the fw_buf. s5p_mfc_load_firmware() copies the buffer returned by
the request_firmware() to dev->fw_buf.

fw_buf sticks around until it gets released from s5p_mfc_remove(), hence
there is no need to keep requesting firmware and copying it to fw_buf.

This might have been overlooked when changes are made to free fw_buf from
the device release interface s5p_mfc_release().

Fix s5p_mfc_load_firmware() to call request_firmware() once and keep state.
Change _probe() to load firmware once fw_buf has been allocated.

s5p_mfc_open() and it continues to call s5p_mfc_load_firmware() and init
hardware which is the step where firmware is written to the device.

This addresses the mfc_mutex contention due to repeated request_firmware()
calls from open() in the following circular locking warning:

[  552.194115] qtdemux0:sink/2710 is trying to acquire lock:
[  552.199488]  (&dev->mfc_mutex){+.+.}, at: [<bf145544>] s5p_mfc_mmap+0x28/0xd4 [s5p_mfc]
[  552.207459]
               but task is already holding lock:
[  552.213264]  (&mm->mmap_sem){++++}, at: [<c01df2e4>] vm_mmap_pgoff+0x44/0xb8
[  552.220284]
               which lock already depends on the new lock.

[  552.228429]
               the existing dependency chain (in reverse order) is:
[  552.235881]
               -> #2 (&mm->mmap_sem){++++}:
[  552.241259]        __might_fault+0x80/0xb0
[  552.245331]        filldir64+0xc0/0x2f8
[  552.249144]        call_filldir+0xb0/0x14c
[  552.253214]        ext4_readdir+0x768/0x90c
[  552.257374]        iterate_dir+0x74/0x168
[  552.261360]        SyS_getdents64+0x7c/0x1a0
[  552.265608]        ret_fast_syscall+0x0/0x28
[  552.269850]
               -> #1 (&type->i_mutex_dir_key#2){++++}:
[  552.276180]        down_read+0x48/0x90
[  552.279904]        lookup_slow+0x74/0x178
[  552.283889]        walk_component+0x1a4/0x2e4
[  552.288222]        link_path_walk+0x174/0x4a0
[  552.292555]        path_openat+0x68/0x944
[  552.296541]        do_filp_open+0x60/0xc4
[  552.300528]        file_open_name+0xe4/0x114
[  552.304772]        filp_open+0x28/0x48
[  552.308499]        kernel_read_file_from_path+0x30/0x78
[  552.313700]        _request_firmware+0x3ec/0x78c
[  552.318291]        request_firmware+0x3c/0x54
[  552.322642]        s5p_mfc_load_firmware+0x54/0x150 [s5p_mfc]
[  552.328358]        s5p_mfc_open+0x4e4/0x550 [s5p_mfc]
[  552.333394]        v4l2_open+0xa0/0x104 [videodev]
[  552.338137]        chrdev_open+0xa4/0x18c
[  552.342121]        do_dentry_open+0x208/0x310
[  552.346454]        path_openat+0x28c/0x944
[  552.350526]        do_filp_open+0x60/0xc4
[  552.354512]        do_sys_open+0x118/0x1c8
[  552.358586]        ret_fast_syscall+0x0/0x28
[  552.362830]
               -> #0 (&dev->mfc_mutex){+.+.}:
               -> #0 (&dev->mfc_mutex){+.+.}:
[  552.368379]        lock_acquire+0x6c/0x88
[  552.372364]        __mutex_lock+0x68/0xa34
[  552.376437]        mutex_lock_interruptible_nested+0x1c/0x24
[  552.382086]        s5p_mfc_mmap+0x28/0xd4 [s5p_mfc]
[  552.386939]        v4l2_mmap+0x54/0x88 [videodev]
[  552.391601]        mmap_region+0x3a8/0x638
[  552.395673]        do_mmap+0x330/0x3a4
[  552.399400]        vm_mmap_pgoff+0x90/0xb8
[  552.403472]        SyS_mmap_pgoff+0x90/0xc0
[  552.407632]        ret_fast_syscall+0x0/0x28
[  552.411876]
               other info that might help us debug this:

[  552.419848] Chain exists of:
                 &dev->mfc_mutex --> &type->i_mutex_dir_key#2 --> &mm->mmap_sem

[  552.431200]  Possible unsafe locking scenario:

[  552.437092]        CPU0                    CPU1
[  552.441598]        ----                    ----
[  552.446104]   lock(&mm->mmap_sem);
[  552.449484]                                lock(&type->i_mutex_dir_key#2);
[  552.456329]                                lock(&mm->mmap_sem);
[  552.462222]   lock(&dev->mfc_mutex);
[  552.465775]
                *** DEADLOCK ***

Signed-off-by: Shuah Khan <[email protected]>
Signed-off-by: memeka <[email protected]>
tobetter pushed a commit that referenced this issue Oct 29, 2017
v4.10 commit 6f2ce1c ("scsi: zfcp: fix rport unblock race with LUN
recovery") extended accessing parent pointer fields of struct
zfcp_erp_action for tracing.  If an erp_action has never been enqueued
before, these parent pointer fields are uninitialized and NULL. Examples
are zfcp objects freshly added to the parent object's children list,
before enqueueing their first recovery subsequently. In
zfcp_erp_try_rport_unblock(), we iterate such list. Accessing erp_action
fields can cause a NULL pointer dereference.  Since the kernel can read
from lowcore on s390, it does not immediately cause a kernel page
fault. Instead it can cause hangs on trying to acquire the wrong
erp_action->adapter->dbf->rec_lock in zfcp_dbf_rec_action_lvl()
                      ^bogus^
while holding already other locks with IRQs disabled.

Real life example from attaching lots of LUNs in parallel on many CPUs:

crash> bt 17723
PID: 17723  TASK: ...               CPU: 25  COMMAND: "zfcperp0.0.1800"
 LOWCORE INFO:
  -psw      : 0x0404300180000000 0x000000000038e424
  -function : _raw_spin_lock_wait_flags at 38e424
...
 #0 [fdde8fc90] zfcp_dbf_rec_action_lvl at 3e0004e9862 [zfcp]
 #1 [fdde8fce8] zfcp_erp_try_rport_unblock at 3e0004dfddc [zfcp]
 #2 [fdde8fd38] zfcp_erp_strategy at 3e0004e0234 [zfcp]
 #3 [fdde8fda8] zfcp_erp_thread at 3e0004e0a12 [zfcp]
 #4 [fdde8fe60] kthread at 173550
 #5 [fdde8feb8] kernel_thread_starter at 10add2

zfcp_adapter
 zfcp_port
  zfcp_unit <address>, 0x404040d600000000
  scsi_device NULL, returning early!
zfcp_scsi_dev.status = 0x40000000
0x40000000 ZFCP_STATUS_COMMON_RUNNING

crash> zfcp_unit <address>
struct zfcp_unit {
  erp_action = {
    adapter = 0x0,
    port = 0x0,
    unit = 0x0,
  },
}

zfcp_erp_action is always fully embedded into its container object. Such
container object is never moved in its object tree (only add or delete).
Hence, erp_action parent pointers can never change.

To fix the issue, initialize the erp_action parent pointers before
adding the erp_action container to any list and thus before it becomes
accessible from outside of its initializing function.

In order to also close the time window between zfcp_erp_setup_act()
memsetting the entire erp_action to zero and setting the parent pointers
again, drop the memset and instead explicitly initialize individually
all erp_action fields except for parent pointers. To be extra careful
not to introduce any other unintended side effect, even keep zeroing the
erp_action fields for list and timer. Also double-check with
WARN_ON_ONCE that erp_action parent pointers never change, so we get to
know when we would deviate from previous behavior.

Signed-off-by: Steffen Maier <[email protected]>
Fixes: 6f2ce1c ("scsi: zfcp: fix rport unblock race with LUN recovery")
Cc: <[email protected]> #2.6.32+
Reviewed-by: Benjamin Block <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
tobetter pushed a commit that referenced this issue Oct 29, 2017
Thomas reported that 'perf buildid-list' gets a SEGFAULT due to NULL
pointer deref when he ran it on a data with namespace events.  It was
because the buildid_id__mark_dso_hit_ops lacks the namespace event
handler and perf_too__fill_default() didn't set it.

  Program received signal SIGSEGV, Segmentation fault.
  0x0000000000000000 in ?? ()
  Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.7.7-1.fc25.s390x bzip2-libs-1.0.6-21.fc25.s390x elfutils-libelf-0.169-1.fc25.s390x
  +elfutils-libs-0.169-1.fc25.s390x libcap-ng-0.7.8-1.fc25.s390x numactl-libs-2.0.11-2.ibm.fc25.s390x openssl-libs-1.1.0e-1.1.ibm.fc25.s390x perl-libs-5.24.1-386.fc25.s390x
  +python-libs-2.7.13-2.fc25.s390x slang-2.3.0-7.fc25.s390x xz-libs-5.2.3-2.fc25.s390x zlib-1.2.8-10.fc25.s390x
  (gdb) where
  #0  0x0000000000000000 in ?? ()
  #1  0x00000000010fad6a in machines__deliver_event (machines=<optimized out>, machines@entry=0x2c6fd18,
      evlist=<optimized out>, event=event@entry=0x3fffdf00470, sample=0x3ffffffe880, sample@entry=0x3ffffffe888,
      tool=tool@entry=0x1312968 <build_id.mark_dso_hit_ops>, file_offset=1136) at util/session.c:1287
  #2  0x00000000010fbf4e in perf_session__deliver_event (file_offset=1136, tool=0x1312968 <build_id.mark_dso_hit_ops>,
      sample=0x3ffffffe888, event=0x3fffdf00470, session=0x2c6fc30) at util/session.c:1340
  #3  perf_session__process_event (session=0x2c6fc30, session@entry=0x0, event=event@entry=0x3fffdf00470,
      file_offset=file_offset@entry=1136) at util/session.c:1522
  #4  0x00000000010fddde in __perf_session__process_events (file_size=11880, data_size=<optimized out>,
      data_offset=<optimized out>, session=0x0) at util/session.c:1899
  #5  perf_session__process_events (session=0x0, session@entry=0x2c6fc30) at util/session.c:1953
  #6  0x000000000103b2ac in perf_session__list_build_ids (with_hits=<optimized out>, force=<optimized out>)
      at builtin-buildid-list.c:83
  #7  cmd_buildid_list (argc=<optimized out>, argv=<optimized out>) at builtin-buildid-list.c:115
  #8  0x00000000010a026c in run_builtin (p=0x1311f78 <commands+24>, argc=argc@entry=2, argv=argv@entry=0x3fffffff3c0)
      at perf.c:296
  #9  0x000000000102bc00 in handle_internal_command (argv=<optimized out>, argc=2) at perf.c:348
  #10 run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:392
  #11 main (argc=<optimized out>, argv=0x3fffffff3c0) at perf.c:536
  (gdb)

Fix it by adding a stub event handler for namespace event.

Committer testing:

Further clarifying, plain using 'perf buildid-list' will not end up in a
SEGFAULT when processing a perf.data file with namespace info:

  # perf record -a --namespaces sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 2.024 MB perf.data (1058 samples) ]
  # perf buildid-list | wc -l
  38
  # perf buildid-list | head -5
  e2a171c7b905826fc8494f0711ba76ab6abbd604 /lib/modules/4.14.0-rc3+/build/vmlinux
  874840a02d8f8a31cedd605d0b8653145472ced3 /lib/modules/4.14.0-rc3+/kernel/arch/x86/kvm/kvm-intel.ko
  ea7223776730cd8a22f320040aae4d54312984bc /lib/modules/4.14.0-rc3+/kernel/drivers/gpu/drm/i915/i915.ko
  5961535e6732a8edb7f22b3f148bb2fa2e0be4b9 /lib/modules/4.14.0-rc3+/kernel/drivers/gpu/drm/drm.ko
  f045f54aa78cf1931cc893f78b6cbc52c72a8cb1 /usr/lib64/libc-2.25.so
  #

It is only when one asks for checking what of those entries actually had
samples, i.e. when we use either -H or --with-hits, that we will process
all the PERF_RECORD_ events, and since tools/perf/builtin-buildid-list.c
neither explicitely set a perf_tool.namespaces() callback nor the
default stub was set that we end up, when processing a
PERF_RECORD_NAMESPACE record, causing a SEGFAULT:

  # perf buildid-list -H
  Segmentation fault (core dumped)
  ^C
  #

Reported-and-Tested-by: Thomas-Mich Richter <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Hari Bathini <[email protected]>
Cc: Hendrik Brueckner <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas-Mich Richter <[email protected]>
Fixes: f3b3614 ("perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tobetter pushed a commit that referenced this issue Oct 29, 2017
When an EMAD is transmitted, a timeout work item is scheduled with a
delay of 200ms, so that another EMAD will be retried until a maximum of
five retries.

In certain situations, it's possible for the function waiting on the
EMAD to be associated with a work item that is queued on the same
workqueue (`mlxsw_core`) as the timeout work item. This results in
flushing a work item on the same workqueue.

According to commit e159489 ("workqueue: relax lockdep annotation
on flush_work()") the above may lead to a deadlock in case the workqueue
has only one worker active or if the system in under memory pressure and
the rescue worker is in use. The latter explains the very rare and
random nature of the lockdep splats we have been seeing:

[   52.730240] ============================================
[   52.736179] WARNING: possible recursive locking detected
[   52.742119] 4.14.0-rc3jiri+ #4 Not tainted
[   52.746697] --------------------------------------------
[   52.752635] kworker/1:3/599 is trying to acquire lock:
[   52.758378]  (mlxsw_core_driver_name){+.+.}, at: [<ffffffff811c4fa4>] flush_work+0x3a4/0x5e0
[   52.767837]
               but task is already holding lock:
[   52.774360]  (mlxsw_core_driver_name){+.+.}, at: [<ffffffff811c65c4>] process_one_work+0x7d4/0x12f0
[   52.784495]
               other info that might help us debug this:
[   52.791794]  Possible unsafe locking scenario:
[   52.798413]        CPU0
[   52.801144]        ----
[   52.803875]   lock(mlxsw_core_driver_name);
[   52.808556]   lock(mlxsw_core_driver_name);
[   52.813236]
                *** DEADLOCK ***
[   52.819857]  May be due to missing lock nesting notation
[   52.827450] 3 locks held by kworker/1:3/599:
[   52.832221]  #0:  (mlxsw_core_driver_name){+.+.}, at: [<ffffffff811c65c4>] process_one_work+0x7d4/0x12f0
[   52.842846]  #1:  ((&(&bridge->fdb_notify.dw)->work)){+.+.}, at: [<ffffffff811c65c4>] process_one_work+0x7d4/0x12f0
[   52.854537]  #2:  (rtnl_mutex){+.+.}, at: [<ffffffff822ad8e7>] rtnl_lock+0x17/0x20
[   52.863021]
               stack backtrace:
[   52.867890] CPU: 1 PID: 599 Comm: kworker/1:3 Not tainted 4.14.0-rc3jiri+ #4
[   52.875773] Hardware name: Mellanox Technologies Ltd. "MSN2100-CB2F"/"SA001017", BIOS 5.6.5 06/07/2016
[   52.886267] Workqueue: mlxsw_core mlxsw_sp_fdb_notify_work [mlxsw_spectrum]
[   52.894060] Call Trace:
[   52.909122]  __lock_acquire+0xf6f/0x2a10
[   53.025412]  lock_acquire+0x158/0x440
[   53.047557]  flush_work+0x3c4/0x5e0
[   53.087571]  __cancel_work_timer+0x3ca/0x5e0
[   53.177051]  cancel_delayed_work_sync+0x13/0x20
[   53.182142]  mlxsw_reg_trans_bulk_wait+0x12d/0x7a0 [mlxsw_core]
[   53.194571]  mlxsw_core_reg_access+0x586/0x990 [mlxsw_core]
[   53.225365]  mlxsw_reg_query+0x10/0x20 [mlxsw_core]
[   53.230882]  mlxsw_sp_fdb_notify_work+0x2a3/0x9d0 [mlxsw_spectrum]
[   53.237801]  process_one_work+0x8f1/0x12f0
[   53.321804]  worker_thread+0x1fd/0x10c0
[   53.435158]  kthread+0x28e/0x370
[   53.448703]  ret_from_fork+0x2a/0x40
[   53.453017] mlxsw_spectrum 0000:01:00.0: EMAD retries (2/5) (tid=bf4549b100000774)
[   53.453119] mlxsw_spectrum 0000:01:00.0: EMAD retries (5/5) (tid=bf4549b100000770)
[   53.453132] mlxsw_spectrum 0000:01:00.0: EMAD reg access failed (tid=bf4549b100000770,reg_id=200b(sfn),type=query,status=0(operation performed))
[   53.453143] mlxsw_spectrum 0000:01:00.0: Failed to get FDB notifications

Fix this by creating another workqueue for EMAD timeouts, thereby
preventing the situation of a work item trying to flush a work item
queued on the same workqueue.

Fixes: caf7297 ("mlxsw: core: Introduce support for asynchronous EMAD register access")
Signed-off-by: Ido Schimmel <[email protected]>
Reported-by: Jiri Pirko <[email protected]>
Signed-off-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
tobetter pushed a commit that referenced this issue Nov 6, 2017
syzkaller with KASAN reported an out-of-bounds read in
asn1_ber_decoder().  It can be reproduced by the following command,
assuming CONFIG_X509_CERTIFICATE_PARSER=y and CONFIG_KASAN=y:

    keyctl add asymmetric desc $'\x30\x30' @s

The bug is that the length of an ASN.1 data value isn't validated in the
case where it is encoded using the short form, causing the decoder to
read past the end of the input buffer.  Fix it by validating the length.

The bug report was:

    BUG: KASAN: slab-out-of-bounds in asn1_ber_decoder+0x10cb/0x1730 lib/asn1_decoder.c:233
    Read of size 1 at addr ffff88003cccfa02 by task syz-executor0/6818

    CPU: 1 PID: 6818 Comm: syz-executor0 Not tainted 4.14.0-rc7-00008-g5f479447d983 #2
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    Call Trace:
     __dump_stack lib/dump_stack.c:16 [inline]
     dump_stack+0xb3/0x10b lib/dump_stack.c:52
     print_address_description+0x79/0x2a0 mm/kasan/report.c:252
     kasan_report_error mm/kasan/report.c:351 [inline]
     kasan_report+0x236/0x340 mm/kasan/report.c:409
     __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:427
     asn1_ber_decoder+0x10cb/0x1730 lib/asn1_decoder.c:233
     x509_cert_parse+0x1db/0x650 crypto/asymmetric_keys/x509_cert_parser.c:89
     x509_key_preparse+0x64/0x7a0 crypto/asymmetric_keys/x509_public_key.c:174
     asymmetric_key_preparse+0xcb/0x1a0 crypto/asymmetric_keys/asymmetric_type.c:388
     key_create_or_update+0x347/0xb20 security/keys/key.c:855
     SYSC_add_key security/keys/keyctl.c:122 [inline]
     SyS_add_key+0x1cd/0x340 security/keys/keyctl.c:62
     entry_SYSCALL_64_fastpath+0x1f/0xbe
    RIP: 0033:0x447c89
    RSP: 002b:00007fca7a5d3bd8 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8
    RAX: ffffffffffffffda RBX: 00007fca7a5d46cc RCX: 0000000000447c89
    RDX: 0000000020006f4a RSI: 0000000020006000 RDI: 0000000020001ff5
    RBP: 0000000000000046 R08: fffffffffffffffd R09: 0000000000000000
    R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
    R13: 0000000000000000 R14: 00007fca7a5d49c0 R15: 00007fca7a5d4700

Fixes: 42d5ec2 ("X.509: Add an ASN.1 decoder")
Cc: <[email protected]> # v3.7+
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: James Morris <[email protected]>
tobetter pushed a commit that referenced this issue Nov 12, 2017
syzkaller reported a NULL pointer dereference in asn1_ber_decoder().  It
can be reproduced by the following command, assuming
CONFIG_PKCS7_TEST_KEY=y:

        keyctl add pkcs7_test desc '' @s

The bug is that if the data buffer is empty, an integer underflow occurs
in the following check:

        if (unlikely(dp >= datalen - 1))
                goto data_overrun_error;

This results in the NULL data pointer being dereferenced.

Fix it by checking for 'datalen - dp < 2' instead.

Also fix the similar check for 'dp >= datalen - n' later in the same
function.  That one possibly could result in a buffer overread.

The NULL pointer dereference was reproducible using the "pkcs7_test" key
type but not the "asymmetric" key type because the "asymmetric" key type
checks for a 0-length payload before calling into the ASN.1 decoder but
the "pkcs7_test" key type does not.

The bug report was:

    BUG: unable to handle kernel NULL pointer dereference at           (null)
    IP: asn1_ber_decoder+0x17f/0xe60 lib/asn1_decoder.c:233
    PGD 7b708067 P4D 7b708067 PUD 7b6ee067 PMD 0
    Oops: 0000 [#1] SMP
    Modules linked in:
    CPU: 0 PID: 522 Comm: syz-executor1 Not tainted 4.14.0-rc8 #7
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.3-20171021_125229-anatol 04/01/2014
    task: ffff9b6b3798c040 task.stack: ffff9b6b37970000
    RIP: 0010:asn1_ber_decoder+0x17f/0xe60 lib/asn1_decoder.c:233
    RSP: 0018:ffff9b6b37973c78 EFLAGS: 00010216
    RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000021c
    RDX: ffffffff814a04ed RSI: ffffb1524066e000 RDI: ffffffff910759e0
    RBP: ffff9b6b37973d60 R08: 0000000000000001 R09: ffff9b6b3caa4180
    R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000002
    R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
    FS:  00007f10ed1f2700(0000) GS:ffff9b6b3ea00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000000 CR3: 000000007b6f3000 CR4: 00000000000006f0
    Call Trace:
     pkcs7_parse_message+0xee/0x240 crypto/asymmetric_keys/pkcs7_parser.c:139
     verify_pkcs7_signature+0x33/0x180 certs/system_keyring.c:216
     pkcs7_preparse+0x41/0x70 crypto/asymmetric_keys/pkcs7_key_type.c:63
     key_create_or_update+0x180/0x530 security/keys/key.c:855
     SYSC_add_key security/keys/keyctl.c:122 [inline]
     SyS_add_key+0xbf/0x250 security/keys/keyctl.c:62
     entry_SYSCALL_64_fastpath+0x1f/0xbe
    RIP: 0033:0x4585c9
    RSP: 002b:00007f10ed1f1bd8 EFLAGS: 00000216 ORIG_RAX: 00000000000000f8
    RAX: ffffffffffffffda RBX: 00007f10ed1f2700 RCX: 00000000004585c9
    RDX: 0000000020000000 RSI: 0000000020008ffb RDI: 0000000020008000
    RBP: 0000000000000000 R08: ffffffffffffffff R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000216 R12: 00007fff1b2260ae
    R13: 00007fff1b2260af R14: 00007f10ed1f2700 R15: 0000000000000000
    Code: dd ca ff 48 8b 45 88 48 83 e8 01 4c 39 f0 0f 86 a8 07 00 00 e8 53 dd ca ff 49 8d 46 01 48 89 85 58 ff ff ff 48 8b 85 60 ff ff ff <42> 0f b6 0c 30 89 c8 88 8d 75 ff ff ff 83 e0 1f 89 8d 28 ff ff
    RIP: asn1_ber_decoder+0x17f/0xe60 lib/asn1_decoder.c:233 RSP: ffff9b6b37973c78
    CR2: 0000000000000000

Fixes: 42d5ec2 ("X.509: Add an ASN.1 decoder")
Reported-by: syzbot <[email protected]>
Cc: <[email protected]> # v3.7+
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: James Morris <[email protected]>
tobetter pushed a commit that referenced this issue Nov 12, 2017
…kernel/git/jmorris/linux-security

Pull key handling fix from James Morris:
 "Fix by Eric Biggers for the keys subsystem"

* 'fixes-v4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  KEYS: fix NULL pointer dereference during ASN.1 parsing [ver #2]
tobetter pushed a commit that referenced this issue Dec 6, 2017
commit ff16567 upstream.

acpi_remove_pm_notifier() ends up calling flush_workqueue() while
holding acpi_pm_notifier_lock, and that same lock is taken by
by the work via acpi_pm_notify_handler(). This can deadlock.

To fix the problem let's split the single lock into two: one to
protect the dev->wakeup between the work vs. add/remove, and
another one to handle notifier installation vs. removal.

After commit a1d1493 "workqueue/lockdep: 'Fix' flush_work()
annotation" I was able to kill the machine (Intel Braswell)
very easily with 'powertop --auto-tune', runtime suspending i915,
and trying to wake it up via the USB keyboard. The cases when
it didn't die are presumably explained by lockdep getting disabled
by something else (cpu hotplug locking issues usually).

Fortunately I still got a lockdep report over netconsole
(trickling in very slowly), even though the machine was
otherwise practically dead:

[  112.179806] ======================================================
[  114.670858] WARNING: possible circular locking dependency detected
[  117.155663] 4.13.0-rc6-bsw-bisect-00169-ga1d14934ea4b torvalds#119 Not tainted
[  119.658101] ------------------------------------------------------
[  121.310242] xhci_hcd 0000:00:14.0: xHCI host not responding to stop endpoint command.
[  121.313294] xhci_hcd 0000:00:14.0: xHCI host controller not responding, assume dead
[  121.313346] xhci_hcd 0000:00:14.0: HC died; cleaning up
[  121.313485] usb 1-6: USB disconnect, device number 3
[  121.313501] usb 1-6.2: USB disconnect, device number 4
[  134.747383] kworker/0:2/47 is trying to acquire lock:
[  137.220790]  (acpi_pm_notifier_lock){+.+.}, at: [<ffffffff813cafdf>] acpi_pm_notify_handler+0x2f/0x80
[  139.721524]
[  139.721524] but task is already holding lock:
[  144.672922]  ((&dpc->work)){+.+.}, at: [<ffffffff8109ce90>] process_one_work+0x160/0x720
[  147.184450]
[  147.184450] which lock already depends on the new lock.
[  147.184450]
[  154.604711]
[  154.604711] the existing dependency chain (in reverse order) is:
[  159.447888]
[  159.447888] -> #2 ((&dpc->work)){+.+.}:
[  164.183486]        __lock_acquire+0x1255/0x13f0
[  166.504313]        lock_acquire+0xb5/0x210
[  168.778973]        process_one_work+0x1b9/0x720
[  171.030316]        worker_thread+0x4c/0x440
[  173.257184]        kthread+0x154/0x190
[  175.456143]        ret_from_fork+0x27/0x40
[  177.624348]
[  177.624348] -> #1 ("kacpi_notify"){+.+.}:
[  181.850351]        __lock_acquire+0x1255/0x13f0
[  183.941695]        lock_acquire+0xb5/0x210
[  186.046115]        flush_workqueue+0xdd/0x510
[  190.408153]        acpi_os_wait_events_complete+0x31/0x40
[  192.625303]        acpi_remove_notify_handler+0x133/0x188
[  194.820829]        acpi_remove_pm_notifier+0x56/0x90
[  196.989068]        acpi_dev_pm_detach+0x5f/0xa0
[  199.145866]        dev_pm_domain_detach+0x27/0x30
[  201.285614]        i2c_device_probe+0x100/0x210
[  203.411118]        driver_probe_device+0x23e/0x310
[  205.522425]        __driver_attach+0xa3/0xb0
[  207.634268]        bus_for_each_dev+0x69/0xa0
[  209.714797]        driver_attach+0x1e/0x20
[  211.778258]        bus_add_driver+0x1bc/0x230
[  213.837162]        driver_register+0x60/0xe0
[  215.868162]        i2c_register_driver+0x42/0x70
[  217.869551]        0xffffffffa0172017
[  219.863009]        do_one_initcall+0x45/0x170
[  221.843863]        do_init_module+0x5f/0x204
[  223.817915]        load_module+0x225b/0x29b0
[  225.757234]        SyS_finit_module+0xc6/0xd0
[  227.661851]        do_syscall_64+0x5c/0x120
[  229.536819]        return_from_SYSCALL_64+0x0/0x7a
[  231.392444]
[  231.392444] -> #0 (acpi_pm_notifier_lock){+.+.}:
[  235.124914]        check_prev_add+0x44e/0x8a0
[  237.024795]        __lock_acquire+0x1255/0x13f0
[  238.937351]        lock_acquire+0xb5/0x210
[  240.840799]        __mutex_lock+0x75/0x940
[  242.709517]        mutex_lock_nested+0x1c/0x20
[  244.551478]        acpi_pm_notify_handler+0x2f/0x80
[  246.382052]        acpi_ev_notify_dispatch+0x44/0x5c
[  248.194412]        acpi_os_execute_deferred+0x14/0x30
[  250.003925]        process_one_work+0x1ec/0x720
[  251.803191]        worker_thread+0x4c/0x440
[  253.605307]        kthread+0x154/0x190
[  255.387498]        ret_from_fork+0x27/0x40
[  257.153175]
[  257.153175] other info that might help us debug this:
[  257.153175]
[  262.324392] Chain exists of:
[  262.324392]   acpi_pm_notifier_lock --> "kacpi_notify" --> (&dpc->work)
[  262.324392]
[  267.391997]  Possible unsafe locking scenario:
[  267.391997]
[  270.758262]        CPU0                    CPU1
[  272.431713]        ----                    ----
[  274.060756]   lock((&dpc->work));
[  275.646532]                                lock("kacpi_notify");
[  277.260772]                                lock((&dpc->work));
[  278.839146]   lock(acpi_pm_notifier_lock);
[  280.391902]
[  280.391902]  *** DEADLOCK ***
[  280.391902]
[  284.986385] 2 locks held by kworker/0:2/47:
[  286.524895]  #0:  ("kacpi_notify"){+.+.}, at: [<ffffffff8109ce90>] process_one_work+0x160/0x720
[  288.112927]  #1:  ((&dpc->work)){+.+.}, at: [<ffffffff8109ce90>] process_one_work+0x160/0x720
[  289.727725]

Fixes: c072530 (ACPI / PM: Revork the handling of ACPI device wakeup notifications)
Signed-off-by: Ville Syrjälä <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue Dec 6, 2017
commit 8653188 upstream.

Avoid that the following is reported while loading the qla2xxx
kernel module:

BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/783
caller is debug_smp_processor_id+0x17/0x20
CPU: 7 PID: 783 Comm: modprobe Not tainted 4.14.0-rc8-dbg+ #2
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
 dump_stack+0x8e/0xce
 check_preemption_disabled+0xe3/0xf0
 debug_smp_processor_id+0x17/0x20
 qla2x00_probe_one+0xf43/0x26c0 [qla2xxx]
 pci_device_probe+0xca/0x140
 driver_probe_device+0x2e2/0x440
 __driver_attach+0xa3/0xe0
 bus_for_each_dev+0x5f/0x90
 driver_attach+0x19/0x20
 bus_add_driver+0x1c0/0x260
 driver_register+0x5b/0xd0
 __pci_register_driver+0x63/0x70
 qla2x00_module_init+0x1d6/0x222 [qla2xxx]
 do_one_initcall+0x3c/0x163
 do_init_module+0x55/0x1eb
 load_module+0x20a2/0x2890
 SYSC_finit_module+0xd7/0xf0
 SyS_finit_module+0x9/0x10
 entry_SYSCALL_64_fastpath+0x23/0xc2

Fixes: commit 8abfa9e ("scsi: qla2xxx: Add function call to qpair for door bell")
Signed-off-by: Bart Van Assche <[email protected]>
Cc: Quinn Tran <[email protected]>
Cc: Himanshu Madhani <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue Apr 8, 2025
[ Upstream commit 6d00234 ]

Function xen_pin_page calls xen_pte_lock, which in turn grab page
table lock (ptlock). When locking, xen_pte_lock expect mm->page_table_lock
to be held before grabbing ptlock, but this does not happen when pinning
is caused by xen_mm_pin_all.

This commit addresses lockdep warning below, which shows up when
suspending a Xen VM.

[ 3680.658422] Freezing user space processes
[ 3680.660156] Freezing user space processes completed (elapsed 0.001 seconds)
[ 3680.660182] OOM killer disabled.
[ 3680.660192] Freezing remaining freezable tasks
[ 3680.661485] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 3680.685254]
[ 3680.685265] ==================================
[ 3680.685269] WARNING: Nested lock was not taken
[ 3680.685274] 6.12.0+ #16 Tainted: G        W
[ 3680.685279] ----------------------------------
[ 3680.685283] migration/0/19 is trying to lock:
[ 3680.685288] ffff88800bac33c0 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: xen_pin_page+0x175/0x1d0
[ 3680.685303]
[ 3680.685303] but this task is not holding:
[ 3680.685308] init_mm.page_table_lock
[ 3680.685311]
[ 3680.685311] stack backtrace:
[ 3680.685316] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Tainted: G        W          6.12.0+ #16
[ 3680.685324] Tainted: [W]=WARN
[ 3680.685328] Stopper: multi_cpu_stop+0x0/0x120 <- __stop_cpus.constprop.0+0x8c/0xd0
[ 3680.685339] Call Trace:
[ 3680.685344]  <TASK>
[ 3680.685347]  dump_stack_lvl+0x77/0xb0
[ 3680.685356]  __lock_acquire+0x917/0x2310
[ 3680.685364]  lock_acquire+0xce/0x2c0
[ 3680.685369]  ? xen_pin_page+0x175/0x1d0
[ 3680.685373]  _raw_spin_lock_nest_lock+0x2f/0x70
[ 3680.685381]  ? xen_pin_page+0x175/0x1d0
[ 3680.685386]  xen_pin_page+0x175/0x1d0
[ 3680.685390]  ? __pfx_xen_pin_page+0x10/0x10
[ 3680.685394]  __xen_pgd_walk+0x233/0x2c0
[ 3680.685401]  ? stop_one_cpu+0x91/0x100
[ 3680.685405]  __xen_pgd_pin+0x5d/0x250
[ 3680.685410]  xen_mm_pin_all+0x70/0xa0
[ 3680.685415]  xen_pv_pre_suspend+0xf/0x280
[ 3680.685420]  xen_suspend+0x57/0x1a0
[ 3680.685428]  multi_cpu_stop+0x6b/0x120
[ 3680.685432]  ? update_cpumasks_hier+0x7c/0xa60
[ 3680.685439]  ? __pfx_multi_cpu_stop+0x10/0x10
[ 3680.685443]  cpu_stopper_thread+0x8c/0x140
[ 3680.685448]  ? smpboot_thread_fn+0x20/0x1f0
[ 3680.685454]  ? __pfx_smpboot_thread_fn+0x10/0x10
[ 3680.685458]  smpboot_thread_fn+0xed/0x1f0
[ 3680.685462]  kthread+0xde/0x110
[ 3680.685467]  ? __pfx_kthread+0x10/0x10
[ 3680.685471]  ret_from_fork+0x2f/0x50
[ 3680.685478]  ? __pfx_kthread+0x10/0x10
[ 3680.685482]  ret_from_fork_asm+0x1a/0x30
[ 3680.685489]  </TASK>
[ 3680.685491]
[ 3680.685491] other info that might help us debug this:
[ 3680.685497] 1 lock held by migration/0/19:
[ 3680.685500]  #0: ffffffff8284df38 (pgd_lock){+.+.}-{3:3}, at: xen_mm_pin_all+0x14/0xa0
[ 3680.685512]
[ 3680.685512] stack backtrace:
[ 3680.685518] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Tainted: G        W          6.12.0+ #16
[ 3680.685528] Tainted: [W]=WARN
[ 3680.685531] Stopper: multi_cpu_stop+0x0/0x120 <- __stop_cpus.constprop.0+0x8c/0xd0
[ 3680.685538] Call Trace:
[ 3680.685541]  <TASK>
[ 3680.685544]  dump_stack_lvl+0x77/0xb0
[ 3680.685549]  __lock_acquire+0x93c/0x2310
[ 3680.685554]  lock_acquire+0xce/0x2c0
[ 3680.685558]  ? xen_pin_page+0x175/0x1d0
[ 3680.685562]  _raw_spin_lock_nest_lock+0x2f/0x70
[ 3680.685568]  ? xen_pin_page+0x175/0x1d0
[ 3680.685572]  xen_pin_page+0x175/0x1d0
[ 3680.685578]  ? __pfx_xen_pin_page+0x10/0x10
[ 3680.685582]  __xen_pgd_walk+0x233/0x2c0
[ 3680.685588]  ? stop_one_cpu+0x91/0x100
[ 3680.685592]  __xen_pgd_pin+0x5d/0x250
[ 3680.685596]  xen_mm_pin_all+0x70/0xa0
[ 3680.685600]  xen_pv_pre_suspend+0xf/0x280
[ 3680.685607]  xen_suspend+0x57/0x1a0
[ 3680.685611]  multi_cpu_stop+0x6b/0x120
[ 3680.685615]  ? update_cpumasks_hier+0x7c/0xa60
[ 3680.685620]  ? __pfx_multi_cpu_stop+0x10/0x10
[ 3680.685625]  cpu_stopper_thread+0x8c/0x140
[ 3680.685629]  ? smpboot_thread_fn+0x20/0x1f0
[ 3680.685634]  ? __pfx_smpboot_thread_fn+0x10/0x10
[ 3680.685638]  smpboot_thread_fn+0xed/0x1f0
[ 3680.685642]  kthread+0xde/0x110
[ 3680.685645]  ? __pfx_kthread+0x10/0x10
[ 3680.685649]  ret_from_fork+0x2f/0x50
[ 3680.685654]  ? __pfx_kthread+0x10/0x10
[ 3680.685657]  ret_from_fork_asm+0x1a/0x30
[ 3680.685662]  </TASK>
[ 3680.685267] xen:grant_table: Grant tables using version 1 layout
[ 3680.685921] OOM killer enabled.
[ 3680.685934] Restarting tasks ... done.

Signed-off-by: Maksym Planeta <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue Apr 8, 2025
…ea as VM_ALLOC

[ Upstream commit d262a19 ]

Erhard reported the following KASAN hit while booting his PowerMac G4
with a KASAN-enabled kernel 6.13-rc6:

  BUG: KASAN: vmalloc-out-of-bounds in copy_to_kernel_nofault+0xd8/0x1c8
  Write of size 8 at addr f1000000 by task chronyd/1293

  CPU: 0 UID: 123 PID: 1293 Comm: chronyd Tainted: G        W          6.13.0-rc6-PMacG4 #2
  Tainted: [W]=WARN
  Hardware name: PowerMac3,6 7455 0x80010303 PowerMac
  Call Trace:
  [c2437590] [c1631a84] dump_stack_lvl+0x70/0x8c (unreliable)
  [c24375b0] [c0504998] print_report+0xdc/0x504
  [c2437610] [c050475c] kasan_report+0xf8/0x108
  [c243769] [c0505a3c] kasan_check_range+0x24/0x18c
  [c24376a0] [c03fb5e4] copy_to_kernel_nofault+0xd8/0x1c8
  [c24376c0] [c004c014] patch_instructions+0x15c/0x16c
  [c2437710] [c00731a8] bpf_arch_text_copy+0x60/0x7c
  [c2437730] [c0281168] bpf_jit_binary_pack_finalize+0x50/0xac
  [c2437750] [c0073cf4] bpf_int_jit_compile+0xb30/0xdec
  [c2437880] [c0280394] bpf_prog_select_runtime+0x15c/0x478
  [c24378d0] [c1263428] bpf_prepare_filter+0xbf8/0xc14
  [c2437990] [c12677ec] bpf_prog_create_from_user+0x258/0x2b4
  [c24379d0] [c027111c] do_seccomp+0x3dc/0x1890
  [c2437ac0] [c001d8e0] system_call_exception+0x2dc/0x420
  [c2437f30] [c00281ac] ret_from_syscall+0x0/0x2c
  --- interrupt: c00 at 0x5a1274
  NIP:  005a1274 LR: 006a3b3c CTR: 005296c8
  REGS: c2437f40 TRAP: 0c00   Tainted: G        W           (6.13.0-rc6-PMacG4)
  MSR:  0200f932 <VEC,EE,PR,FP,ME,IR,DR,RI>  CR: 24004422  XER: 00000000

  GPR00: 00000166 af8f3fa0 a7ee3540 00000001 00000000 013b6500 005a5858 0200f932
  GPR08: 00000000 00001fe9 013d5fc8 005296c8 2822244c 00b2fcd8 00000000 af8f4b57
  GPR16: 00000000 00000001 00000000 00000000 00000000 00000001 00000000 00000002
  GPR24: 00afdbb0 00000000 00000000 00000000 006e0004 013ce060 006e7c1c 00000001
  NIP [005a1274] 0x5a1274
  LR [006a3b3c] 0x6a3b3c
  --- interrupt: c00

  The buggy address belongs to the virtual mapping at
   [f1000000, f1002000) created by:
   text_area_cpu_up+0x20/0x190

  The buggy address belongs to the physical page:
  page: refcount:1 mapcount:0 mapping:00000000 index:0x0 pfn:0x76e30
  flags: 0x80000000(zone=2)
  raw: 80000000 00000000 00000122 00000000 00000000 00000000 ffffffff 00000001
  raw: 00000000
  page dumped because: kasan: bad access detected

  Memory state around the buggy address:
   f0ffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   f0ffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  >f1000000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
             ^
   f1000080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
   f1000100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
  ==================================================================

f8 corresponds to KASAN_VMALLOC_INVALID which means the area is not
initialised hence not supposed to be used yet.

Powerpc text patching infrastructure allocates a virtual memory area
using get_vm_area() and flags it as VM_ALLOC. But that flag is meant
to be used for vmalloc() and vmalloc() allocated memory is not
supposed to be used before a call to __vmalloc_node_range() which is
never called for that area.

That went undetected until commit e4137f0 ("mm, kasan, kmsan:
instrument copy_from/to_kernel_nofault")

The area allocated by text_area_cpu_up() is not vmalloc memory, it is
mapped directly on demand when needed by map_kernel_page(). There is
no VM flag corresponding to such usage, so just pass no flag. That way
the area will be unpoisonned and usable immediately.

Reported-by: Erhard Furtner <[email protected]>
Closes: https://lore.kernel.org/all/20250112135832.57c92322@yea/
Fixes: 37bc3e5 ("powerpc/lib/code-patching: Use alternate map for patch_instruction()")
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Madhavan Srinivasan <[email protected]>
Link: https://patch.msgid.link/06621423da339b374f48c0886e3a5db18e896be8.1739342693.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue Apr 8, 2025
commit f02c41f upstream.

Use raw_spinlock in order to fix spurious messages about invalid context
when spinlock debugging is enabled. The lock is only used to serialize
register access.

    [    4.239592] =============================
    [    4.239595] [ BUG: Invalid wait context ]
    [    4.239599] 6.13.0-rc7-arm64-renesas-05496-gd088502a519f #35 Not tainted
    [    4.239603] -----------------------------
    [    4.239606] kworker/u8:5/76 is trying to lock:
    [    4.239609] ffff0000091898a0 (&p->lock){....}-{3:3}, at: gpio_rcar_config_interrupt_input_mode+0x34/0x164
    [    4.239641] other info that might help us debug this:
    [    4.239643] context-{5:5}
    [    4.239646] 5 locks held by kworker/u8:5/76:
    [    4.239651]  #0: ffff0000080fb148 ((wq_completion)async){+.+.}-{0:0}, at: process_one_work+0x190/0x62c
    [    4.250180] OF: /soc/sound@ec500000/ports/port@0/endpoint: Read of boolean property 'frame-master' with a value.
    [    4.254094]  #1: ffff80008299bd80 ((work_completion)(&entry->work)){+.+.}-{0:0}, at: process_one_work+0x1b8/0x62c
    [    4.254109]  #2: ffff00000920c8f8
    [    4.258345] OF: /soc/sound@ec500000/ports/port@1/endpoint: Read of boolean property 'bitclock-master' with a value.
    [    4.264803]  (&dev->mutex){....}-{4:4}, at: __device_attach_async_helper+0x3c/0xdc
    [    4.264820]  #3: ffff00000a50ca40 (request_class#2){+.+.}-{4:4}, at: __setup_irq+0xa0/0x690
    [    4.264840]  #4:
    [    4.268872] OF: /soc/sound@ec500000/ports/port@1/endpoint: Read of boolean property 'frame-master' with a value.
    [    4.273275] ffff00000a50c8c8 (lock_class){....}-{2:2}, at: __setup_irq+0xc4/0x690
    [    4.296130] renesas_sdhi_internal_dmac ee10000.mmc: mmc1 base at 0x00000000ee100000, max clock rate 200 MHz
    [    4.304082] stack backtrace:
    [    4.304086] CPU: 1 UID: 0 PID: 76 Comm: kworker/u8:5 Not tainted 6.13.0-rc7-arm64-renesas-05496-gd088502a519f #35
    [    4.304092] Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT)
    [    4.304097] Workqueue: async async_run_entry_fn
    [    4.304106] Call trace:
    [    4.304110]  show_stack+0x14/0x20 (C)
    [    4.304122]  dump_stack_lvl+0x6c/0x90
    [    4.304131]  dump_stack+0x14/0x1c
    [    4.304138]  __lock_acquire+0xdfc/0x1584
    [    4.426274]  lock_acquire+0x1c4/0x33c
    [    4.429942]  _raw_spin_lock_irqsave+0x5c/0x80
    [    4.434307]  gpio_rcar_config_interrupt_input_mode+0x34/0x164
    [    4.440061]  gpio_rcar_irq_set_type+0xd4/0xd8
    [    4.444422]  __irq_set_trigger+0x5c/0x178
    [    4.448435]  __setup_irq+0x2e4/0x690
    [    4.452012]  request_threaded_irq+0xc4/0x190
    [    4.456285]  devm_request_threaded_irq+0x7c/0xf4
    [    4.459398] ata1: link resume succeeded after 1 retries
    [    4.460902]  mmc_gpiod_request_cd_irq+0x68/0xe0
    [    4.470660]  mmc_start_host+0x50/0xac
    [    4.474327]  mmc_add_host+0x80/0xe4
    [    4.477817]  tmio_mmc_host_probe+0x2b0/0x440
    [    4.482094]  renesas_sdhi_probe+0x488/0x6f4
    [    4.486281]  renesas_sdhi_internal_dmac_probe+0x60/0x78
    [    4.491509]  platform_probe+0x64/0xd8
    [    4.495178]  really_probe+0xb8/0x2a8
    [    4.498756]  __driver_probe_device+0x74/0x118
    [    4.503116]  driver_probe_device+0x3c/0x154
    [    4.507303]  __device_attach_driver+0xd4/0x160
    [    4.511750]  bus_for_each_drv+0x84/0xe0
    [    4.515588]  __device_attach_async_helper+0xb0/0xdc
    [    4.520470]  async_run_entry_fn+0x30/0xd8
    [    4.524481]  process_one_work+0x210/0x62c
    [    4.528494]  worker_thread+0x1ac/0x340
    [    4.532245]  kthread+0x10c/0x110
    [    4.535476]  ret_from_fork+0x10/0x20

Signed-off-by: Niklas Söderlund <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue Apr 8, 2025
[ Upstream commit 62531a1 ]

A blocking notification chain uses a read-write semaphore to protect the
integrity of the chain. The semaphore is acquired for writing when
adding / removing notifiers to / from the chain and acquired for reading
when traversing the chain and informing notifiers about an event.

In case of the blocking switchdev notification chain, recursive
notifications are possible which leads to the semaphore being acquired
twice for reading and to lockdep warnings being generated [1].

Specifically, this can happen when the bridge driver processes a
SWITCHDEV_BRPORT_UNOFFLOADED event which causes it to emit notifications
about deferred events when calling switchdev_deferred_process().

Fix this by converting the notification chain to a raw notification
chain in a similar fashion to the netdev notification chain. Protect
the chain using the RTNL mutex by acquiring it when modifying the chain.
Events are always informed under the RTNL mutex, but add an assertion in
call_switchdev_blocking_notifiers() to make sure this is not violated in
the future.

Maintain the "blocking" prefix as events are always emitted from process
context and listeners are allowed to block.

[1]:
WARNING: possible recursive locking detected
6.14.0-rc4-custom-g079270089484 #1 Not tainted
--------------------------------------------
ip/52731 is trying to acquire lock:
ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0

but task is already holding lock:
ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0

other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock((switchdev_blocking_notif_chain).rwsem);
lock((switchdev_blocking_notif_chain).rwsem);

*** DEADLOCK ***
May be due to missing lock nesting notation
3 locks held by ip/52731:
 #0: ffffffff84f795b0 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_newlink+0x727/0x1dc0
 #1: ffffffff8731f628 (&net->rtnl_mutex){+.+.}-{4:4}, at: rtnl_newlink+0x790/0x1dc0
 #2: ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0

stack backtrace:
...
? __pfx_down_read+0x10/0x10
? __pfx_mark_lock+0x10/0x10
? __pfx_switchdev_port_attr_set_deferred+0x10/0x10
blocking_notifier_call_chain+0x58/0xa0
switchdev_port_attr_notify.constprop.0+0xb3/0x1b0
? __pfx_switchdev_port_attr_notify.constprop.0+0x10/0x10
? mark_held_locks+0x94/0xe0
? switchdev_deferred_process+0x11a/0x340
switchdev_port_attr_set_deferred+0x27/0xd0
switchdev_deferred_process+0x164/0x340
br_switchdev_port_unoffload+0xc8/0x100 [bridge]
br_switchdev_blocking_event+0x29f/0x580 [bridge]
notifier_call_chain+0xa2/0x440
blocking_notifier_call_chain+0x6e/0xa0
switchdev_bridge_port_unoffload+0xde/0x1a0
...

Fixes: f7a70d6 ("net: bridge: switchdev: Ensure deferred event delivery on unoffload")
Signed-off-by: Amit Cohen <[email protected]>
Reviewed-by: Ido Schimmel <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Tested-by: Vladimir Oltean <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 2d117e6 ]

During a module removal, kvm_exit invokes arch specific disable
call which disables AIA. However, we invoke aia_exit before kvm_exit
resulting in the following warning. KVM kernel module can't be inserted
afterwards due to inconsistent state of IRQ.

[25469.031389] percpu IRQ 31 still enabled on CPU0!
[25469.031732] WARNING: CPU: 3 PID: 943 at kernel/irq/manage.c:2476 __free_percpu_irq+0xa2/0x150
[25469.031804] Modules linked in: kvm(-)
[25469.031848] CPU: 3 UID: 0 PID: 943 Comm: rmmod Not tainted 6.14.0-rc5-06947-g91c763118f47-dirty #2
[25469.031905] Hardware name: riscv-virtio,qemu (DT)
[25469.031928] epc : __free_percpu_irq+0xa2/0x150
[25469.031976]  ra : __free_percpu_irq+0xa2/0x150
[25469.032197] epc : ffffffff8007db1e ra : ffffffff8007db1e sp : ff2000000088bd50
[25469.032241]  gp : ffffffff8131cef8 tp : ff60000080b96400 t0 : ff2000000088baf8
[25469.032285]  t1 : fffffffffffffffc t2 : 5249207570637265 s0 : ff2000000088bd90
[25469.032329]  s1 : ff60000098b21080 a0 : 037d527a15eb4f00 a1 : 037d527a15eb4f00
[25469.032372]  a2 : 0000000000000023 a3 : 0000000000000001 a4 : ffffffff8122dbf8
[25469.032410]  a5 : 0000000000000fff a6 : 0000000000000000 a7 : ffffffff8122dc10
[25469.032448]  s2 : ff60000080c22eb0 s3 : 0000000200000022 s4 : 000000000000001f
[25469.032488]  s5 : ff60000080c22e00 s6 : ffffffff80c351c0 s7 : 0000000000000000
[25469.032582]  s8 : 0000000000000003 s9 : 000055556b7fb490 s10: 00007ffff0e12fa0
[25469.032621]  s11: 00007ffff0e13e9a t3 : ffffffff81354ac7 t4 : ffffffff81354ac7
[25469.032664]  t5 : ffffffff81354ac8 t6 : ffffffff81354ac7
[25469.032698] status: 0000000200000100 badaddr: ffffffff8007db1e cause: 0000000000000003
[25469.032738] [<ffffffff8007db1e>] __free_percpu_irq+0xa2/0x150
[25469.032797] [<ffffffff8007dbfc>] free_percpu_irq+0x30/0x5e
[25469.032856] [<ffffffff013a57dc>] kvm_riscv_aia_exit+0x40/0x42 [kvm]
[25469.033947] [<ffffffff013b4e82>] cleanup_module+0x10/0x32 [kvm]
[25469.035300] [<ffffffff8009b150>] __riscv_sys_delete_module+0x18e/0x1fc
[25469.035374] [<ffffffff8000c1ca>] syscall_handler+0x3a/0x46
[25469.035456] [<ffffffff809ec9a4>] do_trap_ecall_u+0x72/0x134
[25469.035536] [<ffffffff809f5e18>] handle_exception+0x148/0x156

Invoke aia_exit and other arch specific cleanup functions after kvm_exit
so that disable gets a chance to be called first before exit.

Fixes: 54e4332 ("RISC-V: KVM: Initial skeletal support for AIA")
Fixes: eded675 ("riscv: KVM: add basic support for host vs guest profiling")
Signed-off-by: Atish Patra <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Reviewed-by: Sean Christopherson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
…void Priority Inversion in SRIOV

[ Upstream commit dc0297f ]

RLCG Register Access is a way for virtual functions to safely access GPU
registers in a virtualized environment., including TLB flushes and
register reads. When multiple threads or VFs try to access the same
registers simultaneously, it can lead to race conditions. By using the
RLCG interface, the driver can serialize access to the registers. This
means that only one thread can access the registers at a time,
preventing conflicts and ensuring that operations are performed
correctly. Additionally, when a low-priority task holds a mutex that a
high-priority task needs, ie., If a thread holding a spinlock tries to
acquire a mutex, it can lead to priority inversion. register access in
amdgpu_virt_rlcg_reg_rw especially in a fast code path is critical.

The call stack shows that the function amdgpu_virt_rlcg_reg_rw is being
called, which attempts to acquire the mutex. This function is invoked
from amdgpu_sriov_wreg, which in turn is called from
gmc_v11_0_flush_gpu_tlb.

The [ BUG: Invalid wait context ] indicates that a thread is trying to
acquire a mutex while it is in a context that does not allow it to sleep
(like holding a spinlock).

Fixes the below:

[  253.013423] =============================
[  253.013434] [ BUG: Invalid wait context ]
[  253.013446] 6.12.0-amdstaging-drm-next-lol-050225 #14 Tainted: G     U     OE
[  253.013464] -----------------------------
[  253.013475] kworker/0:1/10 is trying to lock:
[  253.013487] ffff9f30542e3cf8 (&adev->virt.rlcg_reg_lock){+.+.}-{3:3}, at: amdgpu_virt_rlcg_reg_rw+0xf6/0x330 [amdgpu]
[  253.013815] other info that might help us debug this:
[  253.013827] context-{4:4}
[  253.013835] 3 locks held by kworker/0:1/10:
[  253.013847]  #0: ffff9f3040050f58 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x3f5/0x680
[  253.013877]  #1: ffffb789c008be40 ((work_completion)(&wfc.work)){+.+.}-{0:0}, at: process_one_work+0x1d6/0x680
[  253.013905]  #2: ffff9f3054281838 (&adev->gmc.invalidate_lock){+.+.}-{2:2}, at: gmc_v11_0_flush_gpu_tlb+0x198/0x4f0 [amdgpu]
[  253.014154] stack backtrace:
[  253.014164] CPU: 0 UID: 0 PID: 10 Comm: kworker/0:1 Tainted: G     U     OE      6.12.0-amdstaging-drm-next-lol-050225 #14
[  253.014189] Tainted: [U]=USER, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[  253.014203] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.1 11/18/2024
[  253.014224] Workqueue: events work_for_cpu_fn
[  253.014241] Call Trace:
[  253.014250]  <TASK>
[  253.014260]  dump_stack_lvl+0x9b/0xf0
[  253.014275]  dump_stack+0x10/0x20
[  253.014287]  __lock_acquire+0xa47/0x2810
[  253.014303]  ? srso_alias_return_thunk+0x5/0xfbef5
[  253.014321]  lock_acquire+0xd1/0x300
[  253.014333]  ? amdgpu_virt_rlcg_reg_rw+0xf6/0x330 [amdgpu]
[  253.014562]  ? __lock_acquire+0xa6b/0x2810
[  253.014578]  __mutex_lock+0x85/0xe20
[  253.014591]  ? amdgpu_virt_rlcg_reg_rw+0xf6/0x330 [amdgpu]
[  253.014782]  ? sched_clock_noinstr+0x9/0x10
[  253.014795]  ? srso_alias_return_thunk+0x5/0xfbef5
[  253.014808]  ? local_clock_noinstr+0xe/0xc0
[  253.014822]  ? amdgpu_virt_rlcg_reg_rw+0xf6/0x330 [amdgpu]
[  253.015012]  ? srso_alias_return_thunk+0x5/0xfbef5
[  253.015029]  mutex_lock_nested+0x1b/0x30
[  253.015044]  ? mutex_lock_nested+0x1b/0x30
[  253.015057]  amdgpu_virt_rlcg_reg_rw+0xf6/0x330 [amdgpu]
[  253.015249]  amdgpu_sriov_wreg+0xc5/0xd0 [amdgpu]
[  253.015435]  gmc_v11_0_flush_gpu_tlb+0x44b/0x4f0 [amdgpu]
[  253.015667]  gfx_v11_0_hw_init+0x499/0x29c0 [amdgpu]
[  253.015901]  ? __pfx_smu_v13_0_update_pcie_parameters+0x10/0x10 [amdgpu]
[  253.016159]  ? srso_alias_return_thunk+0x5/0xfbef5
[  253.016173]  ? smu_hw_init+0x18d/0x300 [amdgpu]
[  253.016403]  amdgpu_device_init+0x29ad/0x36a0 [amdgpu]
[  253.016614]  amdgpu_driver_load_kms+0x1a/0xc0 [amdgpu]
[  253.017057]  amdgpu_pci_probe+0x1c2/0x660 [amdgpu]
[  253.017493]  local_pci_probe+0x4b/0xb0
[  253.017746]  work_for_cpu_fn+0x1a/0x30
[  253.017995]  process_one_work+0x21e/0x680
[  253.018248]  worker_thread+0x190/0x330
[  253.018500]  ? __pfx_worker_thread+0x10/0x10
[  253.018746]  kthread+0xe7/0x120
[  253.018988]  ? __pfx_kthread+0x10/0x10
[  253.019231]  ret_from_fork+0x3c/0x60
[  253.019468]  ? __pfx_kthread+0x10/0x10
[  253.019701]  ret_from_fork_asm+0x1a/0x30
[  253.019939]  </TASK>

v2: s/spin_trylock/spin_lock_irqsave to be safe (Christian).

Fixes: e864180 ("drm/amdgpu: Add lock around VF RLCG interface")
Cc: lin cao <[email protected]>
Cc: Jingwen Chen <[email protected]>
Cc: Victor Skvortsov <[email protected]>
Cc: Zhigang Luo <[email protected]>
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Suggested-by: Alex Deucher <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
…ate_pagetables'

[ Upstream commit fddc450 ]

This commit addresses a circular locking dependency in the
svm_range_cpu_invalidate_pagetables function. The function previously
held a lock while determining whether to perform an unmap or eviction
operation, which could lead to deadlocks.

Fixes the below:

[  223.418794] ======================================================
[  223.418820] WARNING: possible circular locking dependency detected
[  223.418845] 6.12.0-amdstaging-drm-next-lol-050225 #14 Tainted: G     U     OE
[  223.418869] ------------------------------------------------------
[  223.418889] kfdtest/3939 is trying to acquire lock:
[  223.418906] ffff8957552eae38 (&dqm->lock_hidden){+.+.}-{3:3}, at: evict_process_queues_cpsch+0x43/0x210 [amdgpu]
[  223.419302]
               but task is already holding lock:
[  223.419303] ffff8957556b83b0 (&prange->lock){+.+.}-{3:3}, at: svm_range_cpu_invalidate_pagetables+0x9d/0x850 [amdgpu]
[  223.419447] Console: switching to colour dummy device 80x25
[  223.419477] [IGT] amd_basic: executing
[  223.419599]
               which lock already depends on the new lock.

[  223.419611]
               the existing dependency chain (in reverse order) is:
[  223.419621]
               -> #2 (&prange->lock){+.+.}-{3:3}:
[  223.419636]        __mutex_lock+0x85/0xe20
[  223.419647]        mutex_lock_nested+0x1b/0x30
[  223.419656]        svm_range_validate_and_map+0x2f1/0x15b0 [amdgpu]
[  223.419954]        svm_range_set_attr+0xe8c/0x1710 [amdgpu]
[  223.420236]        svm_ioctl+0x46/0x50 [amdgpu]
[  223.420503]        kfd_ioctl_svm+0x50/0x90 [amdgpu]
[  223.420763]        kfd_ioctl+0x409/0x6d0 [amdgpu]
[  223.421024]        __x64_sys_ioctl+0x95/0xd0
[  223.421036]        x64_sys_call+0x1205/0x20d0
[  223.421047]        do_syscall_64+0x87/0x140
[  223.421056]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[  223.421068]
               -> #1 (reservation_ww_class_mutex){+.+.}-{3:3}:
[  223.421084]        __ww_mutex_lock.constprop.0+0xab/0x1560
[  223.421095]        ww_mutex_lock+0x2b/0x90
[  223.421103]        amdgpu_amdkfd_alloc_gtt_mem+0xcc/0x2b0 [amdgpu]
[  223.421361]        add_queue_mes+0x3bc/0x440 [amdgpu]
[  223.421623]        unhalt_cpsch+0x1ae/0x240 [amdgpu]
[  223.421888]        kgd2kfd_start_sched+0x5e/0xd0 [amdgpu]
[  223.422148]        amdgpu_amdkfd_start_sched+0x3d/0x50 [amdgpu]
[  223.422414]        amdgpu_gfx_enforce_isolation_handler+0x132/0x270 [amdgpu]
[  223.422662]        process_one_work+0x21e/0x680
[  223.422673]        worker_thread+0x190/0x330
[  223.422682]        kthread+0xe7/0x120
[  223.422690]        ret_from_fork+0x3c/0x60
[  223.422699]        ret_from_fork_asm+0x1a/0x30
[  223.422708]
               -> #0 (&dqm->lock_hidden){+.+.}-{3:3}:
[  223.422723]        __lock_acquire+0x16f4/0x2810
[  223.422734]        lock_acquire+0xd1/0x300
[  223.422742]        __mutex_lock+0x85/0xe20
[  223.422751]        mutex_lock_nested+0x1b/0x30
[  223.422760]        evict_process_queues_cpsch+0x43/0x210 [amdgpu]
[  223.423025]        kfd_process_evict_queues+0x8a/0x1d0 [amdgpu]
[  223.423285]        kgd2kfd_quiesce_mm+0x43/0x90 [amdgpu]
[  223.423540]        svm_range_cpu_invalidate_pagetables+0x4a7/0x850 [amdgpu]
[  223.423807]        __mmu_notifier_invalidate_range_start+0x1f5/0x250
[  223.423819]        copy_page_range+0x1e94/0x1ea0
[  223.423829]        copy_process+0x172f/0x2ad0
[  223.423839]        kernel_clone+0x9c/0x3f0
[  223.423847]        __do_sys_clone+0x66/0x90
[  223.423856]        __x64_sys_clone+0x25/0x30
[  223.423864]        x64_sys_call+0x1d7c/0x20d0
[  223.423872]        do_syscall_64+0x87/0x140
[  223.423880]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[  223.423891]
               other info that might help us debug this:

[  223.423903] Chain exists of:
                 &dqm->lock_hidden --> reservation_ww_class_mutex --> &prange->lock

[  223.423926]  Possible unsafe locking scenario:

[  223.423935]        CPU0                    CPU1
[  223.423942]        ----                    ----
[  223.423949]   lock(&prange->lock);
[  223.423958]                                lock(reservation_ww_class_mutex);
[  223.423970]                                lock(&prange->lock);
[  223.423981]   lock(&dqm->lock_hidden);
[  223.423990]
                *** DEADLOCK ***

[  223.423999] 5 locks held by kfdtest/3939:
[  223.424006]  #0: ffffffffb82b4fc0 (dup_mmap_sem){.+.+}-{0:0}, at: copy_process+0x1387/0x2ad0
[  223.424026]  #1: ffff89575eda81b0 (&mm->mmap_lock){++++}-{3:3}, at: copy_process+0x13a8/0x2ad0
[  223.424046]  #2: ffff89575edaf3b0 (&mm->mmap_lock/1){+.+.}-{3:3}, at: copy_process+0x13e4/0x2ad0
[  223.424066]  #3: ffffffffb82e76e0 (mmu_notifier_invalidate_range_start){+.+.}-{0:0}, at: copy_page_range+0x1cea/0x1ea0
[  223.424088]  #4: ffff8957556b83b0 (&prange->lock){+.+.}-{3:3}, at: svm_range_cpu_invalidate_pagetables+0x9d/0x850 [amdgpu]
[  223.424365]
               stack backtrace:
[  223.424374] CPU: 0 UID: 0 PID: 3939 Comm: kfdtest Tainted: G     U     OE      6.12.0-amdstaging-drm-next-lol-050225 #14
[  223.424392] Tainted: [U]=USER, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[  223.424401] Hardware name: Gigabyte Technology Co., Ltd. X570 AORUS PRO WIFI/X570 AORUS PRO WIFI, BIOS F36a 02/16/2022
[  223.424416] Call Trace:
[  223.424423]  <TASK>
[  223.424430]  dump_stack_lvl+0x9b/0xf0
[  223.424441]  dump_stack+0x10/0x20
[  223.424449]  print_circular_bug+0x275/0x350
[  223.424460]  check_noncircular+0x157/0x170
[  223.424469]  ? __bfs+0xfd/0x2c0
[  223.424481]  __lock_acquire+0x16f4/0x2810
[  223.424490]  ? srso_return_thunk+0x5/0x5f
[  223.424505]  lock_acquire+0xd1/0x300
[  223.424514]  ? evict_process_queues_cpsch+0x43/0x210 [amdgpu]
[  223.424783]  __mutex_lock+0x85/0xe20
[  223.424792]  ? evict_process_queues_cpsch+0x43/0x210 [amdgpu]
[  223.425058]  ? srso_return_thunk+0x5/0x5f
[  223.425067]  ? mark_held_locks+0x54/0x90
[  223.425076]  ? evict_process_queues_cpsch+0x43/0x210 [amdgpu]
[  223.425339]  ? srso_return_thunk+0x5/0x5f
[  223.425350]  mutex_lock_nested+0x1b/0x30
[  223.425358]  ? mutex_lock_nested+0x1b/0x30
[  223.425367]  evict_process_queues_cpsch+0x43/0x210 [amdgpu]
[  223.425631]  kfd_process_evict_queues+0x8a/0x1d0 [amdgpu]
[  223.425893]  kgd2kfd_quiesce_mm+0x43/0x90 [amdgpu]
[  223.426156]  svm_range_cpu_invalidate_pagetables+0x4a7/0x850 [amdgpu]
[  223.426423]  ? srso_return_thunk+0x5/0x5f
[  223.426436]  __mmu_notifier_invalidate_range_start+0x1f5/0x250
[  223.426450]  copy_page_range+0x1e94/0x1ea0
[  223.426461]  ? srso_return_thunk+0x5/0x5f
[  223.426474]  ? srso_return_thunk+0x5/0x5f
[  223.426484]  ? lock_acquire+0xd1/0x300
[  223.426494]  ? copy_process+0x1718/0x2ad0
[  223.426502]  ? srso_return_thunk+0x5/0x5f
[  223.426510]  ? sched_clock_noinstr+0x9/0x10
[  223.426519]  ? local_clock_noinstr+0xe/0xc0
[  223.426528]  ? copy_process+0x1718/0x2ad0
[  223.426537]  ? srso_return_thunk+0x5/0x5f
[  223.426550]  copy_process+0x172f/0x2ad0
[  223.426569]  kernel_clone+0x9c/0x3f0
[  223.426577]  ? __schedule+0x4c9/0x1b00
[  223.426586]  ? srso_return_thunk+0x5/0x5f
[  223.426594]  ? sched_clock_noinstr+0x9/0x10
[  223.426602]  ? srso_return_thunk+0x5/0x5f
[  223.426610]  ? local_clock_noinstr+0xe/0xc0
[  223.426619]  ? schedule+0x107/0x1a0
[  223.426629]  __do_sys_clone+0x66/0x90
[  223.426643]  __x64_sys_clone+0x25/0x30
[  223.426652]  x64_sys_call+0x1d7c/0x20d0
[  223.426661]  do_syscall_64+0x87/0x140
[  223.426671]  ? srso_return_thunk+0x5/0x5f
[  223.426679]  ? common_nsleep+0x44/0x50
[  223.426690]  ? srso_return_thunk+0x5/0x5f
[  223.426698]  ? trace_hardirqs_off+0x52/0xd0
[  223.426709]  ? srso_return_thunk+0x5/0x5f
[  223.426717]  ? syscall_exit_to_user_mode+0xcc/0x200
[  223.426727]  ? srso_return_thunk+0x5/0x5f
[  223.426736]  ? do_syscall_64+0x93/0x140
[  223.426748]  ? srso_return_thunk+0x5/0x5f
[  223.426756]  ? up_write+0x1c/0x1e0
[  223.426765]  ? srso_return_thunk+0x5/0x5f
[  223.426775]  ? srso_return_thunk+0x5/0x5f
[  223.426783]  ? trace_hardirqs_off+0x52/0xd0
[  223.426792]  ? srso_return_thunk+0x5/0x5f
[  223.426800]  ? syscall_exit_to_user_mode+0xcc/0x200
[  223.426810]  ? srso_return_thunk+0x5/0x5f
[  223.426818]  ? do_syscall_64+0x93/0x140
[  223.426826]  ? syscall_exit_to_user_mode+0xcc/0x200
[  223.426836]  ? srso_return_thunk+0x5/0x5f
[  223.426844]  ? do_syscall_64+0x93/0x140
[  223.426853]  ? srso_return_thunk+0x5/0x5f
[  223.426861]  ? irqentry_exit+0x6b/0x90
[  223.426869]  ? srso_return_thunk+0x5/0x5f
[  223.426877]  ? exc_page_fault+0xa7/0x2c0
[  223.426888]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[  223.426898] RIP: 0033:0x7f46758eab57
[  223.426906] Code: ba 04 00 f3 0f 1e fa 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 41 41 89 c0 85 c0 75 2c 64 48 8b 04 25 10 00
[  223.426930] RSP: 002b:00007fff5c3e5188 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
[  223.426943] RAX: ffffffffffffffda RBX: 00007f4675f8c040 RCX: 00007f46758eab57
[  223.426954] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
[  223.426965] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[  223.426975] R10: 00007f4675e81a50 R11: 0000000000000246 R12: 0000000000000001
[  223.426986] R13: 00007fff5c3e5470 R14: 00007fff5c3e53e0 R15: 00007fff5c3e5410
[  223.427004]  </TASK>

v2: To resolve this issue, the allocation of the process context buffer
(`proc_ctx_bo`) has been moved from the `add_queue_mes` function to the
`pqm_create_queue` function. This change ensures that the buffer is
allocated only when the first queue for a process is created and only if
the Micro Engine Scheduler (MES) is enabled. (Felix)

v3: Fix typo s/Memory Execution Scheduler (MES)/Micro Engine Scheduler
in commit message. (Lijo)

Fixes: 438b39a ("drm/amdkfd: pause autosuspend when creating pdd")
Cc: Jesse Zhang <[email protected]>
Cc: Yunxiang Li <[email protected]>
Cc: Philip Yang <[email protected]>
Cc: Alex Sierra <[email protected]>
Cc: Felix Kuehling <[email protected]>
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 888751e ]

perf test 11 hwmon fails on s390 with this error

 # ./perf test -Fv 11
 --- start ---
 ---- end ----
 11.1: Basic parsing test             : Ok
 --- start ---
 Testing 'temp_test_hwmon_event1'
 Using CPUID IBM,3931,704,A01,3.7,002f
 temp_test_hwmon_event1 -> hwmon_a_test_hwmon_pmu/temp_test_hwmon_event1/
 FAILED tests/hwmon_pmu.c:189 Unexpected config for
    'temp_test_hwmon_event1', 292470092988416 != 655361
 ---- end ----
 11.2: Parsing without PMU name       : FAILED!
 --- start ---
 Testing 'hwmon_a_test_hwmon_pmu/temp_test_hwmon_event1/'
 FAILED tests/hwmon_pmu.c:189 Unexpected config for
    'hwmon_a_test_hwmon_pmu/temp_test_hwmon_event1/',
    292470092988416 != 655361
 ---- end ----
 11.3: Parsing with PMU name          : FAILED!
 #

The root cause is in member test_event::config which is initialized
to 0xA0001 or 655361. During event parsing a long list event parsing
functions are called and end up with this gdb call stack:

 #0  hwmon_pmu__config_term (hwm=0x168dfd0, attr=0x3ffffff5ee8,
	term=0x168db60, err=0x3ffffff81c8) at util/hwmon_pmu.c:623
 #1  hwmon_pmu__config_terms (pmu=0x168dfd0, attr=0x3ffffff5ee8,
	terms=0x3ffffff5ea8, err=0x3ffffff81c8) at util/hwmon_pmu.c:662
 #2  0x00000000012f870c in perf_pmu__config_terms (pmu=0x168dfd0,
	attr=0x3ffffff5ee8, terms=0x3ffffff5ea8, zero=false,
	apply_hardcoded=false, err=0x3ffffff81c8) at util/pmu.c:1519
 #3  0x00000000012f88a4 in perf_pmu__config (pmu=0x168dfd0, attr=0x3ffffff5ee8,
	head_terms=0x3ffffff5ea8, apply_hardcoded=false, err=0x3ffffff81c8)
	at util/pmu.c:1545
 #4  0x00000000012680c4 in parse_events_add_pmu (parse_state=0x3ffffff7fb8,
	list=0x168dc00, pmu=0x168dfd0, const_parsed_terms=0x3ffffff6090,
	auto_merge_stats=true, alternate_hw_config=10)
	at util/parse-events.c:1508
 #5  0x00000000012684c6 in parse_events_multi_pmu_add (parse_state=0x3ffffff7fb8,
	event_name=0x168ec10 "temp_test_hwmon_event1", hw_config=10,
	const_parsed_terms=0x0, listp=0x3ffffff6230, loc_=0x3ffffff70e0)
	at util/parse-events.c:1592
 #6  0x00000000012f0e4e in parse_events_parse (_parse_state=0x3ffffff7fb8,
	scanner=0x16878c0) at util/parse-events.y:293
 #7  0x00000000012695a0 in parse_events__scanner (str=0x3ffffff81d8
	"temp_test_hwmon_event1", input=0x0, parse_state=0x3ffffff7fb8)
	at util/parse-events.c:1867
 #8  0x000000000126a1e8 in __parse_events (evlist=0x168b580,
	str=0x3ffffff81d8 "temp_test_hwmon_event1", pmu_filter=0x0,
	err=0x3ffffff81c8, fake_pmu=false, warn_if_reordered=true,
	fake_tp=false) at util/parse-events.c:2136
 #9  0x00000000011e36aa in parse_events (evlist=0x168b580,
	str=0x3ffffff81d8 "temp_test_hwmon_event1", err=0x3ffffff81c8)
	at /root/linux/tools/perf/util/parse-events.h:41
 #10 0x00000000011e3e64 in do_test (i=0, with_pmu=false, with_alias=false)
	at tests/hwmon_pmu.c:164
 #11 0x00000000011e422c in test__hwmon_pmu (with_pmu=false)
	at tests/hwmon_pmu.c:219
 #12 0x00000000011e431c in test__hwmon_pmu_without_pmu (test=0x1610368
	<suite.hwmon_pmu>, subtest=1) at tests/hwmon_pmu.c:23

where the attr::config is set to value 292470092988416 or 0x10a0000000000
in line 625 of file ./util/hwmon_pmu.c:

   attr->config = key.type_and_num;

However member key::type_and_num is defined as union and bit field:

   union hwmon_pmu_event_key {
        long type_and_num;
        struct {
                int num :16;
                enum hwmon_type type :8;
        };
   };

s390 is big endian and Intel is little endian architecture.
The events for the hwmon dummy pmu have num = 1 or num = 2 and
type is set to HWMON_TYPE_TEMP (which is 10).
On s390 this assignes member key::type_and_num the value of
0x10a0000000000 (which is 292470092988416) as shown in above
trace output.

Fix this and export the structure/union hwmon_pmu_event_key
so the test shares the same implementation as the event parsing
functions for union and bit fields. This should avoid
endianess issues on all platforms.

Output after:
 # ./perf test -F 11
 11.1: Basic parsing test         : Ok
 11.2: Parsing without PMU name   : Ok
 11.3: Parsing with PMU name      : Ok
 #

Fixes: 531ee0f ("perf test: Add hwmon "PMU" test")
Signed-off-by: Thomas Richter <[email protected]>
Reviewed-by: Ian Rogers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 053f3ff ]

v2:
- Created a single error handling unlock and exit in veth_pool_store
- Greatly expanded commit message with previous explanatory-only text

Summary: Use rtnl_mutex to synchronize veth_pool_store with itself,
ibmveth_close and ibmveth_open, preventing multiple calls in a row to
napi_disable.

Background: Two (or more) threads could call veth_pool_store through
writing to /sys/devices/vio/30000002/pool*/*. You can do this easily
with a little shell script. This causes a hang.

I configured LOCKDEP, compiled ibmveth.c with DEBUG, and built a new
kernel. I ran this test again and saw:

    Setting pool0/active to 0
    Setting pool1/active to 1
    [   73.911067][ T4365] ibmveth 30000002 eth0: close starting
    Setting pool1/active to 1
    Setting pool1/active to 0
    [   73.911367][ T4366] ibmveth 30000002 eth0: close starting
    [   73.916056][ T4365] ibmveth 30000002 eth0: close complete
    [   73.916064][ T4365] ibmveth 30000002 eth0: open starting
    [  110.808564][  T712] systemd-journald[712]: Sent WATCHDOG=1 notification.
    [  230.808495][  T712] systemd-journald[712]: Sent WATCHDOG=1 notification.
    [  243.683786][  T123] INFO: task stress.sh:4365 blocked for more than 122 seconds.
    [  243.683827][  T123]       Not tainted 6.14.0-01103-g2df0c02dab82-dirty #8
    [  243.683833][  T123] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [  243.683838][  T123] task:stress.sh       state:D stack:28096 pid:4365  tgid:4365  ppid:4364   task_flags:0x400040 flags:0x00042000
    [  243.683852][  T123] Call Trace:
    [  243.683857][  T123] [c00000000c38f690] [0000000000000001] 0x1 (unreliable)
    [  243.683868][  T123] [c00000000c38f840] [c00000000001f908] __switch_to+0x318/0x4e0
    [  243.683878][  T123] [c00000000c38f8a0] [c000000001549a70] __schedule+0x500/0x12a0
    [  243.683888][  T123] [c00000000c38f9a0] [c00000000154a878] schedule+0x68/0x210
    [  243.683896][  T123] [c00000000c38f9d0] [c00000000154ac80] schedule_preempt_disabled+0x30/0x50
    [  243.683904][  T123] [c00000000c38fa00] [c00000000154dbb0] __mutex_lock+0x730/0x10f0
    [  243.683913][  T123] [c00000000c38fb10] [c000000001154d40] napi_enable+0x30/0x60
    [  243.683921][  T123] [c00000000c38fb40] [c000000000f4ae94] ibmveth_open+0x68/0x5dc
    [  243.683928][  T123] [c00000000c38fbe0] [c000000000f4aa20] veth_pool_store+0x220/0x270
    [  243.683936][  T123] [c00000000c38fc70] [c000000000826278] sysfs_kf_write+0x68/0xb0
    [  243.683944][  T123] [c00000000c38fcb0] [c0000000008240b8] kernfs_fop_write_iter+0x198/0x2d0
    [  243.683951][  T123] [c00000000c38fd00] [c00000000071b9ac] vfs_write+0x34c/0x650
    [  243.683958][  T123] [c00000000c38fdc0] [c00000000071bea8] ksys_write+0x88/0x150
    [  243.683966][  T123] [c00000000c38fe10] [c0000000000317f4] system_call_exception+0x124/0x340
    [  243.683973][  T123] [c00000000c38fe50] [c00000000000d05c] system_call_vectored_common+0x15c/0x2ec
    ...
    [  243.684087][  T123] Showing all locks held in the system:
    [  243.684095][  T123] 1 lock held by khungtaskd/123:
    [  243.684099][  T123]  #0: c00000000278e370 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x50/0x248
    [  243.684114][  T123] 4 locks held by stress.sh/4365:
    [  243.684119][  T123]  #0: c00000003a4cd3f8 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x88/0x150
    [  243.684132][  T123]  #1: c000000041aea888 (&of->mutex#2){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x154/0x2d0
    [  243.684143][  T123]  #2: c0000000366fb9a8 (kn->active#64){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x160/0x2d0
    [  243.684155][  T123]  #3: c000000035ff4cb8 (&dev->lock){+.+.}-{3:3}, at: napi_enable+0x30/0x60
    [  243.684166][  T123] 5 locks held by stress.sh/4366:
    [  243.684170][  T123]  #0: c00000003a4cd3f8 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x88/0x150
    [  243.684183][  T123]  #1: c00000000aee2288 (&of->mutex#2){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x154/0x2d0
    [  243.684194][  T123]  #2: c0000000366f4ba8 (kn->active#64){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x160/0x2d0
    [  243.684205][  T123]  #3: c000000035ff4cb8 (&dev->lock){+.+.}-{3:3}, at: napi_disable+0x30/0x60
    [  243.684216][  T123]  #4: c0000003ff9bbf18 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0x138/0x12a0

From the ibmveth debug, two threads are calling veth_pool_store, which
calls ibmveth_close and ibmveth_open. Here's the sequence:

  T4365             T4366
  ----------------- ----------------- ---------
  veth_pool_store   veth_pool_store
                    ibmveth_close
  ibmveth_close
  napi_disable
                    napi_disable
  ibmveth_open
  napi_enable                         <- HANG

ibmveth_close calls napi_disable at the top and ibmveth_open calls
napi_enable at the top.

https://docs.kernel.org/networking/napi.html]] says

  The control APIs are not idempotent. Control API calls are safe
  against concurrent use of datapath APIs but an incorrect sequence of
  control API calls may result in crashes, deadlocks, or race
  conditions. For example, calling napi_disable() multiple times in a
  row will deadlock.

In the normal open and close paths, rtnl_mutex is acquired to prevent
other callers. This is missing from veth_pool_store. Use rtnl_mutex in
veth_pool_store fixes these hangs.

Signed-off-by: Dave Marquardt <[email protected]>
Fixes: 860f242 ("[PATCH] ibmveth change buffer pools dynamically")
Reviewed-by: Nick Child <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
commit c11bcbc upstream.

Currently, zswap_cpu_comp_dead() calls crypto_free_acomp() while holding
the per-CPU acomp_ctx mutex.  crypto_free_acomp() then holds scomp_lock
(through crypto_exit_scomp_ops_async()).

On the other hand, crypto_alloc_acomp_node() holds the scomp_lock (through
crypto_scomp_init_tfm()), and then allocates memory.  If the allocation
results in reclaim, we may attempt to hold the per-CPU acomp_ctx mutex.

The above dependencies can cause an ABBA deadlock.  For example in the
following scenario:

(1) Task A running on CPU #1:
    crypto_alloc_acomp_node()
      Holds scomp_lock
      Enters reclaim
      Reads per_cpu_ptr(pool->acomp_ctx, 1)

(2) Task A is descheduled

(3) CPU #1 goes offline
    zswap_cpu_comp_dead(CPU #1)
      Holds per_cpu_ptr(pool->acomp_ctx, 1))
      Calls crypto_free_acomp()
      Waits for scomp_lock

(4) Task A running on CPU #2:
      Waits for per_cpu_ptr(pool->acomp_ctx, 1) // Read on CPU #1
      DEADLOCK

Since there is no requirement to call crypto_free_acomp() with the per-CPU
acomp_ctx mutex held in zswap_cpu_comp_dead(), move it after the mutex is
unlocked.  Also move the acomp_request_free() and kfree() calls for
consistency and to avoid any potential sublte locking dependencies in the
future.

With this, only setting acomp_ctx fields to NULL occurs with the mutex
held.  This is similar to how zswap_cpu_comp_prepare() only initializes
acomp_ctx fields with the mutex held, after performing all allocations
before holding the mutex.

Opportunistically, move the NULL check on acomp_ctx so that it takes place
before the mutex dereference.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 12dcb0e ("mm: zswap: properly synchronize freeing resources during CPU hotunplug")
Signed-off-by: Herbert Xu <[email protected]>
Co-developed-by: Herbert Xu <[email protected]>
Signed-off-by: Yosry Ahmed <[email protected]>
Reported-by: [email protected]
Closes: https://lore.kernel.org/all/[email protected]/
Acked-by: Herbert Xu <[email protected]>
Reviewed-by: Chengming Zhou <[email protected]>
Reviewed-by: Nhat Pham <[email protected]>
Tested-by: Nhat Pham <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Chris Murphy <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 52323ed ]

syzbot reported a deadlock in lock_system_sleep() (see below).

The write operation to "/sys/module/hibernate/parameters/compressor"
conflicts with the registration of ieee80211 device, resulting in a deadlock
when attempting to acquire system_transition_mutex under param_lock.

To avoid this deadlock, change hibernate_compressor_param_set() to use
mutex_trylock() for attempting to acquire system_transition_mutex and
return -EBUSY when it fails.

Task flags need not be saved or adjusted before calling
mutex_trylock(&system_transition_mutex) because the caller is not going
to end up waiting for this mutex and if it runs concurrently with system
suspend in progress, it will be frozen properly when it returns to user
space.

syzbot report:

syz-executor895/5833 is trying to acquire lock:
ffffffff8e0828c8 (system_transition_mutex){+.+.}-{4:4}, at: lock_system_sleep+0x87/0xa0 kernel/power/main.c:56

but task is already holding lock:
ffffffff8e07dc68 (param_lock){+.+.}-{4:4}, at: kernel_param_lock kernel/params.c:607 [inline]
ffffffff8e07dc68 (param_lock){+.+.}-{4:4}, at: param_attr_store+0xe6/0x300 kernel/params.c:586

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #3 (param_lock){+.+.}-{4:4}:
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
       ieee80211_rate_control_ops_get net/mac80211/rate.c:220 [inline]
       rate_control_alloc net/mac80211/rate.c:266 [inline]
       ieee80211_init_rate_ctrl_alg+0x18d/0x6b0 net/mac80211/rate.c:1015
       ieee80211_register_hw+0x20cd/0x4060 net/mac80211/main.c:1531
       mac80211_hwsim_new_radio+0x304e/0x54e0 drivers/net/wireless/virtual/mac80211_hwsim.c:5558
       init_mac80211_hwsim+0x432/0x8c0 drivers/net/wireless/virtual/mac80211_hwsim.c:6910
       do_one_initcall+0x128/0x700 init/main.c:1257
       do_initcall_level init/main.c:1319 [inline]
       do_initcalls init/main.c:1335 [inline]
       do_basic_setup init/main.c:1354 [inline]
       kernel_init_freeable+0x5c7/0x900 init/main.c:1568
       kernel_init+0x1c/0x2b0 init/main.c:1457
       ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

-> #2 (rtnl_mutex){+.+.}-{4:4}:
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
       wg_pm_notification drivers/net/wireguard/device.c:80 [inline]
       wg_pm_notification+0x49/0x180 drivers/net/wireguard/device.c:64
       notifier_call_chain+0xb7/0x410 kernel/notifier.c:85
       notifier_call_chain_robust kernel/notifier.c:120 [inline]
       blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline]
       blocking_notifier_call_chain_robust+0xc9/0x170 kernel/notifier.c:333
       pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102
       snapshot_open+0x189/0x2b0 kernel/power/user.c:77
       misc_open+0x35a/0x420 drivers/char/misc.c:179
       chrdev_open+0x237/0x6a0 fs/char_dev.c:414
       do_dentry_open+0x735/0x1c40 fs/open.c:956
       vfs_open+0x82/0x3f0 fs/open.c:1086
       do_open fs/namei.c:3830 [inline]
       path_openat+0x1e88/0x2d80 fs/namei.c:3989
       do_filp_open+0x20c/0x470 fs/namei.c:4016
       do_sys_openat2+0x17a/0x1e0 fs/open.c:1428
       do_sys_open fs/open.c:1443 [inline]
       __do_sys_openat fs/open.c:1459 [inline]
       __se_sys_openat fs/open.c:1454 [inline]
       __x64_sys_openat+0x175/0x210 fs/open.c:1454
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 ((pm_chain_head).rwsem){++++}-{4:4}:
       down_read+0x9a/0x330 kernel/locking/rwsem.c:1524
       blocking_notifier_call_chain_robust kernel/notifier.c:344 [inline]
       blocking_notifier_call_chain_robust+0xa9/0x170 kernel/notifier.c:333
       pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102
       snapshot_open+0x189/0x2b0 kernel/power/user.c:77
       misc_open+0x35a/0x420 drivers/char/misc.c:179
       chrdev_open+0x237/0x6a0 fs/char_dev.c:414
       do_dentry_open+0x735/0x1c40 fs/open.c:956
       vfs_open+0x82/0x3f0 fs/open.c:1086
       do_open fs/namei.c:3830 [inline]
       path_openat+0x1e88/0x2d80 fs/namei.c:3989
       do_filp_open+0x20c/0x470 fs/namei.c:4016
       do_sys_openat2+0x17a/0x1e0 fs/open.c:1428
       do_sys_open fs/open.c:1443 [inline]
       __do_sys_openat fs/open.c:1459 [inline]
       __se_sys_openat fs/open.c:1454 [inline]
       __x64_sys_openat+0x175/0x210 fs/open.c:1454
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (system_transition_mutex){+.+.}-{4:4}:
       check_prev_add kernel/locking/lockdep.c:3163 [inline]
       check_prevs_add kernel/locking/lockdep.c:3282 [inline]
       validate_chain kernel/locking/lockdep.c:3906 [inline]
       __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
       lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
       lock_system_sleep+0x87/0xa0 kernel/power/main.c:56
       hibernate_compressor_param_set+0x1c/0x210 kernel/power/hibernate.c:1452
       param_attr_store+0x18f/0x300 kernel/params.c:588
       module_attr_store+0x55/0x80 kernel/params.c:924
       sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:139
       kernfs_fop_write_iter+0x33d/0x500 fs/kernfs/file.c:334
       new_sync_write fs/read_write.c:586 [inline]
       vfs_write+0x5ae/0x1150 fs/read_write.c:679
       ksys_write+0x12b/0x250 fs/read_write.c:731
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  system_transition_mutex --> rtnl_mutex --> param_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(param_lock);
                               lock(rtnl_mutex);
                               lock(param_lock);
  lock(system_transition_mutex);

 *** DEADLOCK ***

Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=ace60642828c074eb913
Signed-off-by: Lizhi Xu <[email protected]>
Link: https://patch.msgid.link/[email protected]
[ rjw: New subject matching the code changes, changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit b61e69b ]

syzbot report a deadlock in diFree. [1]

When calling "ioctl$LOOP_SET_STATUS64", the offset value passed in is 4,
which does not match the mounted loop device, causing the mapping of the
mounted loop device to be invalidated.

When creating the directory and creating the inode of iag in diReadSpecial(),
read the page of fixed disk inode (AIT) in raw mode in read_metapage(), the
metapage data it returns is corrupted, which causes the nlink value of 0 to be
assigned to the iag inode when executing copy_from_dinode(), which ultimately
causes a deadlock when entering diFree().

To avoid this, first check the nlink value of dinode before setting iag inode.

[1]
WARNING: possible recursive locking detected
6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Not tainted
--------------------------------------------
syz-executor301/5309 is trying to acquire lock:
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889

but task is already holding lock:
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(imap->im_aglock[index]));
  lock(&(imap->im_aglock[index]));

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz-executor301/5309:
 #0: ffff8880422a4420 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515
 #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline]
 #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x260/0x540 fs/namei.c:4026
 #2: ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2460 [inline]
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocAG+0x4b7/0x1e50 fs/jfs/jfs_imap.c:1669
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2477 [inline]
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocAG+0x869/0x1e50 fs/jfs/jfs_imap.c:1669

stack backtrace:
CPU: 0 UID: 0 PID: 5309 Comm: syz-executor301 Not tainted 6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037
 check_deadlock kernel/locking/lockdep.c:3089 [inline]
 validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891
 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
 __mutex_lock_common kernel/locking/mutex.c:608 [inline]
 __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
 diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889
 jfs_evict_inode+0x32d/0x440 fs/jfs/inode.c:156
 evict+0x4e8/0x9b0 fs/inode.c:725
 diFreeSpecial fs/jfs/jfs_imap.c:552 [inline]
 duplicateIXtree+0x3c6/0x550 fs/jfs/jfs_imap.c:3022
 diNewIAG fs/jfs/jfs_imap.c:2597 [inline]
 diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 diAllocAG+0x17dc/0x1e50 fs/jfs/jfs_imap.c:1669
 diAlloc+0x1d2/0x1630 fs/jfs/jfs_imap.c:1590
 ialloc+0x8f/0x900 fs/jfs/jfs_inode.c:56
 jfs_mkdir+0x1c5/0xba0 fs/jfs/namei.c:225
 vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4257
 do_mkdirat+0x264/0x3a0 fs/namei.c:4280
 __do_sys_mkdirat fs/namei.c:4295 [inline]
 __se_sys_mkdirat fs/namei.c:4293 [inline]
 __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4293
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=355da3b3a74881008e8f
Signed-off-by: Edward Adam Davis <[email protected]>
Signed-off-by: Dave Kleikamp <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 27b9180 ]

With the device instance lock, there is now a possibility of a deadlock:

[    1.211455] ============================================
[    1.211571] WARNING: possible recursive locking detected
[    1.211687] 6.14.0-rc5-01215-g032756b4ca7a-dirty #5 Not tainted
[    1.211823] --------------------------------------------
[    1.211936] ip/184 is trying to acquire lock:
[    1.212032] ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_set_allmulti+0x4e/0xb0
[    1.212207]
[    1.212207] but task is already holding lock:
[    1.212332] ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_open+0x50/0xb0
[    1.212487]
[    1.212487] other info that might help us debug this:
[    1.212626]  Possible unsafe locking scenario:
[    1.212626]
[    1.212751]        CPU0
[    1.212815]        ----
[    1.212871]   lock(&dev->lock);
[    1.212944]   lock(&dev->lock);
[    1.213016]
[    1.213016]  *** DEADLOCK ***
[    1.213016]
[    1.213143]  May be due to missing lock nesting notation
[    1.213143]
[    1.213294] 3 locks held by ip/184:
[    1.213371]  #0: ffffffff838b53e0 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_nets_lock+0x1b/0xa0
[    1.213543]  #1: ffffffff84e5fc70 (&net->rtnl_mutex){+.+.}-{4:4}, at: rtnl_nets_lock+0x37/0xa0
[    1.213727]  #2: ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_open+0x50/0xb0
[    1.213895]
[    1.213895] stack backtrace:
[    1.213991] CPU: 0 UID: 0 PID: 184 Comm: ip Not tainted 6.14.0-rc5-01215-g032756b4ca7a-dirty #5
[    1.213993] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Arch Linux 1.16.3-1-1 04/01/2014
[    1.213994] Call Trace:
[    1.213995]  <TASK>
[    1.213996]  dump_stack_lvl+0x8e/0xd0
[    1.214000]  print_deadlock_bug+0x28b/0x2a0
[    1.214020]  lock_acquire+0xea/0x2a0
[    1.214027]  __mutex_lock+0xbf/0xd40
[    1.214038]  dev_set_allmulti+0x4e/0xb0 # real_dev->flags & IFF_ALLMULTI
[    1.214040]  vlan_dev_open+0xa5/0x170 # ndo_open on vlandev
[    1.214042]  __dev_open+0x145/0x270
[    1.214046]  __dev_change_flags+0xb0/0x1e0
[    1.214051]  netif_change_flags+0x22/0x60 # IFF_UP vlandev
[    1.214053]  dev_change_flags+0x61/0xb0 # for each device in group from dev->vlan_info
[    1.214055]  vlan_device_event+0x766/0x7c0 # on netdevsim0
[    1.214058]  notifier_call_chain+0x78/0x120
[    1.214062]  netif_open+0x6d/0x90
[    1.214064]  dev_open+0x5b/0xb0 # locks netdevsim0
[    1.214066]  bond_enslave+0x64c/0x1230
[    1.214075]  do_set_master+0x175/0x1e0 # on netdevsim0
[    1.214077]  do_setlink+0x516/0x13b0
[    1.214094]  rtnl_newlink+0xaba/0xb80
[    1.214132]  rtnetlink_rcv_msg+0x440/0x490
[    1.214144]  netlink_rcv_skb+0xeb/0x120
[    1.214150]  netlink_unicast+0x1f9/0x320
[    1.214153]  netlink_sendmsg+0x346/0x3f0
[    1.214157]  __sock_sendmsg+0x86/0xb0
[    1.214160]  ____sys_sendmsg+0x1c8/0x220
[    1.214164]  ___sys_sendmsg+0x28f/0x2d0
[    1.214179]  __x64_sys_sendmsg+0xef/0x140
[    1.214184]  do_syscall_64+0xec/0x1d0
[    1.214190]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[    1.214191] RIP: 0033:0x7f2d1b4a7e56

Device setup:

     netdevsim0 (down)
     ^        ^
  bond        netdevsim1.100@netdevsim1 allmulticast=on (down)

When we enslave the lower device (netdevsim0) which has a vlan, we
propagate vlan's allmuti/promisc flags during ndo_open. This causes
(re)locking on of the real_dev.

Propagate allmulti/promisc on flags change, not on the open. There
is a slight semantics change that vlans that are down now propagate
the flags, but this seems unlikely to result in the real issues.

Reproducer:

  echo 0 1 > /sys/bus/netdevsim/new_device

  dev_path=$(ls -d /sys/bus/netdevsim/devices/netdevsim0/net/*)
  dev=$(echo $dev_path | rev | cut -d/ -f1 | rev)

  ip link set dev $dev name netdevsim0
  ip link set dev netdevsim0 up

  ip link add link netdevsim0 name netdevsim0.100 type vlan id 100
  ip link set dev netdevsim0.100 allmulticast on down
  ip link add name bond1 type bond mode 802.3ad
  ip link set dev netdevsim0 down
  ip link set dev netdevsim0 master bond1
  ip link set dev bond1 up
  ip link show

Reported-by: [email protected]
Closes: https://lore.kernel.org/netdev/Z9CfXjLMKn6VLG5d@mini-arch/T/#m15ba130f53227c883e79fb969687d69d670337a0
Signed-off-by: Stanislav Fomichev <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
commit 93ae6e6 upstream.

We have recently seen report of lockdep circular lock dependency warnings
on platforms like Skylake and Kabylake:

 ======================================================
 WARNING: possible circular locking dependency detected
 6.14.0-rc6-CI_DRM_16276-gca2c04fe76e8+ #1 Not tainted
 ------------------------------------------------------
 swapper/0/1 is trying to acquire lock:
 ffffffff8360ee48 (iommu_probe_device_lock){+.+.}-{3:3},
   at: iommu_probe_device+0x1d/0x70

 but task is already holding lock:
 ffff888102c7efa8 (&device->physical_node_lock){+.+.}-{3:3},
   at: intel_iommu_init+0xe75/0x11f0

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -> #6 (&device->physical_node_lock){+.+.}-{3:3}:
        __mutex_lock+0xb4/0xe40
        mutex_lock_nested+0x1b/0x30
        intel_iommu_init+0xe75/0x11f0
        pci_iommu_init+0x13/0x70
        do_one_initcall+0x62/0x3f0
        kernel_init_freeable+0x3da/0x6a0
        kernel_init+0x1b/0x200
        ret_from_fork+0x44/0x70
        ret_from_fork_asm+0x1a/0x30

 -> #5 (dmar_global_lock){++++}-{3:3}:
        down_read+0x43/0x1d0
        enable_drhd_fault_handling+0x21/0x110
        cpuhp_invoke_callback+0x4c6/0x870
        cpuhp_issue_call+0xbf/0x1f0
        __cpuhp_setup_state_cpuslocked+0x111/0x320
        __cpuhp_setup_state+0xb0/0x220
        irq_remap_enable_fault_handling+0x3f/0xa0
        apic_intr_mode_init+0x5c/0x110
        x86_late_time_init+0x24/0x40
        start_kernel+0x895/0xbd0
        x86_64_start_reservations+0x18/0x30
        x86_64_start_kernel+0xbf/0x110
        common_startup_64+0x13e/0x141

 -> #4 (cpuhp_state_mutex){+.+.}-{3:3}:
        __mutex_lock+0xb4/0xe40
        mutex_lock_nested+0x1b/0x30
        __cpuhp_setup_state_cpuslocked+0x67/0x320
        __cpuhp_setup_state+0xb0/0x220
        page_alloc_init_cpuhp+0x2d/0x60
        mm_core_init+0x18/0x2c0
        start_kernel+0x576/0xbd0
        x86_64_start_reservations+0x18/0x30
        x86_64_start_kernel+0xbf/0x110
        common_startup_64+0x13e/0x141

 -> #3 (cpu_hotplug_lock){++++}-{0:0}:
        __cpuhp_state_add_instance+0x4f/0x220
        iova_domain_init_rcaches+0x214/0x280
        iommu_setup_dma_ops+0x1a4/0x710
        iommu_device_register+0x17d/0x260
        intel_iommu_init+0xda4/0x11f0
        pci_iommu_init+0x13/0x70
        do_one_initcall+0x62/0x3f0
        kernel_init_freeable+0x3da/0x6a0
        kernel_init+0x1b/0x200
        ret_from_fork+0x44/0x70
        ret_from_fork_asm+0x1a/0x30

 -> #2 (&domain->iova_cookie->mutex){+.+.}-{3:3}:
        __mutex_lock+0xb4/0xe40
        mutex_lock_nested+0x1b/0x30
        iommu_setup_dma_ops+0x16b/0x710
        iommu_device_register+0x17d/0x260
        intel_iommu_init+0xda4/0x11f0
        pci_iommu_init+0x13/0x70
        do_one_initcall+0x62/0x3f0
        kernel_init_freeable+0x3da/0x6a0
        kernel_init+0x1b/0x200
        ret_from_fork+0x44/0x70
        ret_from_fork_asm+0x1a/0x30

 -> #1 (&group->mutex){+.+.}-{3:3}:
        __mutex_lock+0xb4/0xe40
        mutex_lock_nested+0x1b/0x30
        __iommu_probe_device+0x24c/0x4e0
        probe_iommu_group+0x2b/0x50
        bus_for_each_dev+0x7d/0xe0
        iommu_device_register+0xe1/0x260
        intel_iommu_init+0xda4/0x11f0
        pci_iommu_init+0x13/0x70
        do_one_initcall+0x62/0x3f0
        kernel_init_freeable+0x3da/0x6a0
        kernel_init+0x1b/0x200
        ret_from_fork+0x44/0x70
        ret_from_fork_asm+0x1a/0x30

 -> #0 (iommu_probe_device_lock){+.+.}-{3:3}:
        __lock_acquire+0x1637/0x2810
        lock_acquire+0xc9/0x300
        __mutex_lock+0xb4/0xe40
        mutex_lock_nested+0x1b/0x30
        iommu_probe_device+0x1d/0x70
        intel_iommu_init+0xe90/0x11f0
        pci_iommu_init+0x13/0x70
        do_one_initcall+0x62/0x3f0
        kernel_init_freeable+0x3da/0x6a0
        kernel_init+0x1b/0x200
        ret_from_fork+0x44/0x70
        ret_from_fork_asm+0x1a/0x30

 other info that might help us debug this:

 Chain exists of:
   iommu_probe_device_lock --> dmar_global_lock -->
     &device->physical_node_lock

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&device->physical_node_lock);
                                lock(dmar_global_lock);
                                lock(&device->physical_node_lock);
   lock(iommu_probe_device_lock);

  *** DEADLOCK ***

This driver uses a global lock to protect the list of enumerated DMA
remapping units. It is necessary due to the driver's support for dynamic
addition and removal of remapping units at runtime.

Two distinct code paths require iteration over this remapping unit list:

- Device registration and probing: the driver iterates the list to
  register each remapping unit with the upper layer IOMMU framework
  and subsequently probe the devices managed by that unit.
- Global configuration: Upper layer components may also iterate the list
  to apply configuration changes.

The lock acquisition order between these two code paths was reversed. This
caused lockdep warnings, indicating a risk of deadlock. Fix this warning
by releasing the global lock before invoking upper layer interfaces for
device registration.

Fixes: b150654 ("iommu/vt-d: Fix suspicious RCU usage")
Closes: https://lore.kernel.org/linux-iommu/SJ1PR11MB612953431F94F18C954C4A9CB9D32@SJ1PR11MB6129.namprd11.prod.outlook.com/
Tested-by: Chaitanya Kumar Borah <[email protected]>
Cc: [email protected]
Signed-off-by: Lu Baolu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit a104042 ]

The ieee80211 skb control block key (set when skb was queued) could have
been removed before ieee80211_tx_dequeue() call. ieee80211_tx_dequeue()
already called ieee80211_tx_h_select_key() to get the current key, but
the latter do not update the key in skb control block in case it is
NULL. Because some drivers actually use this key in their TX callbacks
(e.g. ath1{1,2}k_mac_op_tx()) this could lead to the use after free
below:

  BUG: KASAN: slab-use-after-free in ath11k_mac_op_tx+0x590/0x61c
  Read of size 4 at addr ffffff803083c248 by task kworker/u16:4/1440

  CPU: 3 UID: 0 PID: 1440 Comm: kworker/u16:4 Not tainted 6.13.0-ge128f627f404 #2
  Hardware name: HW (DT)
  Workqueue: bat_events batadv_send_outstanding_bcast_packet
  Call trace:
   show_stack+0x14/0x1c (C)
   dump_stack_lvl+0x58/0x74
   print_report+0x164/0x4c0
   kasan_report+0xac/0xe8
   __asan_report_load4_noabort+0x1c/0x24
   ath11k_mac_op_tx+0x590/0x61c
   ieee80211_handle_wake_tx_queue+0x12c/0x1c8
   ieee80211_queue_skb+0xdcc/0x1b4c
   ieee80211_tx+0x1ec/0x2bc
   ieee80211_xmit+0x224/0x324
   __ieee80211_subif_start_xmit+0x85c/0xcf8
   ieee80211_subif_start_xmit+0xc0/0xec4
   dev_hard_start_xmit+0xf4/0x28c
   __dev_queue_xmit+0x6ac/0x318c
   batadv_send_skb_packet+0x38c/0x4b0
   batadv_send_outstanding_bcast_packet+0x110/0x328
   process_one_work+0x578/0xc10
   worker_thread+0x4bc/0xc7c
   kthread+0x2f8/0x380
   ret_from_fork+0x10/0x20

  Allocated by task 1906:
   kasan_save_stack+0x28/0x4c
   kasan_save_track+0x1c/0x40
   kasan_save_alloc_info+0x3c/0x4c
   __kasan_kmalloc+0xac/0xb0
   __kmalloc_noprof+0x1b4/0x380
   ieee80211_key_alloc+0x3c/0xb64
   ieee80211_add_key+0x1b4/0x71c
   nl80211_new_key+0x2b4/0x5d8
   genl_family_rcv_msg_doit+0x198/0x240
  <...>

  Freed by task 1494:
   kasan_save_stack+0x28/0x4c
   kasan_save_track+0x1c/0x40
   kasan_save_free_info+0x48/0x94
   __kasan_slab_free+0x48/0x60
   kfree+0xc8/0x31c
   kfree_sensitive+0x70/0x80
   ieee80211_key_free_common+0x10c/0x174
   ieee80211_free_keys+0x188/0x46c
   ieee80211_stop_mesh+0x70/0x2cc
   ieee80211_leave_mesh+0x1c/0x60
   cfg80211_leave_mesh+0xe0/0x280
   cfg80211_leave+0x1e0/0x244
  <...>

Reset SKB control block key before calling ieee80211_tx_h_select_key()
to avoid that.

Fixes: bb42f2d ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Remi Pommarel <[email protected]>
Link: https://patch.msgid.link/06aa507b853ca385ceded81c18b0a6dd0f081bc8.1742833382.git.repk@triplefau.lt
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 752e221 ]

SMC consists of two sockets: smc_sock and kernel TCP socket.

Currently, there are two ways of creating the sockets, and syzbot reported
a lockdep splat [0] for the newer way introduced by commit d25a92c
("net/smc: Introduce IPPROTO_SMC").

  socket(AF_SMC             , SOCK_STREAM, SMCPROTO_SMC or SMCPROTO_SMC6)
  socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_SMC)

When a socket is allocated, sock_lock_init() sets a lockdep lock class to
sk->sk_lock.slock based on its protocol family.  In the IPPROTO_SMC case,
AF_INET or AF_INET6 lock class is assigned to smc_sock.

The repro sets IPV6_JOIN_ANYCAST for IPv6 UDP and SMC socket and exercises
smc_switch_to_fallback() for IPPROTO_SMC.

  1. smc_switch_to_fallback() is called under lock_sock() and holds
     smc->clcsock_release_lock.

      sk_lock-AF_INET6 -> &smc->clcsock_release_lock
      (sk_lock-AF_SMC)

  2. Setting IPV6_JOIN_ANYCAST to SMC holds smc->clcsock_release_lock
     and calls setsockopt() for the kernel TCP socket, which holds RTNL
     and the kernel socket's lock_sock().

      &smc->clcsock_release_lock -> rtnl_mutex (-> k-sk_lock-AF_INET6)

  3. Setting IPV6_JOIN_ANYCAST to UDP holds RTNL and lock_sock().

      rtnl_mutex -> sk_lock-AF_INET6

Then, lockdep detects a false-positive circular locking,

  .-> sk_lock-AF_INET6 -> &smc->clcsock_release_lock -> rtnl_mutex -.
  `-----------------------------------------------------------------'

but IPPROTO_SMC should have the same locking rule as AF_SMC.

      sk_lock-AF_SMC   -> &smc->clcsock_release_lock -> rtnl_mutex -> k-sk_lock-AF_INET6

Let's set the same lock class for smc_sock.

Given AF_SMC uses the same lock class for SMCPROTO_SMC and SMCPROTO_SMC6,
we do not need to separate the class for AF_INET and AF_INET6.

[0]:
WARNING: possible circular locking dependency detected
6.14.0-rc3-syzkaller-00267-gff202c5028a1 #0 Not tainted

syz.4.1528/11571 is trying to acquire lock:
ffffffff8fef8de8 (rtnl_mutex){+.+.}-{4:4}, at: ipv6_sock_ac_close+0xd9/0x110 net/ipv6/anycast.c:220

but task is already holding lock:
ffff888027f596a8 (&smc->clcsock_release_lock){+.+.}-{4:4}, at: smc_clcsock_release+0x75/0xe0 net/smc/smc_close.c:30

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

 -> #2 (&smc->clcsock_release_lock){+.+.}-{4:4}:
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
       smc_switch_to_fallback+0x2d/0xa00 net/smc/af_smc.c:903
       smc_sendmsg+0x13d/0x520 net/smc/af_smc.c:2781
       sock_sendmsg_nosec net/socket.c:718 [inline]
       __sock_sendmsg net/socket.c:733 [inline]
       ____sys_sendmsg+0xaaf/0xc90 net/socket.c:2573
       ___sys_sendmsg+0x135/0x1e0 net/socket.c:2627
       __sys_sendmsg+0x16e/0x220 net/socket.c:2659
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

 -> #1 (sk_lock-AF_INET6){+.+.}-{0:0}:
       lock_sock_nested+0x3a/0xf0 net/core/sock.c:3645
       lock_sock include/net/sock.h:1624 [inline]
       sockopt_lock_sock net/core/sock.c:1133 [inline]
       sockopt_lock_sock+0x54/0x70 net/core/sock.c:1124
       do_ipv6_setsockopt+0x2160/0x4520 net/ipv6/ipv6_sockglue.c:567
       ipv6_setsockopt+0xcb/0x170 net/ipv6/ipv6_sockglue.c:993
       udpv6_setsockopt+0x7d/0xd0 net/ipv6/udp.c:1850
       do_sock_setsockopt+0x222/0x480 net/socket.c:2303
       __sys_setsockopt+0x1a0/0x230 net/socket.c:2328
       __do_sys_setsockopt net/socket.c:2334 [inline]
       __se_sys_setsockopt net/socket.c:2331 [inline]
       __x64_sys_setsockopt+0xbd/0x160 net/socket.c:2331
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

 -> #0 (rtnl_mutex){+.+.}-{4:4}:
       check_prev_add kernel/locking/lockdep.c:3163 [inline]
       check_prevs_add kernel/locking/lockdep.c:3282 [inline]
       validate_chain kernel/locking/lockdep.c:3906 [inline]
       __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
       lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
       ipv6_sock_ac_close+0xd9/0x110 net/ipv6/anycast.c:220
       inet6_release+0x47/0x70 net/ipv6/af_inet6.c:485
       __sock_release net/socket.c:647 [inline]
       sock_release+0x8e/0x1d0 net/socket.c:675
       smc_clcsock_release+0xb7/0xe0 net/smc/smc_close.c:34
       __smc_release+0x5c2/0x880 net/smc/af_smc.c:301
       smc_release+0x1fc/0x5f0 net/smc/af_smc.c:344
       __sock_release+0xb0/0x270 net/socket.c:647
       sock_close+0x1c/0x30 net/socket.c:1398
       __fput+0x3ff/0xb70 fs/file_table.c:464
       task_work_run+0x14e/0x250 kernel/task_work.c:227
       resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
       exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
       exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
       __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
       syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218
       do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  rtnl_mutex --> sk_lock-AF_INET6 --> &smc->clcsock_release_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&smc->clcsock_release_lock);
                               lock(sk_lock-AF_INET6);
                               lock(&smc->clcsock_release_lock);
  lock(rtnl_mutex);

 *** DEADLOCK ***

2 locks held by syz.4.1528/11571:
 #0: ffff888077e88208 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline]
 #0: ffff888077e88208 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: __sock_release+0x86/0x270 net/socket.c:646
 #1: ffff888027f596a8 (&smc->clcsock_release_lock){+.+.}-{4:4}, at: smc_clcsock_release+0x75/0xe0 net/smc/smc_close.c:30

stack backtrace:
CPU: 0 UID: 0 PID: 11571 Comm: syz.4.1528 Not tainted 6.14.0-rc3-syzkaller-00267-gff202c5028a1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_circular_bug+0x490/0x760 kernel/locking/lockdep.c:2076
 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2208
 check_prev_add kernel/locking/lockdep.c:3163 [inline]
 check_prevs_add kernel/locking/lockdep.c:3282 [inline]
 validate_chain kernel/locking/lockdep.c:3906 [inline]
 __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
 __mutex_lock_common kernel/locking/mutex.c:585 [inline]
 __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
 ipv6_sock_ac_close+0xd9/0x110 net/ipv6/anycast.c:220
 inet6_release+0x47/0x70 net/ipv6/af_inet6.c:485
 __sock_release net/socket.c:647 [inline]
 sock_release+0x8e/0x1d0 net/socket.c:675
 smc_clcsock_release+0xb7/0xe0 net/smc/smc_close.c:34
 __smc_release+0x5c2/0x880 net/smc/af_smc.c:301
 smc_release+0x1fc/0x5f0 net/smc/af_smc.c:344
 __sock_release+0xb0/0x270 net/socket.c:647
 sock_close+0x1c/0x30 net/socket.c:1398
 __fput+0x3ff/0xb70 fs/file_table.c:464
 task_work_run+0x14e/0x250 kernel/task_work.c:227
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218
 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8b4b38d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe4efd22d8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00000000000b14a3 RCX: 00007f8b4b38d169
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f8b4b5a7ba0 R08: 0000000000000001 R09: 000000114efd25cf
R10: 00007f8b4b200000 R11: 0000000000000246 R12: 00007f8b4b5a5fac
R13: 00007f8b4b5a5fa0 R14: ffffffffffffffff R15: 00007ffe4efd23f0
 </TASK>

Fixes: d25a92c ("net/smc: Introduce IPPROTO_SMC")
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=be6f4b383534d88989f7
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Wenjia Zhang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
commit d54d610 upstream.

Communicating with the hypervisor using the shared GHCB page requires
clearing the C bit in the mapping of that page. When executing in the
context of the EFI boot services, the page tables are owned by the
firmware, and this manipulation is not possible.

So switch to a different API for accepting memory in SEV-SNP guests, one
which is actually supported at the point during boot where the EFI stub
may need to accept memory, but the SEV-SNP init code has not executed
yet.

For simplicity, also switch the memory acceptance carried out by the
decompressor when not booting via EFI - this only involves the
allocation for the decompressed kernel, and is generally only called
after kexec, as normal boot will jump straight into the kernel from the
EFI stub.

Fixes: 6c32117 ("x86/sev: Add SNP-specific unaccepted memory support")
Tested-by: Tom Lendacky <[email protected]>
Co-developed-by: Tom Lendacky <[email protected]>
Signed-off-by: Tom Lendacky <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: <[email protected]>
Cc: Dionna Amalie Glaze <[email protected]>
Cc: Kevin Loughlin <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected] # discussion thread #1
Link: https://lore.kernel.org/r/[email protected] # discussion thread #2
Link: https://lore.kernel.org/r/[email protected] # final submission
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
commit afcdf51 upstream.

Commit 7da55c2 ("drm/amd/display: Remove incorrect FP context
start") removes the FP context protection of dml2_create(), and it said
"All the DC_FP_START/END should be used before call anything from DML2".

However, dml2_init()/dml21_init() are not protected from their callers,
causing such errors:

 do_fpu invoked from kernel context![#1]:
 CPU: 0 UID: 0 PID: 239 Comm: kworker/0:5 Not tainted 6.14.0-rc6+ #2
 Workqueue: events work_for_cpu_fn
 pc ffff80000319de80 ra ffff80000319de5c tp 900000010575c000 sp 900000010575f840
 a0 0000000000000000 a1 900000012f210130 a2 900000012f000000 a3 ffff80000357e268
 a4 ffff80000357e260 a5 900000012ea52cf0 a6 0000000400000004 a7 0000012c00001388
 t0 00001900000015e0 t1 ffff80000379d000 t2 0000000010624dd3 t3 0000006400000014
 t4 00000000000003e8 t5 0000005000000018 t6 0000000000000020 t7 0000000f00000064
 t8 000000000000002f u0 5f5e9200f8901912 s9 900000012d380010 s0 900000012ea51fd8
 s1 900000012f000000 s2 9000000109296000 s3 0000000000000001 s4 0000000000001fd8
 s5 0000000000000001 s6 ffff800003415000 s7 900000012d390000 s8 ffff800003211f80
    ra: ffff80000319de5c dml21_apply_soc_bb_overrides+0x3c/0x960 [amdgpu]
   ERA: ffff80000319de80 dml21_apply_soc_bb_overrides+0x60/0x960 [amdgpu]
  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
  PRMD: 00000004 (PPLV0 +PIE -PWE)
  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
  ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7)
 ESTAT: 000f0000 [FPD] (IS= ECode=15 EsubCode=0)
  PRID: 0014d010 (Loongson-64bit, Loongson-3C6000/S)
 Process kworker/0:5 (pid: 239, threadinfo=00000000927eadc6, task=000000008fd31682)
 Stack : 00040dc000003164 0000000000000001 900000012f210130 900000012eabeeb8
         900000012f000000 ffff80000319fe48 900000012f210000 900000012f210130
         900000012f000000 900000012eabeeb8 0000000000000001 ffff8000031a0064
         900000010575f9f0 900000012f210130 900000012eac0000 900000012ea80000
         900000012f000000 ffff8000031cefc4 900000010575f9f0 ffff8000035859c0
         ffff800003414000 900000010575fa78 900000012f000000 ffff8000031b4c50
         0000000000000000 9000000101c9d700 9000000109c40000 5f5e9200f8901912
         900000012d3c4bd0 900000012d3c5000 ffff8000034aed18 900000012d380010
         900000012d3c4bd0 ffff800003414000 900000012d380000 ffff800002ea49dc
         0000000000000001 900000012d3c6000 00000000ffffe423 0000000000010000
         ...
 Call Trace:
 [<ffff80000319de80>] dml21_apply_soc_bb_overrides+0x60/0x960 [amdgpu]
 [<ffff80000319fe44>] dml21_init+0xa4/0x280 [amdgpu]
 [<ffff8000031a0060>] dml21_create+0x40/0x80 [amdgpu]
 [<ffff8000031cefc0>] dc_state_create+0x100/0x160 [amdgpu]
 [<ffff8000031b4c4c>] dc_create+0x44c/0x640 [amdgpu]
 [<ffff800002ea49d8>] amdgpu_dm_init+0x3f8/0x2060 [amdgpu]
 [<ffff800002ea6658>] dm_hw_init+0x18/0x60 [amdgpu]
 [<ffff800002b16738>] amdgpu_device_init+0x1938/0x27e0 [amdgpu]
 [<ffff800002b18e80>] amdgpu_driver_load_kms+0x20/0xa0 [amdgpu]
 [<ffff800002b0c8f0>] amdgpu_pci_probe+0x1b0/0x580 [amdgpu]
 [<900000000448eae4>] local_pci_probe+0x44/0xc0
 [<9000000003b02b18>] work_for_cpu_fn+0x18/0x40
 [<9000000003b05da0>] process_one_work+0x160/0x300
 [<9000000003b06718>] worker_thread+0x318/0x440
 [<9000000003b11b8c>] kthread+0x12c/0x220
 [<9000000003ac1484>] ret_from_kernel_thread+0x8/0xa4

Unfortunately, protecting dml2_init()/dml21_init() out of DML2 causes
"sleeping function called from invalid context", so protect them with
DC_FP_START() and DC_FP_END() inside.

Fixes: 7da55c2 ("drm/amd/display: Remove incorrect FP context start")
Cc: [email protected]
Signed-off-by: Huacai Chen <[email protected]>
Reviewed-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
commit ab680dc upstream.

Fix deadlock in job submission and abort handling.
When a thread aborts currently executing jobs due to a fault,
it first locks the global lock protecting submitted_jobs (#1).

After the last job is destroyed, it proceeds to release the related context
and locks file_priv (#2). Meanwhile, in the job submission thread,
the file_priv lock (#2) is taken first, and then the submitted_jobs
lock (#1) is obtained when a job is added to the submitted jobs list.

       CPU0                            CPU1
       ----                    	       ----
  (for example due to a fault)         (jobs submissions keep coming)

  lock(&vdev->submitted_jobs_lock) #1
  ivpu_jobs_abort_all()
  job_destroy()
                                      lock(&file_priv->lock)           #2
                                      lock(&vdev->submitted_jobs_lock) #1
  file_priv_release()
  lock(&vdev->context_list_lock)
  lock(&file_priv->lock)           #2

This order of locking causes a deadlock. To resolve this issue,
change the order of locking in ivpu_job_submit().

Signed-off-by: Karol Wachowski <[email protected]>
Signed-off-by: Maciej Falkowski <[email protected]>
Reviewed-by: Jacek Lawrynowicz <[email protected]>
Signed-off-by: Jacek Lawrynowicz <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Jacek Lawrynowicz <[email protected]>
[ This backport required small adjustments to ivpu_job_submit(),
  which lacks support for explicit command queue creation added in 6.15.  ]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 866bafa ]

There is a potential deadlock if we do report zones in an IO context, detailed
in below lockdep report. When one process do a report zones and another process
freezes the block device, the report zones side cannot allocate a tag because
the freeze is already started. This can thus result in new block group creation
to hang forever, blocking the write path.

Thankfully, a new block group should be created on empty zones. So, reporting
the zones is not necessary and we can set the write pointer = 0 and load the
zone capacity from the block layer using bdev_zone_capacity() helper.

 ======================================================
 WARNING: possible circular locking dependency detected
 6.14.0-rc1 torvalds#252 Not tainted
 ------------------------------------------------------
 modprobe/1110 is trying to acquire lock:
 ffff888100ac83e0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: __flush_work+0x38f/0xb60

 but task is already holding lock:
 ffff8881205b6f20 (&q->q_usage_counter(queue)#16){++++}-{0:0}, at: sd_remove+0x85/0x130

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -> #3 (&q->q_usage_counter(queue)#16){++++}-{0:0}:
        blk_queue_enter+0x3d9/0x500
        blk_mq_alloc_request+0x47d/0x8e0
        scsi_execute_cmd+0x14f/0xb80
        sd_zbc_do_report_zones+0x1c1/0x470
        sd_zbc_report_zones+0x362/0xd60
        blkdev_report_zones+0x1b1/0x2e0
        btrfs_get_dev_zones+0x215/0x7e0 [btrfs]
        btrfs_load_block_group_zone_info+0x6d2/0x2c10 [btrfs]
        btrfs_make_block_group+0x36b/0x870 [btrfs]
        btrfs_create_chunk+0x147d/0x2320 [btrfs]
        btrfs_chunk_alloc+0x2ce/0xcf0 [btrfs]
        start_transaction+0xce6/0x1620 [btrfs]
        btrfs_uuid_scan_kthread+0x4ee/0x5b0 [btrfs]
        kthread+0x39d/0x750
        ret_from_fork+0x30/0x70
        ret_from_fork_asm+0x1a/0x30

 -> #2 (&fs_info->dev_replace.rwsem){++++}-{4:4}:
        down_read+0x9b/0x470
        btrfs_map_block+0x2ce/0x2ce0 [btrfs]
        btrfs_submit_chunk+0x2d4/0x16c0 [btrfs]
        btrfs_submit_bbio+0x16/0x30 [btrfs]
        btree_write_cache_pages+0xb5a/0xf90 [btrfs]
        do_writepages+0x17f/0x7b0
        __writeback_single_inode+0x114/0xb00
        writeback_sb_inodes+0x52b/0xe00
        wb_writeback+0x1a7/0x800
        wb_workfn+0x12a/0xbd0
        process_one_work+0x85a/0x1460
        worker_thread+0x5e2/0xfc0
        kthread+0x39d/0x750
        ret_from_fork+0x30/0x70
        ret_from_fork_asm+0x1a/0x30

 -> #1 (&fs_info->zoned_meta_io_lock){+.+.}-{4:4}:
        __mutex_lock+0x1aa/0x1360
        btree_write_cache_pages+0x252/0xf90 [btrfs]
        do_writepages+0x17f/0x7b0
        __writeback_single_inode+0x114/0xb00
        writeback_sb_inodes+0x52b/0xe00
        wb_writeback+0x1a7/0x800
        wb_workfn+0x12a/0xbd0
        process_one_work+0x85a/0x1460
        worker_thread+0x5e2/0xfc0
        kthread+0x39d/0x750
        ret_from_fork+0x30/0x70
        ret_from_fork_asm+0x1a/0x30

 -> #0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}:
        __lock_acquire+0x2f52/0x5ea0
        lock_acquire+0x1b1/0x540
        __flush_work+0x3ac/0xb60
        wb_shutdown+0x15b/0x1f0
        bdi_unregister+0x172/0x5b0
        del_gendisk+0x841/0xa20
        sd_remove+0x85/0x130
        device_release_driver_internal+0x368/0x520
        bus_remove_device+0x1f1/0x3f0
        device_del+0x3bd/0x9c0
        __scsi_remove_device+0x272/0x340
        scsi_forget_host+0xf7/0x170
        scsi_remove_host+0xd2/0x2a0
        sdebug_driver_remove+0x52/0x2f0 [scsi_debug]
        device_release_driver_internal+0x368/0x520
        bus_remove_device+0x1f1/0x3f0
        device_del+0x3bd/0x9c0
        device_unregister+0x13/0xa0
        sdebug_do_remove_host+0x1fb/0x290 [scsi_debug]
        scsi_debug_exit+0x17/0x70 [scsi_debug]
        __do_sys_delete_module.isra.0+0x321/0x520
        do_syscall_64+0x93/0x180
        entry_SYSCALL_64_after_hwframe+0x76/0x7e

 other info that might help us debug this:

 Chain exists of:
   (work_completion)(&(&wb->dwork)->work) --> &fs_info->dev_replace.rwsem --> &q->q_usage_counter(queue)#16

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&q->q_usage_counter(queue)#16);
                                lock(&fs_info->dev_replace.rwsem);
                                lock(&q->q_usage_counter(queue)#16);
   lock((work_completion)(&(&wb->dwork)->work));

  *** DEADLOCK ***

 5 locks held by modprobe/1110:
  #0: ffff88811f7bc108 (&dev->mutex){....}-{4:4}, at: device_release_driver_internal+0x8f/0x520
  #1: ffff8881022ee0e0 (&shost->scan_mutex){+.+.}-{4:4}, at: scsi_remove_host+0x20/0x2a0
  #2: ffff88811b4c4378 (&dev->mutex){....}-{4:4}, at: device_release_driver_internal+0x8f/0x520
  #3: ffff8881205b6f20 (&q->q_usage_counter(queue)#16){++++}-{0:0}, at: sd_remove+0x85/0x130
  #4: ffffffffa3284360 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xda/0xb60

 stack backtrace:
 CPU: 0 UID: 0 PID: 1110 Comm: modprobe Not tainted 6.14.0-rc1 torvalds#252
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-3.fc41 04/01/2014
 Call Trace:
  <TASK>
  dump_stack_lvl+0x6a/0x90
  print_circular_bug.cold+0x1e0/0x274
  check_noncircular+0x306/0x3f0
  ? __pfx_check_noncircular+0x10/0x10
  ? mark_lock+0xf5/0x1650
  ? __pfx_check_irq_usage+0x10/0x10
  ? lockdep_lock+0xca/0x1c0
  ? __pfx_lockdep_lock+0x10/0x10
  __lock_acquire+0x2f52/0x5ea0
  ? __pfx___lock_acquire+0x10/0x10
  ? __pfx_mark_lock+0x10/0x10
  lock_acquire+0x1b1/0x540
  ? __flush_work+0x38f/0xb60
  ? __pfx_lock_acquire+0x10/0x10
  ? __pfx_lock_release+0x10/0x10
  ? mark_held_locks+0x94/0xe0
  ? __flush_work+0x38f/0xb60
  __flush_work+0x3ac/0xb60
  ? __flush_work+0x38f/0xb60
  ? __pfx_mark_lock+0x10/0x10
  ? __pfx___flush_work+0x10/0x10
  ? __pfx_wq_barrier_func+0x10/0x10
  ? __pfx___might_resched+0x10/0x10
  ? mark_held_locks+0x94/0xe0
  wb_shutdown+0x15b/0x1f0
  bdi_unregister+0x172/0x5b0
  ? __pfx_bdi_unregister+0x10/0x10
  ? up_write+0x1ba/0x510
  del_gendisk+0x841/0xa20
  ? __pfx_del_gendisk+0x10/0x10
  ? _raw_spin_unlock_irqrestore+0x35/0x60
  ? __pm_runtime_resume+0x79/0x110
  sd_remove+0x85/0x130
  device_release_driver_internal+0x368/0x520
  ? kobject_put+0x5d/0x4a0
  bus_remove_device+0x1f1/0x3f0
  device_del+0x3bd/0x9c0
  ? __pfx_device_del+0x10/0x10
  __scsi_remove_device+0x272/0x340
  scsi_forget_host+0xf7/0x170
  scsi_remove_host+0xd2/0x2a0
  sdebug_driver_remove+0x52/0x2f0 [scsi_debug]
  ? kernfs_remove_by_name_ns+0xc0/0xf0
  device_release_driver_internal+0x368/0x520
  ? kobject_put+0x5d/0x4a0
  bus_remove_device+0x1f1/0x3f0
  device_del+0x3bd/0x9c0
  ? __pfx_device_del+0x10/0x10
  ? __pfx___mutex_unlock_slowpath+0x10/0x10
  device_unregister+0x13/0xa0
  sdebug_do_remove_host+0x1fb/0x290 [scsi_debug]
  scsi_debug_exit+0x17/0x70 [scsi_debug]
  __do_sys_delete_module.isra.0+0x321/0x520
  ? __pfx___do_sys_delete_module.isra.0+0x10/0x10
  ? __pfx_slab_free_after_rcu_debug+0x10/0x10
  ? kasan_save_stack+0x2c/0x50
  ? kasan_record_aux_stack+0xa3/0xb0
  ? __call_rcu_common.constprop.0+0xc4/0xfb0
  ? kmem_cache_free+0x3a0/0x590
  ? __x64_sys_close+0x78/0xd0
  do_syscall_64+0x93/0x180
  ? lock_is_held_type+0xd5/0x130
  ? __call_rcu_common.constprop.0+0x3c0/0xfb0
  ? lockdep_hardirqs_on+0x78/0x100
  ? __call_rcu_common.constprop.0+0x3c0/0xfb0
  ? __pfx___call_rcu_common.constprop.0+0x10/0x10
  ? kmem_cache_free+0x3a0/0x590
  ? lockdep_hardirqs_on_prepare+0x16d/0x400
  ? do_syscall_64+0x9f/0x180
  ? lockdep_hardirqs_on+0x78/0x100
  ? do_syscall_64+0x9f/0x180
  ? __pfx___x64_sys_openat+0x10/0x10
  ? lockdep_hardirqs_on_prepare+0x16d/0x400
  ? do_syscall_64+0x9f/0x180
  ? lockdep_hardirqs_on+0x78/0x100
  ? do_syscall_64+0x9f/0x180
  entry_SYSCALL_64_after_hwframe+0x76/0x7e
 RIP: 0033:0x7f436712b68b
 RSP: 002b:00007ffe9f1a8658 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
 RAX: ffffffffffffffda RBX: 00005559b367fd80 RCX: 00007f436712b68b
 RDX: 0000000000000000 RSI: 0000000000000800 RDI: 00005559b367fde8
 RBP: 00007ffe9f1a8680 R08: 1999999999999999 R09: 0000000000000000
 R10: 00007f43671a5fe0 R11: 0000000000000206 R12: 0000000000000000
 R13: 00007ffe9f1a86b0 R14: 0000000000000000 R15: 0000000000000000
  </TASK>

Reported-by: Shin'ichiro Kawasaki <[email protected]>
CC: <[email protected]> # 6.13+
Tested-by: Shin'ichiro Kawasaki <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Naohiro Aota <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 48c1d1b ]

[BUG]
There is a bug report that a syzbot reproducer can lead to the following
busy inode at unmount time:

  BTRFS info (device loop1): last unmount of filesystem 1680000e-3c1e-4c46-84b6-56bd3909af50
  VFS: Busy inodes after unmount of loop1 (btrfs)
  ------------[ cut here ]------------
  kernel BUG at fs/super.c:650!
  Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
  CPU: 0 UID: 0 PID: 48168 Comm: syz-executor Not tainted 6.15.0-rc2-00471-g119009db2674 #2 PREEMPT(full)
  Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
  RIP: 0010:generic_shutdown_super+0x2e9/0x390 fs/super.c:650
  Call Trace:
   <TASK>
   kill_anon_super+0x3a/0x60 fs/super.c:1237
   btrfs_kill_super+0x3b/0x50 fs/btrfs/super.c:2099
   deactivate_locked_super+0xbe/0x1a0 fs/super.c:473
   deactivate_super fs/super.c:506 [inline]
   deactivate_super+0xe2/0x100 fs/super.c:502
   cleanup_mnt+0x21f/0x440 fs/namespace.c:1435
   task_work_run+0x14d/0x240 kernel/task_work.c:227
   resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
   exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
   exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
   __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
   syscall_exit_to_user_mode+0x269/0x290 kernel/entry/common.c:218
   do_syscall_64+0xd4/0x250 arch/x86/entry/syscall_64.c:100
   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   </TASK>

[CAUSE]
When btrfs_alloc_path() failed, btrfs_iget() directly returned without
releasing the inode already allocated by btrfs_iget_locked().

This results the above busy inode and trigger the kernel BUG.

[FIX]
Fix it by calling iget_failed() if btrfs_alloc_path() failed.

If we hit error inside btrfs_read_locked_inode(), it will properly call
iget_failed(), so nothing to worry about.

Although the iget_failed() cleanup inside btrfs_read_locked_inode() is a
break of the normal error handling scheme, let's fix the obvious bug
and backport first, then rework the error handling later.

Reported-by: Penglei Jiang <[email protected]>
Link: https://lore.kernel.org/linux-btrfs/[email protected]/
Fixes: 7c855e1 ("btrfs: remove conditional path allocation in btrfs_read_locked_inode()")
CC: [email protected] # 6.13+
Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Penglei Jiang <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
…cal section

[ Upstream commit 85b2b9c ]

A circular lock dependency splat has been seen involving down_trylock():

  ======================================================
  WARNING: possible circular locking dependency detected
  6.12.0-41.el10.s390x+debug
  ------------------------------------------------------
  dd/32479 is trying to acquire lock:
  0015a20accd0d4f8 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0x26/0x90

  but task is already holding lock:
  000000017e461698 (&zone->lock){-.-.}-{2:2}, at: rmqueue_bulk+0xac/0x8f0

  the existing dependency chain (in reverse order) is:
  -> #4 (&zone->lock){-.-.}-{2:2}:
  -> #3 (hrtimer_bases.lock){-.-.}-{2:2}:
  -> #2 (&rq->__lock){-.-.}-{2:2}:
  -> #1 (&p->pi_lock){-.-.}-{2:2}:
  -> #0 ((console_sem).lock){-.-.}-{2:2}:

The console_sem -> pi_lock dependency is due to calling try_to_wake_up()
while holding the console_sem raw_spinlock. This dependency can be broken
by using wake_q to do the wakeup instead of calling try_to_wake_up()
under the console_sem lock. This will also make the semaphore's
raw_spinlock become a terminal lock without taking any further locks
underneath it.

The hrtimer_bases.lock is a raw_spinlock while zone->lock is a
spinlock. The hrtimer_bases.lock -> zone->lock dependency happens via
the debug_objects_fill_pool() helper function in the debugobjects code.

  -> #4 (&zone->lock){-.-.}-{2:2}:
         __lock_acquire+0xe86/0x1cc0
         lock_acquire.part.0+0x258/0x630
         lock_acquire+0xb8/0xe0
         _raw_spin_lock_irqsave+0xb4/0x120
         rmqueue_bulk+0xac/0x8f0
         __rmqueue_pcplist+0x580/0x830
         rmqueue_pcplist+0xfc/0x470
         rmqueue.isra.0+0xdec/0x11b0
         get_page_from_freelist+0x2ee/0xeb0
         __alloc_pages_noprof+0x2c2/0x520
         alloc_pages_mpol_noprof+0x1fc/0x4d0
         alloc_pages_noprof+0x8c/0xe0
         allocate_slab+0x320/0x460
         ___slab_alloc+0xa58/0x12b0
         __slab_alloc.isra.0+0x42/0x60
         kmem_cache_alloc_noprof+0x304/0x350
         fill_pool+0xf6/0x450
         debug_object_activate+0xfe/0x360
         enqueue_hrtimer+0x34/0x190
         __run_hrtimer+0x3c8/0x4c0
         __hrtimer_run_queues+0x1b2/0x260
         hrtimer_interrupt+0x316/0x760
         do_IRQ+0x9a/0xe0
         do_irq_async+0xf6/0x160

Normally a raw_spinlock to spinlock dependency is not legitimate
and will be warned if CONFIG_PROVE_RAW_LOCK_NESTING is enabled,
but debug_objects_fill_pool() is an exception as it explicitly
allows this dependency for non-PREEMPT_RT kernel without causing
PROVE_RAW_LOCK_NESTING lockdep splat. As a result, this dependency is
legitimate and not a bug.

Anyway, semaphore is the only locking primitive left that is still
using try_to_wake_up() to do wakeup inside critical section, all the
other locking primitives had been migrated to use wake_q to do wakeup
outside of the critical section. It is also possible that there are
other circular locking dependencies involving printk/console_sem or
other existing/new semaphores lurking somewhere which may show up in
the future. Let just do the migration now to wake_q to avoid headache
like this.

Reported-by: [email protected]
Signed-off-by: Waiman Long <[email protected]>
Signed-off-by: Boqun Feng <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit b61e69b ]

syzbot report a deadlock in diFree. [1]

When calling "ioctl$LOOP_SET_STATUS64", the offset value passed in is 4,
which does not match the mounted loop device, causing the mapping of the
mounted loop device to be invalidated.

When creating the directory and creating the inode of iag in diReadSpecial(),
read the page of fixed disk inode (AIT) in raw mode in read_metapage(), the
metapage data it returns is corrupted, which causes the nlink value of 0 to be
assigned to the iag inode when executing copy_from_dinode(), which ultimately
causes a deadlock when entering diFree().

To avoid this, first check the nlink value of dinode before setting iag inode.

[1]
WARNING: possible recursive locking detected
6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Not tainted
--------------------------------------------
syz-executor301/5309 is trying to acquire lock:
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889

but task is already holding lock:
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(imap->im_aglock[index]));
  lock(&(imap->im_aglock[index]));

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz-executor301/5309:
 #0: ffff8880422a4420 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515
 #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline]
 #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x260/0x540 fs/namei.c:4026
 #2: ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2460 [inline]
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocAG+0x4b7/0x1e50 fs/jfs/jfs_imap.c:1669
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2477 [inline]
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocAG+0x869/0x1e50 fs/jfs/jfs_imap.c:1669

stack backtrace:
CPU: 0 UID: 0 PID: 5309 Comm: syz-executor301 Not tainted 6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037
 check_deadlock kernel/locking/lockdep.c:3089 [inline]
 validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891
 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
 __mutex_lock_common kernel/locking/mutex.c:608 [inline]
 __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
 diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889
 jfs_evict_inode+0x32d/0x440 fs/jfs/inode.c:156
 evict+0x4e8/0x9b0 fs/inode.c:725
 diFreeSpecial fs/jfs/jfs_imap.c:552 [inline]
 duplicateIXtree+0x3c6/0x550 fs/jfs/jfs_imap.c:3022
 diNewIAG fs/jfs/jfs_imap.c:2597 [inline]
 diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 diAllocAG+0x17dc/0x1e50 fs/jfs/jfs_imap.c:1669
 diAlloc+0x1d2/0x1630 fs/jfs/jfs_imap.c:1590
 ialloc+0x8f/0x900 fs/jfs/jfs_inode.c:56
 jfs_mkdir+0x1c5/0xba0 fs/jfs/namei.c:225
 vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4257
 do_mkdirat+0x264/0x3a0 fs/namei.c:4280
 __do_sys_mkdirat fs/namei.c:4295 [inline]
 __se_sys_mkdirat fs/namei.c:4293 [inline]
 __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4293
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=355da3b3a74881008e8f
Signed-off-by: Edward Adam Davis <[email protected]>
Signed-off-by: Dave Kleikamp <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 27b9180 ]

With the device instance lock, there is now a possibility of a deadlock:

[    1.211455] ============================================
[    1.211571] WARNING: possible recursive locking detected
[    1.211687] 6.14.0-rc5-01215-g032756b4ca7a-dirty #5 Not tainted
[    1.211823] --------------------------------------------
[    1.211936] ip/184 is trying to acquire lock:
[    1.212032] ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_set_allmulti+0x4e/0xb0
[    1.212207]
[    1.212207] but task is already holding lock:
[    1.212332] ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_open+0x50/0xb0
[    1.212487]
[    1.212487] other info that might help us debug this:
[    1.212626]  Possible unsafe locking scenario:
[    1.212626]
[    1.212751]        CPU0
[    1.212815]        ----
[    1.212871]   lock(&dev->lock);
[    1.212944]   lock(&dev->lock);
[    1.213016]
[    1.213016]  *** DEADLOCK ***
[    1.213016]
[    1.213143]  May be due to missing lock nesting notation
[    1.213143]
[    1.213294] 3 locks held by ip/184:
[    1.213371]  #0: ffffffff838b53e0 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_nets_lock+0x1b/0xa0
[    1.213543]  #1: ffffffff84e5fc70 (&net->rtnl_mutex){+.+.}-{4:4}, at: rtnl_nets_lock+0x37/0xa0
[    1.213727]  #2: ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_open+0x50/0xb0
[    1.213895]
[    1.213895] stack backtrace:
[    1.213991] CPU: 0 UID: 0 PID: 184 Comm: ip Not tainted 6.14.0-rc5-01215-g032756b4ca7a-dirty #5
[    1.213993] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Arch Linux 1.16.3-1-1 04/01/2014
[    1.213994] Call Trace:
[    1.213995]  <TASK>
[    1.213996]  dump_stack_lvl+0x8e/0xd0
[    1.214000]  print_deadlock_bug+0x28b/0x2a0
[    1.214020]  lock_acquire+0xea/0x2a0
[    1.214027]  __mutex_lock+0xbf/0xd40
[    1.214038]  dev_set_allmulti+0x4e/0xb0 # real_dev->flags & IFF_ALLMULTI
[    1.214040]  vlan_dev_open+0xa5/0x170 # ndo_open on vlandev
[    1.214042]  __dev_open+0x145/0x270
[    1.214046]  __dev_change_flags+0xb0/0x1e0
[    1.214051]  netif_change_flags+0x22/0x60 # IFF_UP vlandev
[    1.214053]  dev_change_flags+0x61/0xb0 # for each device in group from dev->vlan_info
[    1.214055]  vlan_device_event+0x766/0x7c0 # on netdevsim0
[    1.214058]  notifier_call_chain+0x78/0x120
[    1.214062]  netif_open+0x6d/0x90
[    1.214064]  dev_open+0x5b/0xb0 # locks netdevsim0
[    1.214066]  bond_enslave+0x64c/0x1230
[    1.214075]  do_set_master+0x175/0x1e0 # on netdevsim0
[    1.214077]  do_setlink+0x516/0x13b0
[    1.214094]  rtnl_newlink+0xaba/0xb80
[    1.214132]  rtnetlink_rcv_msg+0x440/0x490
[    1.214144]  netlink_rcv_skb+0xeb/0x120
[    1.214150]  netlink_unicast+0x1f9/0x320
[    1.214153]  netlink_sendmsg+0x346/0x3f0
[    1.214157]  __sock_sendmsg+0x86/0xb0
[    1.214160]  ____sys_sendmsg+0x1c8/0x220
[    1.214164]  ___sys_sendmsg+0x28f/0x2d0
[    1.214179]  __x64_sys_sendmsg+0xef/0x140
[    1.214184]  do_syscall_64+0xec/0x1d0
[    1.214190]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[    1.214191] RIP: 0033:0x7f2d1b4a7e56

Device setup:

     netdevsim0 (down)
     ^        ^
  bond        netdevsim1.100@netdevsim1 allmulticast=on (down)

When we enslave the lower device (netdevsim0) which has a vlan, we
propagate vlan's allmuti/promisc flags during ndo_open. This causes
(re)locking on of the real_dev.

Propagate allmulti/promisc on flags change, not on the open. There
is a slight semantics change that vlans that are down now propagate
the flags, but this seems unlikely to result in the real issues.

Reproducer:

  echo 0 1 > /sys/bus/netdevsim/new_device

  dev_path=$(ls -d /sys/bus/netdevsim/devices/netdevsim0/net/*)
  dev=$(echo $dev_path | rev | cut -d/ -f1 | rev)

  ip link set dev $dev name netdevsim0
  ip link set dev netdevsim0 up

  ip link add link netdevsim0 name netdevsim0.100 type vlan id 100
  ip link set dev netdevsim0.100 allmulticast on down
  ip link add name bond1 type bond mode 802.3ad
  ip link set dev netdevsim0 down
  ip link set dev netdevsim0 master bond1
  ip link set dev bond1 up
  ip link show

Reported-by: [email protected]
Closes: https://lore.kernel.org/netdev/Z9CfXjLMKn6VLG5d@mini-arch/T/#m15ba130f53227c883e79fb969687d69d670337a0
Signed-off-by: Stanislav Fomichev <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit a104042 ]

The ieee80211 skb control block key (set when skb was queued) could have
been removed before ieee80211_tx_dequeue() call. ieee80211_tx_dequeue()
already called ieee80211_tx_h_select_key() to get the current key, but
the latter do not update the key in skb control block in case it is
NULL. Because some drivers actually use this key in their TX callbacks
(e.g. ath1{1,2}k_mac_op_tx()) this could lead to the use after free
below:

  BUG: KASAN: slab-use-after-free in ath11k_mac_op_tx+0x590/0x61c
  Read of size 4 at addr ffffff803083c248 by task kworker/u16:4/1440

  CPU: 3 UID: 0 PID: 1440 Comm: kworker/u16:4 Not tainted 6.13.0-ge128f627f404 #2
  Hardware name: HW (DT)
  Workqueue: bat_events batadv_send_outstanding_bcast_packet
  Call trace:
   show_stack+0x14/0x1c (C)
   dump_stack_lvl+0x58/0x74
   print_report+0x164/0x4c0
   kasan_report+0xac/0xe8
   __asan_report_load4_noabort+0x1c/0x24
   ath11k_mac_op_tx+0x590/0x61c
   ieee80211_handle_wake_tx_queue+0x12c/0x1c8
   ieee80211_queue_skb+0xdcc/0x1b4c
   ieee80211_tx+0x1ec/0x2bc
   ieee80211_xmit+0x224/0x324
   __ieee80211_subif_start_xmit+0x85c/0xcf8
   ieee80211_subif_start_xmit+0xc0/0xec4
   dev_hard_start_xmit+0xf4/0x28c
   __dev_queue_xmit+0x6ac/0x318c
   batadv_send_skb_packet+0x38c/0x4b0
   batadv_send_outstanding_bcast_packet+0x110/0x328
   process_one_work+0x578/0xc10
   worker_thread+0x4bc/0xc7c
   kthread+0x2f8/0x380
   ret_from_fork+0x10/0x20

  Allocated by task 1906:
   kasan_save_stack+0x28/0x4c
   kasan_save_track+0x1c/0x40
   kasan_save_alloc_info+0x3c/0x4c
   __kasan_kmalloc+0xac/0xb0
   __kmalloc_noprof+0x1b4/0x380
   ieee80211_key_alloc+0x3c/0xb64
   ieee80211_add_key+0x1b4/0x71c
   nl80211_new_key+0x2b4/0x5d8
   genl_family_rcv_msg_doit+0x198/0x240
  <...>

  Freed by task 1494:
   kasan_save_stack+0x28/0x4c
   kasan_save_track+0x1c/0x40
   kasan_save_free_info+0x48/0x94
   __kasan_slab_free+0x48/0x60
   kfree+0xc8/0x31c
   kfree_sensitive+0x70/0x80
   ieee80211_key_free_common+0x10c/0x174
   ieee80211_free_keys+0x188/0x46c
   ieee80211_stop_mesh+0x70/0x2cc
   ieee80211_leave_mesh+0x1c/0x60
   cfg80211_leave_mesh+0xe0/0x280
   cfg80211_leave+0x1e0/0x244
  <...>

Reset SKB control block key before calling ieee80211_tx_h_select_key()
to avoid that.

Fixes: bb42f2d ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Remi Pommarel <[email protected]>
Link: https://patch.msgid.link/06aa507b853ca385ceded81c18b0a6dd0f081bc8.1742833382.git.repk@triplefau.lt
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
…cal section

[ Upstream commit 85b2b9c ]

A circular lock dependency splat has been seen involving down_trylock():

  ======================================================
  WARNING: possible circular locking dependency detected
  6.12.0-41.el10.s390x+debug
  ------------------------------------------------------
  dd/32479 is trying to acquire lock:
  0015a20accd0d4f8 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0x26/0x90

  but task is already holding lock:
  000000017e461698 (&zone->lock){-.-.}-{2:2}, at: rmqueue_bulk+0xac/0x8f0

  the existing dependency chain (in reverse order) is:
  -> #4 (&zone->lock){-.-.}-{2:2}:
  -> #3 (hrtimer_bases.lock){-.-.}-{2:2}:
  -> #2 (&rq->__lock){-.-.}-{2:2}:
  -> #1 (&p->pi_lock){-.-.}-{2:2}:
  -> #0 ((console_sem).lock){-.-.}-{2:2}:

The console_sem -> pi_lock dependency is due to calling try_to_wake_up()
while holding the console_sem raw_spinlock. This dependency can be broken
by using wake_q to do the wakeup instead of calling try_to_wake_up()
under the console_sem lock. This will also make the semaphore's
raw_spinlock become a terminal lock without taking any further locks
underneath it.

The hrtimer_bases.lock is a raw_spinlock while zone->lock is a
spinlock. The hrtimer_bases.lock -> zone->lock dependency happens via
the debug_objects_fill_pool() helper function in the debugobjects code.

  -> #4 (&zone->lock){-.-.}-{2:2}:
         __lock_acquire+0xe86/0x1cc0
         lock_acquire.part.0+0x258/0x630
         lock_acquire+0xb8/0xe0
         _raw_spin_lock_irqsave+0xb4/0x120
         rmqueue_bulk+0xac/0x8f0
         __rmqueue_pcplist+0x580/0x830
         rmqueue_pcplist+0xfc/0x470
         rmqueue.isra.0+0xdec/0x11b0
         get_page_from_freelist+0x2ee/0xeb0
         __alloc_pages_noprof+0x2c2/0x520
         alloc_pages_mpol_noprof+0x1fc/0x4d0
         alloc_pages_noprof+0x8c/0xe0
         allocate_slab+0x320/0x460
         ___slab_alloc+0xa58/0x12b0
         __slab_alloc.isra.0+0x42/0x60
         kmem_cache_alloc_noprof+0x304/0x350
         fill_pool+0xf6/0x450
         debug_object_activate+0xfe/0x360
         enqueue_hrtimer+0x34/0x190
         __run_hrtimer+0x3c8/0x4c0
         __hrtimer_run_queues+0x1b2/0x260
         hrtimer_interrupt+0x316/0x760
         do_IRQ+0x9a/0xe0
         do_irq_async+0xf6/0x160

Normally a raw_spinlock to spinlock dependency is not legitimate
and will be warned if CONFIG_PROVE_RAW_LOCK_NESTING is enabled,
but debug_objects_fill_pool() is an exception as it explicitly
allows this dependency for non-PREEMPT_RT kernel without causing
PROVE_RAW_LOCK_NESTING lockdep splat. As a result, this dependency is
legitimate and not a bug.

Anyway, semaphore is the only locking primitive left that is still
using try_to_wake_up() to do wakeup inside critical section, all the
other locking primitives had been migrated to use wake_q to do wakeup
outside of the critical section. It is also possible that there are
other circular locking dependencies involving printk/console_sem or
other existing/new semaphores lurking somewhere which may show up in
the future. Let just do the migration now to wake_q to avoid headache
like this.

Reported-by: [email protected]
Signed-off-by: Waiman Long <[email protected]>
Signed-off-by: Boqun Feng <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit b61e69b ]

syzbot report a deadlock in diFree. [1]

When calling "ioctl$LOOP_SET_STATUS64", the offset value passed in is 4,
which does not match the mounted loop device, causing the mapping of the
mounted loop device to be invalidated.

When creating the directory and creating the inode of iag in diReadSpecial(),
read the page of fixed disk inode (AIT) in raw mode in read_metapage(), the
metapage data it returns is corrupted, which causes the nlink value of 0 to be
assigned to the iag inode when executing copy_from_dinode(), which ultimately
causes a deadlock when entering diFree().

To avoid this, first check the nlink value of dinode before setting iag inode.

[1]
WARNING: possible recursive locking detected
6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Not tainted
--------------------------------------------
syz-executor301/5309 is trying to acquire lock:
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889

but task is already holding lock:
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(imap->im_aglock[index]));
  lock(&(imap->im_aglock[index]));

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz-executor301/5309:
 #0: ffff8880422a4420 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515
 #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline]
 #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x260/0x540 fs/namei.c:4026
 #2: ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2460 [inline]
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocAG+0x4b7/0x1e50 fs/jfs/jfs_imap.c:1669
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2477 [inline]
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocAG+0x869/0x1e50 fs/jfs/jfs_imap.c:1669

stack backtrace:
CPU: 0 UID: 0 PID: 5309 Comm: syz-executor301 Not tainted 6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037
 check_deadlock kernel/locking/lockdep.c:3089 [inline]
 validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891
 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
 __mutex_lock_common kernel/locking/mutex.c:608 [inline]
 __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
 diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889
 jfs_evict_inode+0x32d/0x440 fs/jfs/inode.c:156
 evict+0x4e8/0x9b0 fs/inode.c:725
 diFreeSpecial fs/jfs/jfs_imap.c:552 [inline]
 duplicateIXtree+0x3c6/0x550 fs/jfs/jfs_imap.c:3022
 diNewIAG fs/jfs/jfs_imap.c:2597 [inline]
 diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
 diAllocAG+0x17dc/0x1e50 fs/jfs/jfs_imap.c:1669
 diAlloc+0x1d2/0x1630 fs/jfs/jfs_imap.c:1590
 ialloc+0x8f/0x900 fs/jfs/jfs_inode.c:56
 jfs_mkdir+0x1c5/0xba0 fs/jfs/namei.c:225
 vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4257
 do_mkdirat+0x264/0x3a0 fs/namei.c:4280
 __do_sys_mkdirat fs/namei.c:4295 [inline]
 __se_sys_mkdirat fs/namei.c:4293 [inline]
 __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4293
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=355da3b3a74881008e8f
Signed-off-by: Edward Adam Davis <[email protected]>
Signed-off-by: Dave Kleikamp <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit 27b9180 ]

With the device instance lock, there is now a possibility of a deadlock:

[    1.211455] ============================================
[    1.211571] WARNING: possible recursive locking detected
[    1.211687] 6.14.0-rc5-01215-g032756b4ca7a-dirty #5 Not tainted
[    1.211823] --------------------------------------------
[    1.211936] ip/184 is trying to acquire lock:
[    1.212032] ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_set_allmulti+0x4e/0xb0
[    1.212207]
[    1.212207] but task is already holding lock:
[    1.212332] ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_open+0x50/0xb0
[    1.212487]
[    1.212487] other info that might help us debug this:
[    1.212626]  Possible unsafe locking scenario:
[    1.212626]
[    1.212751]        CPU0
[    1.212815]        ----
[    1.212871]   lock(&dev->lock);
[    1.212944]   lock(&dev->lock);
[    1.213016]
[    1.213016]  *** DEADLOCK ***
[    1.213016]
[    1.213143]  May be due to missing lock nesting notation
[    1.213143]
[    1.213294] 3 locks held by ip/184:
[    1.213371]  #0: ffffffff838b53e0 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_nets_lock+0x1b/0xa0
[    1.213543]  #1: ffffffff84e5fc70 (&net->rtnl_mutex){+.+.}-{4:4}, at: rtnl_nets_lock+0x37/0xa0
[    1.213727]  #2: ffff8881024a4c30 (&dev->lock){+.+.}-{4:4}, at: dev_open+0x50/0xb0
[    1.213895]
[    1.213895] stack backtrace:
[    1.213991] CPU: 0 UID: 0 PID: 184 Comm: ip Not tainted 6.14.0-rc5-01215-g032756b4ca7a-dirty #5
[    1.213993] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Arch Linux 1.16.3-1-1 04/01/2014
[    1.213994] Call Trace:
[    1.213995]  <TASK>
[    1.213996]  dump_stack_lvl+0x8e/0xd0
[    1.214000]  print_deadlock_bug+0x28b/0x2a0
[    1.214020]  lock_acquire+0xea/0x2a0
[    1.214027]  __mutex_lock+0xbf/0xd40
[    1.214038]  dev_set_allmulti+0x4e/0xb0 # real_dev->flags & IFF_ALLMULTI
[    1.214040]  vlan_dev_open+0xa5/0x170 # ndo_open on vlandev
[    1.214042]  __dev_open+0x145/0x270
[    1.214046]  __dev_change_flags+0xb0/0x1e0
[    1.214051]  netif_change_flags+0x22/0x60 # IFF_UP vlandev
[    1.214053]  dev_change_flags+0x61/0xb0 # for each device in group from dev->vlan_info
[    1.214055]  vlan_device_event+0x766/0x7c0 # on netdevsim0
[    1.214058]  notifier_call_chain+0x78/0x120
[    1.214062]  netif_open+0x6d/0x90
[    1.214064]  dev_open+0x5b/0xb0 # locks netdevsim0
[    1.214066]  bond_enslave+0x64c/0x1230
[    1.214075]  do_set_master+0x175/0x1e0 # on netdevsim0
[    1.214077]  do_setlink+0x516/0x13b0
[    1.214094]  rtnl_newlink+0xaba/0xb80
[    1.214132]  rtnetlink_rcv_msg+0x440/0x490
[    1.214144]  netlink_rcv_skb+0xeb/0x120
[    1.214150]  netlink_unicast+0x1f9/0x320
[    1.214153]  netlink_sendmsg+0x346/0x3f0
[    1.214157]  __sock_sendmsg+0x86/0xb0
[    1.214160]  ____sys_sendmsg+0x1c8/0x220
[    1.214164]  ___sys_sendmsg+0x28f/0x2d0
[    1.214179]  __x64_sys_sendmsg+0xef/0x140
[    1.214184]  do_syscall_64+0xec/0x1d0
[    1.214190]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[    1.214191] RIP: 0033:0x7f2d1b4a7e56

Device setup:

     netdevsim0 (down)
     ^        ^
  bond        netdevsim1.100@netdevsim1 allmulticast=on (down)

When we enslave the lower device (netdevsim0) which has a vlan, we
propagate vlan's allmuti/promisc flags during ndo_open. This causes
(re)locking on of the real_dev.

Propagate allmulti/promisc on flags change, not on the open. There
is a slight semantics change that vlans that are down now propagate
the flags, but this seems unlikely to result in the real issues.

Reproducer:

  echo 0 1 > /sys/bus/netdevsim/new_device

  dev_path=$(ls -d /sys/bus/netdevsim/devices/netdevsim0/net/*)
  dev=$(echo $dev_path | rev | cut -d/ -f1 | rev)

  ip link set dev $dev name netdevsim0
  ip link set dev netdevsim0 up

  ip link add link netdevsim0 name netdevsim0.100 type vlan id 100
  ip link set dev netdevsim0.100 allmulticast on down
  ip link add name bond1 type bond mode 802.3ad
  ip link set dev netdevsim0 down
  ip link set dev netdevsim0 master bond1
  ip link set dev bond1 up
  ip link show

Reported-by: [email protected]
Closes: https://lore.kernel.org/netdev/Z9CfXjLMKn6VLG5d@mini-arch/T/#m15ba130f53227c883e79fb969687d69d670337a0
Signed-off-by: Stanislav Fomichev <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
[ Upstream commit a104042 ]

The ieee80211 skb control block key (set when skb was queued) could have
been removed before ieee80211_tx_dequeue() call. ieee80211_tx_dequeue()
already called ieee80211_tx_h_select_key() to get the current key, but
the latter do not update the key in skb control block in case it is
NULL. Because some drivers actually use this key in their TX callbacks
(e.g. ath1{1,2}k_mac_op_tx()) this could lead to the use after free
below:

  BUG: KASAN: slab-use-after-free in ath11k_mac_op_tx+0x590/0x61c
  Read of size 4 at addr ffffff803083c248 by task kworker/u16:4/1440

  CPU: 3 UID: 0 PID: 1440 Comm: kworker/u16:4 Not tainted 6.13.0-ge128f627f404 #2
  Hardware name: HW (DT)
  Workqueue: bat_events batadv_send_outstanding_bcast_packet
  Call trace:
   show_stack+0x14/0x1c (C)
   dump_stack_lvl+0x58/0x74
   print_report+0x164/0x4c0
   kasan_report+0xac/0xe8
   __asan_report_load4_noabort+0x1c/0x24
   ath11k_mac_op_tx+0x590/0x61c
   ieee80211_handle_wake_tx_queue+0x12c/0x1c8
   ieee80211_queue_skb+0xdcc/0x1b4c
   ieee80211_tx+0x1ec/0x2bc
   ieee80211_xmit+0x224/0x324
   __ieee80211_subif_start_xmit+0x85c/0xcf8
   ieee80211_subif_start_xmit+0xc0/0xec4
   dev_hard_start_xmit+0xf4/0x28c
   __dev_queue_xmit+0x6ac/0x318c
   batadv_send_skb_packet+0x38c/0x4b0
   batadv_send_outstanding_bcast_packet+0x110/0x328
   process_one_work+0x578/0xc10
   worker_thread+0x4bc/0xc7c
   kthread+0x2f8/0x380
   ret_from_fork+0x10/0x20

  Allocated by task 1906:
   kasan_save_stack+0x28/0x4c
   kasan_save_track+0x1c/0x40
   kasan_save_alloc_info+0x3c/0x4c
   __kasan_kmalloc+0xac/0xb0
   __kmalloc_noprof+0x1b4/0x380
   ieee80211_key_alloc+0x3c/0xb64
   ieee80211_add_key+0x1b4/0x71c
   nl80211_new_key+0x2b4/0x5d8
   genl_family_rcv_msg_doit+0x198/0x240
  <...>

  Freed by task 1494:
   kasan_save_stack+0x28/0x4c
   kasan_save_track+0x1c/0x40
   kasan_save_free_info+0x48/0x94
   __kasan_slab_free+0x48/0x60
   kfree+0xc8/0x31c
   kfree_sensitive+0x70/0x80
   ieee80211_key_free_common+0x10c/0x174
   ieee80211_free_keys+0x188/0x46c
   ieee80211_stop_mesh+0x70/0x2cc
   ieee80211_leave_mesh+0x1c/0x60
   cfg80211_leave_mesh+0xe0/0x280
   cfg80211_leave+0x1e0/0x244
  <...>

Reset SKB control block key before calling ieee80211_tx_h_select_key()
to avoid that.

Fixes: bb42f2d ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Remi Pommarel <[email protected]>
Link: https://patch.msgid.link/06aa507b853ca385ceded81c18b0a6dd0f081bc8.1742833382.git.repk@triplefau.lt
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
tobetter pushed a commit that referenced this issue May 14, 2025
commit 169410e upstream.

These three bpf_map_{lookup,update,delete}_elem() helpers are also
available for sleepable bpf program, so add the corresponding lock
assertion for sleepable bpf program, otherwise the following warning
will be reported when a sleepable bpf program manipulates bpf map under
interpreter mode (aka bpf_jit_enable=0):

  WARNING: CPU: 3 PID: 4985 at kernel/bpf/helpers.c:40 ......
  CPU: 3 PID: 4985 Comm: test_progs Not tainted 6.6.0+ #2
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) ......
  RIP: 0010:bpf_map_lookup_elem+0x54/0x60
  ......
  Call Trace:
   <TASK>
   ? __warn+0xa5/0x240
   ? bpf_map_lookup_elem+0x54/0x60
   ? report_bug+0x1ba/0x1f0
   ? handle_bug+0x40/0x80
   ? exc_invalid_op+0x18/0x50
   ? asm_exc_invalid_op+0x1b/0x20
   ? __pfx_bpf_map_lookup_elem+0x10/0x10
   ? rcu_lockdep_current_cpu_online+0x65/0xb0
   ? rcu_is_watching+0x23/0x50
   ? bpf_map_lookup_elem+0x54/0x60
   ? __pfx_bpf_map_lookup_elem+0x10/0x10
   ___bpf_prog_run+0x513/0x3b70
   __bpf_prog_run32+0x9d/0xd0
   ? __bpf_prog_enter_sleepable_recur+0xad/0x120
   ? __bpf_prog_enter_sleepable_recur+0x3e/0x120
   bpf_trampoline_6442580665+0x4d/0x1000
   __x64_sys_getpgid+0x5/0x30
   ? do_syscall_64+0x36/0xb0
   entry_SYSCALL_64_after_hwframe+0x6e/0x76
   </TASK>

Signed-off-by: Hou Tao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Cliff Liu <[email protected]>
Signed-off-by: He Zhe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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

1 participant