Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

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: dm-devel@redhat.com
[    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 <gwshan@linux.vnet.ibm.com>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Tested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> # cxl
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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 <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Nilay Vaish <nilayvaish@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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/1473674623-11810-1-git-send-email-junxiao.bi@oracle.com
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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/1473674623-11810-2-git-send-email-junxiao.bi@oracle.com
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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 <bigeasy@linutronix.de>
Reviewed-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: vince@deater.net
Cc: eranian@google.com
Link: http://lkml.kernel.org/r/20160920131220.xg5pbdjtznszuyzb@breakpoint.cc
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
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 7664add0 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 <paul.burton@imgtec.com>
Fixes: b0a668f ("MIPS: kernel: mips-r2-to-r6-emul: Add R2 emulator for MIPS R6")
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org # v4.0+
Patchwork: https://patchwork.linux-mips.org/patch/14305/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
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 <rabinv@axis.com>
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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/1470759070-18743-1-git-send-email-chris@chris-wilson.co.uk
Reported-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <stefanha@gmail.com>
Signed-off-by: Andrej Krutak <dev@andree.sk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <ira.weiny@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 7664add0 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 <paul.burton@imgtec.com>
Fixes: b0a668f ("MIPS: kernel: mips-r2-to-r6-emul: Add R2 emulator for MIPS R6")
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14305/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <paul@pwsan.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <gwshan@linux.vnet.ibm.com>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Tested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> # cxl
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <efault@gmx.de>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Mike Galbraith <mgalbraith@suse.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <jiyin@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <shuahkh@osg.samsung.com>
Signed-off-by: memeka <mihailescu2m@gmail.com>
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 <maier@linux.vnet.ibm.com>
Fixes: 6f2ce1c ("scsi: zfcp: fix rport unblock race with LUN recovery")
Cc: <stable@vger.kernel.org> #2.6.32+
Reviewed-by: Benjamin Block <bblock@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
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 <tmricht@linux.vnet.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Fixes: f3b3614 ("perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info")
Link: http://lkml.kernel.org/r/20171017132900.11043-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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 <idosch@mellanox.com>
Reported-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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: <stable@vger.kernel.org> # v3.7+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
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 <syzkaller@googlegroups.com>
Cc: <stable@vger.kernel.org> # v3.7+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
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ä <ville.syrjala@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <bart.vanassche@wdc.com>
Cc: Quinn Tran <quinn.tran@cavium.com>
Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tobetter pushed a commit that referenced this issue Nov 18, 2024
[ Upstream commit b22db8b ]

Fix possible use-after-free in 'taprio_dump()' by adding RCU
read-side critical section there. Never seen on x86 but
found on a KASAN-enabled arm64 system when investigating
https://syzkaller.appspot.com/bug?extid=b65e0af58423fc8a73aa:

[T15862] BUG: KASAN: slab-use-after-free in taprio_dump+0xa0c/0xbb0
[T15862] Read of size 4 at addr ffff0000d4bb88f8 by task repro/15862
[T15862]
[T15862] CPU: 0 UID: 0 PID: 15862 Comm: repro Not tainted 6.11.0-rc1-00293-gdefaf1a2113a-dirty #2
[T15862] Hardware name: QEMU QEMU Virtual Machine, BIOS edk2-20240524-5.fc40 05/24/2024
[T15862] Call trace:
[T15862]  dump_backtrace+0x20c/0x220
[T15862]  show_stack+0x2c/0x40
[T15862]  dump_stack_lvl+0xf8/0x174
[T15862]  print_report+0x170/0x4d8
[T15862]  kasan_report+0xb8/0x1d4
[T15862]  __asan_report_load4_noabort+0x20/0x2c
[T15862]  taprio_dump+0xa0c/0xbb0
[T15862]  tc_fill_qdisc+0x540/0x1020
[T15862]  qdisc_notify.isra.0+0x330/0x3a0
[T15862]  tc_modify_qdisc+0x7b8/0x1838
[T15862]  rtnetlink_rcv_msg+0x3c8/0xc20
[T15862]  netlink_rcv_skb+0x1f8/0x3d4
[T15862]  rtnetlink_rcv+0x28/0x40
[T15862]  netlink_unicast+0x51c/0x790
[T15862]  netlink_sendmsg+0x79c/0xc20
[T15862]  __sock_sendmsg+0xe0/0x1a0
[T15862]  ____sys_sendmsg+0x6c0/0x840
[T15862]  ___sys_sendmsg+0x1ac/0x1f0
[T15862]  __sys_sendmsg+0x110/0x1d0
[T15862]  __arm64_sys_sendmsg+0x74/0xb0
[T15862]  invoke_syscall+0x88/0x2e0
[T15862]  el0_svc_common.constprop.0+0xe4/0x2a0
[T15862]  do_el0_svc+0x44/0x60
[T15862]  el0_svc+0x50/0x184
[T15862]  el0t_64_sync_handler+0x120/0x12c
[T15862]  el0t_64_sync+0x190/0x194
[T15862]
[T15862] Allocated by task 15857:
[T15862]  kasan_save_stack+0x3c/0x70
[T15862]  kasan_save_track+0x20/0x3c
[T15862]  kasan_save_alloc_info+0x40/0x60
[T15862]  __kasan_kmalloc+0xd4/0xe0
[T15862]  __kmalloc_cache_noprof+0x194/0x334
[T15862]  taprio_change+0x45c/0x2fe0
[T15862]  tc_modify_qdisc+0x6a8/0x1838
[T15862]  rtnetlink_rcv_msg+0x3c8/0xc20
[T15862]  netlink_rcv_skb+0x1f8/0x3d4
[T15862]  rtnetlink_rcv+0x28/0x40
[T15862]  netlink_unicast+0x51c/0x790
[T15862]  netlink_sendmsg+0x79c/0xc20
[T15862]  __sock_sendmsg+0xe0/0x1a0
[T15862]  ____sys_sendmsg+0x6c0/0x840
[T15862]  ___sys_sendmsg+0x1ac/0x1f0
[T15862]  __sys_sendmsg+0x110/0x1d0
[T15862]  __arm64_sys_sendmsg+0x74/0xb0
[T15862]  invoke_syscall+0x88/0x2e0
[T15862]  el0_svc_common.constprop.0+0xe4/0x2a0
[T15862]  do_el0_svc+0x44/0x60
[T15862]  el0_svc+0x50/0x184
[T15862]  el0t_64_sync_handler+0x120/0x12c
[T15862]  el0t_64_sync+0x190/0x194
[T15862]
[T15862] Freed by task 6192:
[T15862]  kasan_save_stack+0x3c/0x70
[T15862]  kasan_save_track+0x20/0x3c
[T15862]  kasan_save_free_info+0x4c/0x80
[T15862]  poison_slab_object+0x110/0x160
[T15862]  __kasan_slab_free+0x3c/0x74
[T15862]  kfree+0x134/0x3c0
[T15862]  taprio_free_sched_cb+0x18c/0x220
[T15862]  rcu_core+0x920/0x1b7c
[T15862]  rcu_core_si+0x10/0x1c
[T15862]  handle_softirqs+0x2e8/0xd64
[T15862]  __do_softirq+0x14/0x20

Fixes: 18cdd2f ("net/sched: taprio: taprio_dump and taprio_change are protected by rtnl_mutex")
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20241018051339.418890-2-dmantipov@yandex.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Nov 18, 2024
commit 3cea8af upstream.

Currently, when configuring TMU (Time Management Unit) mode of a given
router, we take into account only its own TMU requirements ignoring
other routers in the domain. This is problematic if the router we are
configuring has lower TMU requirements than what is already configured
in the domain.

In the scenario below, we have a host router with two USB4 ports: A and
B. Port A connected to device router #1 (which supports CL states) and
existing DisplayPort tunnel, thus, the TMU mode is HiFi uni-directional.

1. Initial topology

          [Host]
         A/
         /
 [Device #1]
   /
Monitor

2. Plug in device #2 (that supports CL states) to downstream port B of
   the host router

         [Host]
        A/    B\
        /       \
 [Device #1]    [Device #2]
   /
Monitor

The TMU mode on port B and port A will be configured to LowRes which is
not what we want and will cause monitor to start flickering.

To address this we first scan the domain and search for any router
configured to HiFi uni-directional mode, and if found, configure TMU
mode of the given router to HiFi uni-directional as well.

Cc: stable@vger.kernel.org
Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tobetter pushed a commit that referenced this issue Nov 18, 2024
[ Upstream commit c749d9b ]

generic/077 on x86_32 CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP=y with highmem,
on huge=always tmpfs, issues a warning and then hangs (interruptibly):

WARNING: CPU: 5 PID: 3517 at mm/highmem.c:622 kunmap_local_indexed+0x62/0xc9
CPU: 5 UID: 0 PID: 3517 Comm: cp Not tainted 6.12.0-rc4 #2
...
copy_page_from_iter_atomic+0xa6/0x5ec
generic_perform_write+0xf6/0x1b4
shmem_file_write_iter+0x54/0x67

Fix copy_page_from_iter_atomic() by limiting it in that case
(include/linux/skbuff.h skb_frag_must_loop() does similar).

But going forward, perhaps CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP is too
surprising, has outlived its usefulness, and should just be removed?

Fixes: 908a1ad ("iov_iter: Handle compound highmem pages in copy_page_from_iter_atomic()")
Signed-off-by: Hugh Dickins <hughd@google.com>
Link: https://lore.kernel.org/r/dd5f0c89-186e-18e1-4f43-19a60f5a9774@google.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Nov 18, 2024
commit 1f26339 upstream.

The scope of the TX skb is wider than just mse102x_tx_frame_spi(),
so in case the TX skb room needs to be expanded, we should free the
the temporary skb instead of the original skb. Otherwise the original
TX skb pointer would be freed again in mse102x_tx_work(), which leads
to crashes:

  Internal error: Oops: 0000000096000004 [#2] PREEMPT SMP
  CPU: 0 PID: 712 Comm: kworker/0:1 Tainted: G      D            6.6.23
  Hardware name: chargebyte Charge SOM DC-ONE (DT)
  Workqueue: events mse102x_tx_work [mse102x]
  pstate: 20400009 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  pc : skb_release_data+0xb8/0x1d8
  lr : skb_release_data+0x1ac/0x1d8
  sp : ffff8000819a3cc0
  x29: ffff8000819a3cc0 x28: ffff0000046daa60 x27: ffff0000057f2dc0
  x26: ffff000005386c00 x25: 0000000000000002 x24: 00000000ffffffff
  x23: 0000000000000000 x22: 0000000000000001 x21: ffff0000057f2e50
  x20: 0000000000000006 x19: 0000000000000000 x18: ffff00003fdacfcc
  x17: e69ad452d0c49def x16: 84a005feff870102 x15: 0000000000000000
  x14: 000000000000024a x13: 0000000000000002 x12: 0000000000000000
  x11: 0000000000000400 x10: 0000000000000930 x9 : ffff00003fd913e8
  x8 : fffffc00001bc008
  x7 : 0000000000000000 x6 : 0000000000000008
  x5 : ffff00003fd91340 x4 : 0000000000000000 x3 : 0000000000000009
  x2 : 00000000fffffffe x1 : 0000000000000000 x0 : 0000000000000000
  Call trace:
   skb_release_data+0xb8/0x1d8
   kfree_skb_reason+0x48/0xb0
   mse102x_tx_work+0x164/0x35c [mse102x]
   process_one_work+0x138/0x260
   worker_thread+0x32c/0x438
   kthread+0x118/0x11c
   ret_from_fork+0x10/0x20
  Code: aa1303e0 97fffab6 72001c1f 54000141 (f9400660)

Cc: stable@vger.kernel.org
Fixes: 2f207cb ("net: vertexcom: Add MSE102x SPI support")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://patch.msgid.link/20241105163101.33216-1-wahrenst@gmx.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tobetter pushed a commit that referenced this issue Dec 13, 2024
[ Upstream commit 953e549 ]

Lockdep gives a false positive splat as it can't distinguish the lock
which is taken by different IRQ descriptors from different IRQ chips
that are organized in a way of a hierarchy:

   ======================================================
   WARNING: possible circular locking dependency detected
   6.12.0-rc5-next-20241101-00148-g9fabf8160b53 torvalds#562 Tainted: G        W
   ------------------------------------------------------
   modprobe/141 is trying to acquire lock:
   ffff899446947868 (intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock){+.+.}-{4:4}, at: regmap_update_bits_base+0x33/0x90

   but task is already holding lock:
   ffff899446947c68 (&d->lock){+.+.}-{4:4}, at: __setup_irq+0x682/0x790

   which lock already depends on the new lock.

   -> #3 (&d->lock){+.+.}-{4:4}:
   -> #2 (&desc->request_mutex){+.+.}-{4:4}:
   -> #1 (ipclock){+.+.}-{4:4}:
   -> #0 (intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock){+.+.}-{4:4}:

   Chain exists of:
     intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock --> &desc->request_mutex --> &d->lock

    Possible unsafe locking scenario:

          CPU0                    CPU1
          ----                    ----
     lock(&d->lock);
                                  lock(&desc->request_mutex);
                                  lock(&d->lock);
     lock(intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock);

    *** DEADLOCK ***

   3 locks held by modprobe/141:
    #0: ffff8994419368f8 (&dev->mutex){....}-{4:4}, at: __driver_attach+0xf6/0x250
    #1: ffff89944690b250 (&desc->request_mutex){+.+.}-{4:4}, at: __setup_irq+0x1a2/0x790
    #2: ffff899446947c68 (&d->lock){+.+.}-{4:4}, at: __setup_irq+0x682/0x790

Set a lockdep class when we map the IRQ so that it doesn't warn about
a lockdep bug that doesn't exist.

Fixes: 4af8be6 ("regmap: Convert regmap_irq to use irq_domain")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241101165553.4055617-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 13, 2024
[ Upstream commit 06dbbb4 ]

copy_from_kernel_nofault() can be called when doing read of /proc/kcore.
/proc/kcore can have some unmapped kfence objects which when read via
copy_from_kernel_nofault() can cause page faults. Since *_nofault()
functions define their own fixup table for handling fault, use that
instead of asking kfence to handle such faults.

Hence we search the exception tables for the nip which generated the
fault. If there is an entry then we let the fixup table handler handle the
page fault by returning an error from within ___do_page_fault().

This can be easily triggered if someone tries to do dd from /proc/kcore.
eg. dd if=/proc/kcore of=/dev/null bs=1M

Some example false negatives:

  ===============================
  BUG: KFENCE: invalid read in copy_from_kernel_nofault+0x9c/0x1a0
  Invalid read at 0xc0000000fdff0000:
   copy_from_kernel_nofault+0x9c/0x1a0
   0xc00000000665f950
   read_kcore_iter+0x57c/0xa04
   proc_reg_read_iter+0xe4/0x16c
   vfs_read+0x320/0x3ec
   ksys_read+0x90/0x154
   system_call_exception+0x120/0x310
   system_call_vectored_common+0x15c/0x2ec

  BUG: KFENCE: use-after-free read in copy_from_kernel_nofault+0x9c/0x1a0
  Use-after-free read at 0xc0000000fe050000 (in kfence-#2):
   copy_from_kernel_nofault+0x9c/0x1a0
   0xc00000000665f950
   read_kcore_iter+0x57c/0xa04
   proc_reg_read_iter+0xe4/0x16c
   vfs_read+0x320/0x3ec
   ksys_read+0x90/0x154
   system_call_exception+0x120/0x310
   system_call_vectored_common+0x15c/0x2ec

Fixes: 90cbac0 ("powerpc: Enable KFENCE for PPC32")
Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reported-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/a411788081d50e3b136c6270471e35aba3dfafa3.1729271995.git.ritesh.list@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 13, 2024
[ Upstream commit cadae3a ]

The dtl_access_lock needs to be a rw_sempahore, a sleeping lock, because
the code calls kmalloc() while holding it, which can sleep:

  # echo 1 > /proc/powerpc/vcpudispatch_stats
  BUG: sleeping function called from invalid context at include/linux/sched/mm.h:337
  in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 199, name: sh
  preempt_count: 1, expected: 0
  3 locks held by sh/199:
   #0: c00000000a0743f8 (sb_writers#3){.+.+}-{0:0}, at: vfs_write+0x324/0x438
   #1: c0000000028c7058 (dtl_enable_mutex){+.+.}-{3:3}, at: vcpudispatch_stats_write+0xd4/0x5f4
   #2: c0000000028c70b8 (dtl_access_lock){+.+.}-{2:2}, at: vcpudispatch_stats_write+0x220/0x5f4
  CPU: 0 PID: 199 Comm: sh Not tainted 6.10.0-rc4 torvalds#152
  Hardware name: IBM pSeries (emulated by qemu) POWER9 (raw) 0x4e1202 0xf000005 of:SLOF,HEAD hv:linux,kvm pSeries
  Call Trace:
    dump_stack_lvl+0x130/0x148 (unreliable)
    __might_resched+0x174/0x410
    kmem_cache_alloc_noprof+0x340/0x3d0
    alloc_dtl_buffers+0x124/0x1ac
    vcpudispatch_stats_write+0x2a8/0x5f4
    proc_reg_write+0xf4/0x150
    vfs_write+0xfc/0x438
    ksys_write+0x88/0x148
    system_call_exception+0x1c4/0x5a0
    system_call_common+0xf4/0x258

Fixes: 06220d7 ("powerpc/pseries: Introduce rwlock to gatekeep DTLB usage")
Tested-by: Kajol Jain <kjain@linux.ibm.com>
Reviewed-by: Nysal Jan K.A <nysal@linux.ibm.com>
Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20240819122401.513203-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 13, 2024
[ Upstream commit f10a890 ]

syzbot reports deadlock issue of f2fs as below:

======================================================
WARNING: possible circular locking dependency detected
6.12.0-rc3-syzkaller-00087-gc964ced77262 #0 Not tainted
------------------------------------------------------
kswapd0/79 is trying to acquire lock:
ffff888011824088 (&sbi->sb_lock){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2199 [inline]
ffff888011824088 (&sbi->sb_lock){++++}-{3:3}, at: f2fs_record_stop_reason+0x52/0x1d0 fs/f2fs/super.c:4068

but task is already holding lock:
ffff88804bd92610 (sb_internal#2){.+.+}-{0:0}, at: f2fs_evict_inode+0x662/0x15c0 fs/f2fs/inode.c:842

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #2 (sb_internal#2){.+.+}-{0:0}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1716 [inline]
       sb_start_intwrite+0x4d/0x1c0 include/linux/fs.h:1899
       f2fs_evict_inode+0x662/0x15c0 fs/f2fs/inode.c:842
       evict+0x4e8/0x9b0 fs/inode.c:725
       f2fs_evict_inode+0x1a4/0x15c0 fs/f2fs/inode.c:807
       evict+0x4e8/0x9b0 fs/inode.c:725
       dispose_list fs/inode.c:774 [inline]
       prune_icache_sb+0x239/0x2f0 fs/inode.c:963
       super_cache_scan+0x38c/0x4b0 fs/super.c:223
       do_shrink_slab+0x701/0x1160 mm/shrinker.c:435
       shrink_slab+0x1093/0x14d0 mm/shrinker.c:662
       shrink_one+0x43b/0x850 mm/vmscan.c:4818
       shrink_many mm/vmscan.c:4879 [inline]
       lru_gen_shrink_node mm/vmscan.c:4957 [inline]
       shrink_node+0x3799/0x3de0 mm/vmscan.c:5937
       kswapd_shrink_node mm/vmscan.c:6765 [inline]
       balance_pgdat mm/vmscan.c:6957 [inline]
       kswapd+0x1ca3/0x3700 mm/vmscan.c:7226
       kthread+0x2f0/0x390 kernel/kthread.c:389
       ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

-> #1 (fs_reclaim){+.+.}-{0:0}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       __fs_reclaim_acquire mm/page_alloc.c:3834 [inline]
       fs_reclaim_acquire+0x88/0x130 mm/page_alloc.c:3848
       might_alloc include/linux/sched/mm.h:318 [inline]
       prepare_alloc_pages+0x147/0x5b0 mm/page_alloc.c:4493
       __alloc_pages_noprof+0x16f/0x710 mm/page_alloc.c:4722
       alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
       alloc_pages_noprof mm/mempolicy.c:2345 [inline]
       folio_alloc_noprof+0x128/0x180 mm/mempolicy.c:2352
       filemap_alloc_folio_noprof+0xdf/0x500 mm/filemap.c:1010
       do_read_cache_folio+0x2eb/0x850 mm/filemap.c:3787
       read_mapping_folio include/linux/pagemap.h:1011 [inline]
       f2fs_commit_super+0x3c0/0x7d0 fs/f2fs/super.c:4032
       f2fs_record_stop_reason+0x13b/0x1d0 fs/f2fs/super.c:4079
       f2fs_handle_critical_error+0x2ac/0x5c0 fs/f2fs/super.c:4174
       f2fs_write_inode+0x35f/0x4d0 fs/f2fs/inode.c:785
       write_inode fs/fs-writeback.c:1503 [inline]
       __writeback_single_inode+0x711/0x10d0 fs/fs-writeback.c:1723
       writeback_single_inode+0x1f3/0x660 fs/fs-writeback.c:1779
       sync_inode_metadata+0xc4/0x120 fs/fs-writeback.c:2849
       f2fs_release_file+0xa8/0x100 fs/f2fs/file.c:1941
       __fput+0x23f/0x880 fs/file_table.c:431
       task_work_run+0x24f/0x310 kernel/task_work.c:228
       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:328 [inline]
       __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
       syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218
       do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&sbi->sb_lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3161 [inline]
       check_prevs_add kernel/locking/lockdep.c:3280 [inline]
       validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
       __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       down_write+0x99/0x220 kernel/locking/rwsem.c:1577
       f2fs_down_write fs/f2fs/f2fs.h:2199 [inline]
       f2fs_record_stop_reason+0x52/0x1d0 fs/f2fs/super.c:4068
       f2fs_handle_critical_error+0x2ac/0x5c0 fs/f2fs/super.c:4174
       f2fs_evict_inode+0xa61/0x15c0 fs/f2fs/inode.c:883
       evict+0x4e8/0x9b0 fs/inode.c:725
       f2fs_evict_inode+0x1a4/0x15c0 fs/f2fs/inode.c:807
       evict+0x4e8/0x9b0 fs/inode.c:725
       dispose_list fs/inode.c:774 [inline]
       prune_icache_sb+0x239/0x2f0 fs/inode.c:963
       super_cache_scan+0x38c/0x4b0 fs/super.c:223
       do_shrink_slab+0x701/0x1160 mm/shrinker.c:435
       shrink_slab+0x1093/0x14d0 mm/shrinker.c:662
       shrink_one+0x43b/0x850 mm/vmscan.c:4818
       shrink_many mm/vmscan.c:4879 [inline]
       lru_gen_shrink_node mm/vmscan.c:4957 [inline]
       shrink_node+0x3799/0x3de0 mm/vmscan.c:5937
       kswapd_shrink_node mm/vmscan.c:6765 [inline]
       balance_pgdat mm/vmscan.c:6957 [inline]
       kswapd+0x1ca3/0x3700 mm/vmscan.c:7226
       kthread+0x2f0/0x390 kernel/kthread.c:389
       ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

other info that might help us debug this:

Chain exists of:
  &sbi->sb_lock --> fs_reclaim --> sb_internal#2

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(sb_internal#2);
                               lock(fs_reclaim);
                               lock(sb_internal#2);
  lock(&sbi->sb_lock);

Root cause is there will be potential deadlock in between
below tasks:

Thread A				Kswapd
- f2fs_ioc_commit_atomic_write
 - mnt_want_write_file -- down_read lock A
					- balance_pgdat
					 - __fs_reclaim_acquire  -- lock B
					  - shrink_node
					   - prune_icache_sb
					    - dispose_list
					     - f2fs_evict_inode
					      - sb_start_intwrite  -- down_read lock A
 - f2fs_do_sync_file
  - f2fs_write_inode
   - f2fs_handle_critical_error
    - f2fs_record_stop_reason
     - f2fs_commit_super
      - read_mapping_folio
       - filemap_alloc_folio_noprof
        - fs_reclaim_acquire  -- lock B

Both threads try to acquire read lock of lock A, then its upcoming write
lock grabber will trigger deadlock.

Let's always create an asynchronous task in f2fs_handle_critical_error()
rather than calling f2fs_record_stop_reason() synchronously to avoid
this potential deadlock issue.

Fixes: b62e71b ("f2fs: support errors=remount-ro|continue|panic mountoption")
Reported-by: syzbot+be4a9983e95a5e25c8d3@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/6704d667.050a0220.1e4d62.0081.GAE@google.com
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
…ndex

[ Upstream commit e9db1b5 ]

Intel SoundWire machine driver always uses Pin number 2 and above.
Currently, the pin number is used as the FW DAI index directly. As a
result, FW DAI 0 and 1 are never used. That worked fine because we use
up to 2 DAIs in a SDW link. Convert the topology pin index to ALH dai
index, the mapping is using 2-off indexing, iow, pin #2 is ALH dai #0.

The issue exists since beginning. And the Fixes tag is the first commit
that this commit can be applied.

Fixes: b66bfc3 ("ASoC: SOF: sof-audio: Fix broken early bclk feature for SSP")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241127092955.20026-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit 88fd2b7 ]

Commit bab1c29 ("LoongArch: Fix sleeping in atomic context in
setup_tlb_handler()") changes the gfp flag from GFP_KERNEL to GFP_ATOMIC
for alloc_pages_node(). However, for PREEMPT_RT kernels we can still get
a "sleeping in atomic context" error:

[    0.372259] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[    0.372266] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1
[    0.372268] preempt_count: 1, expected: 0
[    0.372270] RCU nest depth: 1, expected: 1
[    0.372272] 3 locks held by swapper/1/0:
[    0.372274]  #0: 900000000c9f5e60 (&pcp->lock){+.+.}-{3:3}, at: get_page_from_freelist+0x524/0x1c60
[    0.372294]  #1: 90000000087013b8 (rcu_read_lock){....}-{1:3}, at: rt_spin_trylock+0x50/0x140
[    0.372305]  #2: 900000047fffd388 (&zone->lock){+.+.}-{3:3}, at: __rmqueue_pcplist+0x30c/0xea0
[    0.372314] irq event stamp: 0
[    0.372316] hardirqs last  enabled at (0): [<0000000000000000>] 0x0
[    0.372322] hardirqs last disabled at (0): [<9000000005947320>] copy_process+0x9c0/0x26e0
[    0.372329] softirqs last  enabled at (0): [<9000000005947320>] copy_process+0x9c0/0x26e0
[    0.372335] softirqs last disabled at (0): [<0000000000000000>] 0x0
[    0.372341] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted 6.12.0-rc7+ #1891
[    0.372346] Hardware name: Loongson Loongson-3A5000-7A1000-1w-CRB/Loongson-LS3A5000-7A1000-1w-CRB, BIOS vUDK2018-LoongArch-V2.0.0-prebeta9 10/21/2022
[    0.372349] Stack : 0000000000000089 9000000005a0db9c 90000000071519c8 9000000100388000
[    0.372486]         900000010038b890 0000000000000000 900000010038b898 9000000007e53788
[    0.372492]         900000000815bcc8 900000000815bcc0 900000010038b700 0000000000000001
[    0.372498]         0000000000000001 4b031894b9d6b725 00000000055ec000 9000000100338fc0
[    0.372503]         00000000000000c4 0000000000000001 000000000000002d 0000000000000003
[    0.372509]         0000000000000030 0000000000000003 00000000055ec000 0000000000000003
[    0.372515]         900000000806d000 9000000007e53788 00000000000000b0 0000000000000004
[    0.372521]         0000000000000000 0000000000000000 900000000c9f5f10 0000000000000000
[    0.372526]         90000000076f12d8 9000000007e53788 9000000005924778 0000000000000000
[    0.372532]         00000000000000b0 0000000000000004 0000000000000000 0000000000070000
[    0.372537]         ...
[    0.372540] Call Trace:
[    0.372542] [<9000000005924778>] show_stack+0x38/0x180
[    0.372548] [<90000000071519c4>] dump_stack_lvl+0x94/0xe4
[    0.372555] [<900000000599b880>] __might_resched+0x1a0/0x260
[    0.372561] [<90000000071675cc>] rt_spin_lock+0x4c/0x140
[    0.372565] [<9000000005cbb768>] __rmqueue_pcplist+0x308/0xea0
[    0.372570] [<9000000005cbed84>] get_page_from_freelist+0x564/0x1c60
[    0.372575] [<9000000005cc0d98>] __alloc_pages_noprof+0x218/0x1820
[    0.372580] [<900000000593b36c>] tlb_init+0x1ac/0x298
[    0.372585] [<9000000005924b74>] per_cpu_trap_init+0x114/0x140
[    0.372589] [<9000000005921964>] cpu_probe+0x4e4/0xa60
[    0.372592] [<9000000005934874>] start_secondary+0x34/0xc0
[    0.372599] [<900000000715615c>] smpboot_entry+0x64/0x6c

This is because in PREEMPT_RT kernels normal spinlocks are replaced by
rt spinlocks and rt_spin_lock() will cause sleeping. Fix it by disabling
NUMA optimization completely for PREEMPT_RT kernels.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit 953e549 ]

Lockdep gives a false positive splat as it can't distinguish the lock
which is taken by different IRQ descriptors from different IRQ chips
that are organized in a way of a hierarchy:

   ======================================================
   WARNING: possible circular locking dependency detected
   6.12.0-rc5-next-20241101-00148-g9fabf8160b53 torvalds#562 Tainted: G        W
   ------------------------------------------------------
   modprobe/141 is trying to acquire lock:
   ffff899446947868 (intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock){+.+.}-{4:4}, at: regmap_update_bits_base+0x33/0x90

   but task is already holding lock:
   ffff899446947c68 (&d->lock){+.+.}-{4:4}, at: __setup_irq+0x682/0x790

   which lock already depends on the new lock.

   -> #3 (&d->lock){+.+.}-{4:4}:
   -> #2 (&desc->request_mutex){+.+.}-{4:4}:
   -> #1 (ipclock){+.+.}-{4:4}:
   -> #0 (intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock){+.+.}-{4:4}:

   Chain exists of:
     intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock --> &desc->request_mutex --> &d->lock

    Possible unsafe locking scenario:

          CPU0                    CPU1
          ----                    ----
     lock(&d->lock);
                                  lock(&desc->request_mutex);
                                  lock(&d->lock);
     lock(intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock);

    *** DEADLOCK ***

   3 locks held by modprobe/141:
    #0: ffff8994419368f8 (&dev->mutex){....}-{4:4}, at: __driver_attach+0xf6/0x250
    #1: ffff89944690b250 (&desc->request_mutex){+.+.}-{4:4}, at: __setup_irq+0x1a2/0x790
    #2: ffff899446947c68 (&d->lock){+.+.}-{4:4}, at: __setup_irq+0x682/0x790

Set a lockdep class when we map the IRQ so that it doesn't warn about
a lockdep bug that doesn't exist.

Fixes: 4af8be6 ("regmap: Convert regmap_irq to use irq_domain")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241101165553.4055617-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit 06dbbb4 ]

copy_from_kernel_nofault() can be called when doing read of /proc/kcore.
/proc/kcore can have some unmapped kfence objects which when read via
copy_from_kernel_nofault() can cause page faults. Since *_nofault()
functions define their own fixup table for handling fault, use that
instead of asking kfence to handle such faults.

Hence we search the exception tables for the nip which generated the
fault. If there is an entry then we let the fixup table handler handle the
page fault by returning an error from within ___do_page_fault().

This can be easily triggered if someone tries to do dd from /proc/kcore.
eg. dd if=/proc/kcore of=/dev/null bs=1M

Some example false negatives:

  ===============================
  BUG: KFENCE: invalid read in copy_from_kernel_nofault+0x9c/0x1a0
  Invalid read at 0xc0000000fdff0000:
   copy_from_kernel_nofault+0x9c/0x1a0
   0xc00000000665f950
   read_kcore_iter+0x57c/0xa04
   proc_reg_read_iter+0xe4/0x16c
   vfs_read+0x320/0x3ec
   ksys_read+0x90/0x154
   system_call_exception+0x120/0x310
   system_call_vectored_common+0x15c/0x2ec

  BUG: KFENCE: use-after-free read in copy_from_kernel_nofault+0x9c/0x1a0
  Use-after-free read at 0xc0000000fe050000 (in kfence-#2):
   copy_from_kernel_nofault+0x9c/0x1a0
   0xc00000000665f950
   read_kcore_iter+0x57c/0xa04
   proc_reg_read_iter+0xe4/0x16c
   vfs_read+0x320/0x3ec
   ksys_read+0x90/0x154
   system_call_exception+0x120/0x310
   system_call_vectored_common+0x15c/0x2ec

Fixes: 90cbac0 ("powerpc: Enable KFENCE for PPC32")
Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reported-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/a411788081d50e3b136c6270471e35aba3dfafa3.1729271995.git.ritesh.list@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit cadae3a ]

The dtl_access_lock needs to be a rw_sempahore, a sleeping lock, because
the code calls kmalloc() while holding it, which can sleep:

  # echo 1 > /proc/powerpc/vcpudispatch_stats
  BUG: sleeping function called from invalid context at include/linux/sched/mm.h:337
  in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 199, name: sh
  preempt_count: 1, expected: 0
  3 locks held by sh/199:
   #0: c00000000a0743f8 (sb_writers#3){.+.+}-{0:0}, at: vfs_write+0x324/0x438
   #1: c0000000028c7058 (dtl_enable_mutex){+.+.}-{3:3}, at: vcpudispatch_stats_write+0xd4/0x5f4
   #2: c0000000028c70b8 (dtl_access_lock){+.+.}-{2:2}, at: vcpudispatch_stats_write+0x220/0x5f4
  CPU: 0 PID: 199 Comm: sh Not tainted 6.10.0-rc4 torvalds#152
  Hardware name: IBM pSeries (emulated by qemu) POWER9 (raw) 0x4e1202 0xf000005 of:SLOF,HEAD hv:linux,kvm pSeries
  Call Trace:
    dump_stack_lvl+0x130/0x148 (unreliable)
    __might_resched+0x174/0x410
    kmem_cache_alloc_noprof+0x340/0x3d0
    alloc_dtl_buffers+0x124/0x1ac
    vcpudispatch_stats_write+0x2a8/0x5f4
    proc_reg_write+0xf4/0x150
    vfs_write+0xfc/0x438
    ksys_write+0x88/0x148
    system_call_exception+0x1c4/0x5a0
    system_call_common+0xf4/0x258

Fixes: 06220d7 ("powerpc/pseries: Introduce rwlock to gatekeep DTLB usage")
Tested-by: Kajol Jain <kjain@linux.ibm.com>
Reviewed-by: Nysal Jan K.A <nysal@linux.ibm.com>
Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20240819122401.513203-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit 88fd2b7 ]

Commit bab1c29 ("LoongArch: Fix sleeping in atomic context in
setup_tlb_handler()") changes the gfp flag from GFP_KERNEL to GFP_ATOMIC
for alloc_pages_node(). However, for PREEMPT_RT kernels we can still get
a "sleeping in atomic context" error:

[    0.372259] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[    0.372266] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1
[    0.372268] preempt_count: 1, expected: 0
[    0.372270] RCU nest depth: 1, expected: 1
[    0.372272] 3 locks held by swapper/1/0:
[    0.372274]  #0: 900000000c9f5e60 (&pcp->lock){+.+.}-{3:3}, at: get_page_from_freelist+0x524/0x1c60
[    0.372294]  #1: 90000000087013b8 (rcu_read_lock){....}-{1:3}, at: rt_spin_trylock+0x50/0x140
[    0.372305]  #2: 900000047fffd388 (&zone->lock){+.+.}-{3:3}, at: __rmqueue_pcplist+0x30c/0xea0
[    0.372314] irq event stamp: 0
[    0.372316] hardirqs last  enabled at (0): [<0000000000000000>] 0x0
[    0.372322] hardirqs last disabled at (0): [<9000000005947320>] copy_process+0x9c0/0x26e0
[    0.372329] softirqs last  enabled at (0): [<9000000005947320>] copy_process+0x9c0/0x26e0
[    0.372335] softirqs last disabled at (0): [<0000000000000000>] 0x0
[    0.372341] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted 6.12.0-rc7+ #1891
[    0.372346] Hardware name: Loongson Loongson-3A5000-7A1000-1w-CRB/Loongson-LS3A5000-7A1000-1w-CRB, BIOS vUDK2018-LoongArch-V2.0.0-prebeta9 10/21/2022
[    0.372349] Stack : 0000000000000089 9000000005a0db9c 90000000071519c8 9000000100388000
[    0.372486]         900000010038b890 0000000000000000 900000010038b898 9000000007e53788
[    0.372492]         900000000815bcc8 900000000815bcc0 900000010038b700 0000000000000001
[    0.372498]         0000000000000001 4b031894b9d6b725 00000000055ec000 9000000100338fc0
[    0.372503]         00000000000000c4 0000000000000001 000000000000002d 0000000000000003
[    0.372509]         0000000000000030 0000000000000003 00000000055ec000 0000000000000003
[    0.372515]         900000000806d000 9000000007e53788 00000000000000b0 0000000000000004
[    0.372521]         0000000000000000 0000000000000000 900000000c9f5f10 0000000000000000
[    0.372526]         90000000076f12d8 9000000007e53788 9000000005924778 0000000000000000
[    0.372532]         00000000000000b0 0000000000000004 0000000000000000 0000000000070000
[    0.372537]         ...
[    0.372540] Call Trace:
[    0.372542] [<9000000005924778>] show_stack+0x38/0x180
[    0.372548] [<90000000071519c4>] dump_stack_lvl+0x94/0xe4
[    0.372555] [<900000000599b880>] __might_resched+0x1a0/0x260
[    0.372561] [<90000000071675cc>] rt_spin_lock+0x4c/0x140
[    0.372565] [<9000000005cbb768>] __rmqueue_pcplist+0x308/0xea0
[    0.372570] [<9000000005cbed84>] get_page_from_freelist+0x564/0x1c60
[    0.372575] [<9000000005cc0d98>] __alloc_pages_noprof+0x218/0x1820
[    0.372580] [<900000000593b36c>] tlb_init+0x1ac/0x298
[    0.372585] [<9000000005924b74>] per_cpu_trap_init+0x114/0x140
[    0.372589] [<9000000005921964>] cpu_probe+0x4e4/0xa60
[    0.372592] [<9000000005934874>] start_secondary+0x34/0xc0
[    0.372599] [<900000000715615c>] smpboot_entry+0x64/0x6c

This is because in PREEMPT_RT kernels normal spinlocks are replaced by
rt spinlocks and rt_spin_lock() will cause sleeping. Fix it by disabling
NUMA optimization completely for PREEMPT_RT kernels.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit 953e549 ]

Lockdep gives a false positive splat as it can't distinguish the lock
which is taken by different IRQ descriptors from different IRQ chips
that are organized in a way of a hierarchy:

   ======================================================
   WARNING: possible circular locking dependency detected
   6.12.0-rc5-next-20241101-00148-g9fabf8160b53 torvalds#562 Tainted: G        W
   ------------------------------------------------------
   modprobe/141 is trying to acquire lock:
   ffff899446947868 (intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock){+.+.}-{4:4}, at: regmap_update_bits_base+0x33/0x90

   but task is already holding lock:
   ffff899446947c68 (&d->lock){+.+.}-{4:4}, at: __setup_irq+0x682/0x790

   which lock already depends on the new lock.

   -> #3 (&d->lock){+.+.}-{4:4}:
   -> #2 (&desc->request_mutex){+.+.}-{4:4}:
   -> #1 (ipclock){+.+.}-{4:4}:
   -> #0 (intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock){+.+.}-{4:4}:

   Chain exists of:
     intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock --> &desc->request_mutex --> &d->lock

    Possible unsafe locking scenario:

          CPU0                    CPU1
          ----                    ----
     lock(&d->lock);
                                  lock(&desc->request_mutex);
                                  lock(&d->lock);
     lock(intel_soc_pmic_bxtwc:502:(&bxtwc_regmap_config)->lock);

    *** DEADLOCK ***

   3 locks held by modprobe/141:
    #0: ffff8994419368f8 (&dev->mutex){....}-{4:4}, at: __driver_attach+0xf6/0x250
    #1: ffff89944690b250 (&desc->request_mutex){+.+.}-{4:4}, at: __setup_irq+0x1a2/0x790
    #2: ffff899446947c68 (&d->lock){+.+.}-{4:4}, at: __setup_irq+0x682/0x790

Set a lockdep class when we map the IRQ so that it doesn't warn about
a lockdep bug that doesn't exist.

Fixes: 4af8be6 ("regmap: Convert regmap_irq to use irq_domain")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241101165553.4055617-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit 06dbbb4 ]

copy_from_kernel_nofault() can be called when doing read of /proc/kcore.
/proc/kcore can have some unmapped kfence objects which when read via
copy_from_kernel_nofault() can cause page faults. Since *_nofault()
functions define their own fixup table for handling fault, use that
instead of asking kfence to handle such faults.

Hence we search the exception tables for the nip which generated the
fault. If there is an entry then we let the fixup table handler handle the
page fault by returning an error from within ___do_page_fault().

This can be easily triggered if someone tries to do dd from /proc/kcore.
eg. dd if=/proc/kcore of=/dev/null bs=1M

Some example false negatives:

  ===============================
  BUG: KFENCE: invalid read in copy_from_kernel_nofault+0x9c/0x1a0
  Invalid read at 0xc0000000fdff0000:
   copy_from_kernel_nofault+0x9c/0x1a0
   0xc00000000665f950
   read_kcore_iter+0x57c/0xa04
   proc_reg_read_iter+0xe4/0x16c
   vfs_read+0x320/0x3ec
   ksys_read+0x90/0x154
   system_call_exception+0x120/0x310
   system_call_vectored_common+0x15c/0x2ec

  BUG: KFENCE: use-after-free read in copy_from_kernel_nofault+0x9c/0x1a0
  Use-after-free read at 0xc0000000fe050000 (in kfence-#2):
   copy_from_kernel_nofault+0x9c/0x1a0
   0xc00000000665f950
   read_kcore_iter+0x57c/0xa04
   proc_reg_read_iter+0xe4/0x16c
   vfs_read+0x320/0x3ec
   ksys_read+0x90/0x154
   system_call_exception+0x120/0x310
   system_call_vectored_common+0x15c/0x2ec

Fixes: 90cbac0 ("powerpc: Enable KFENCE for PPC32")
Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reported-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/a411788081d50e3b136c6270471e35aba3dfafa3.1729271995.git.ritesh.list@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Dec 19, 2024
[ Upstream commit cadae3a ]

The dtl_access_lock needs to be a rw_sempahore, a sleeping lock, because
the code calls kmalloc() while holding it, which can sleep:

  # echo 1 > /proc/powerpc/vcpudispatch_stats
  BUG: sleeping function called from invalid context at include/linux/sched/mm.h:337
  in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 199, name: sh
  preempt_count: 1, expected: 0
  3 locks held by sh/199:
   #0: c00000000a0743f8 (sb_writers#3){.+.+}-{0:0}, at: vfs_write+0x324/0x438
   #1: c0000000028c7058 (dtl_enable_mutex){+.+.}-{3:3}, at: vcpudispatch_stats_write+0xd4/0x5f4
   #2: c0000000028c70b8 (dtl_access_lock){+.+.}-{2:2}, at: vcpudispatch_stats_write+0x220/0x5f4
  CPU: 0 PID: 199 Comm: sh Not tainted 6.10.0-rc4 torvalds#152
  Hardware name: IBM pSeries (emulated by qemu) POWER9 (raw) 0x4e1202 0xf000005 of:SLOF,HEAD hv:linux,kvm pSeries
  Call Trace:
    dump_stack_lvl+0x130/0x148 (unreliable)
    __might_resched+0x174/0x410
    kmem_cache_alloc_noprof+0x340/0x3d0
    alloc_dtl_buffers+0x124/0x1ac
    vcpudispatch_stats_write+0x2a8/0x5f4
    proc_reg_write+0xf4/0x150
    vfs_write+0xfc/0x438
    ksys_write+0x88/0x148
    system_call_exception+0x1c4/0x5a0
    system_call_common+0xf4/0x258

Fixes: 06220d7 ("powerpc/pseries: Introduce rwlock to gatekeep DTLB usage")
Tested-by: Kajol Jain <kjain@linux.ibm.com>
Reviewed-by: Nysal Jan K.A <nysal@linux.ibm.com>
Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20240819122401.513203-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 542ed81 ]

Access to genmask field in struct nft_set_ext results in unaligned
atomic read:

[   72.130109] Unable to handle kernel paging request at virtual address ffff0000c2bb708c
[   72.131036] Mem abort info:
[   72.131213]   ESR = 0x0000000096000021
[   72.131446]   EC = 0x25: DABT (current EL), IL = 32 bits
[   72.132209]   SET = 0, FnV = 0
[   72.133216]   EA = 0, S1PTW = 0
[   72.134080]   FSC = 0x21: alignment fault
[   72.135593] Data abort info:
[   72.137194]   ISV = 0, ISS = 0x00000021, ISS2 = 0x00000000
[   72.142351]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[   72.145989]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[   72.150115] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000237d27000
[   72.154893] [ffff0000c2bb708c] pgd=0000000000000000, p4d=180000023ffff403, pud=180000023f84b403, pmd=180000023f835403,
+pte=0068000102bb7707
[   72.163021] Internal error: Oops: 0000000096000021 [#1] SMP
[...]
[   72.170041] CPU: 7 UID: 0 PID: 54 Comm: kworker/7:0 Tainted: G            E      6.13.0-rc3+ #2
[   72.170509] Tainted: [E]=UNSIGNED_MODULE
[   72.170720] Hardware name: QEMU QEMU Virtual Machine, BIOS edk2-stable202302-for-qemu 03/01/2023
[   72.171192] Workqueue: events_power_efficient nft_rhash_gc [nf_tables]
[   72.171552] pstate: 21400005 (nzCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
[   72.171915] pc : nft_rhash_gc+0x200/0x2d8 [nf_tables]
[   72.172166] lr : nft_rhash_gc+0x128/0x2d8 [nf_tables]
[   72.172546] sp : ffff800081f2bce0
[   72.172724] x29: ffff800081f2bd40 x28: ffff0000c2bb708c x27: 0000000000000038
[   72.173078] x26: ffff0000c6780ef0 x25: ffff0000c643df00 x24: ffff0000c6778f78
[   72.173431] x23: 000000000000001a x22: ffff0000c4b1f000 x21: ffff0000c6780f78
[   72.173782] x20: ffff0000c2bb70dc x19: ffff0000c2bb7080 x18: 0000000000000000
[   72.174135] x17: ffff0000c0a4e1c0 x16: 0000000000003000 x15: 0000ac26d173b978
[   72.174485] x14: ffffffffffffffff x13: 0000000000000030 x12: ffff0000c6780ef0
[   72.174841] x11: 0000000000000000 x10: ffff800081f2bcf8 x9 : ffff0000c3000000
[   72.175193] x8 : 00000000000004be x7 : 0000000000000000 x6 : 0000000000000000
[   72.175544] x5 : 0000000000000040 x4 : ffff0000c3000010 x3 : 0000000000000000
[   72.175871] x2 : 0000000000003a98 x1 : ffff0000c2bb708c x0 : 0000000000000004
[   72.176207] Call trace:
[   72.176316]  nft_rhash_gc+0x200/0x2d8 [nf_tables] (P)
[   72.176653]  process_one_work+0x178/0x3d0
[   72.176831]  worker_thread+0x200/0x3f0
[   72.176995]  kthread+0xe8/0xf8
[   72.177130]  ret_from_fork+0x10/0x20
[   72.177289] Code: 54fff984 d503201f d2800080 91003261 (f820303f)
[   72.177557] ---[ end trace 0000000000000000 ]---

Align struct nft_set_ext to word size to address this and
documentation it.

pahole reports that this increases the size of elements for rhash and
pipapo in 8 bytes on x86_64.

Fixes: 7ffc748 ("netfilter: nft_set_hash: skip duplicated elements pending gc run")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
…le_direct_reclaim()

commit 6aaced5 upstream.

The task sometimes continues looping in throttle_direct_reclaim() because
allow_direct_reclaim(pgdat) keeps returning false.

 #0 [ffff80002cb6f8d0] __switch_to at ffff8000080095ac
 #1 [ffff80002cb6f900] __schedule at ffff800008abbd1c
 #2 [ffff80002cb6f990] schedule at ffff800008abc50c
 #3 [ffff80002cb6f9b0] throttle_direct_reclaim at ffff800008273550
 #4 [ffff80002cb6fa20] try_to_free_pages at ffff800008277b68
 #5 [ffff80002cb6fae0] __alloc_pages_nodemask at ffff8000082c4660
 #6 [ffff80002cb6fc50] alloc_pages_vma at ffff8000082e4a98
 #7 [ffff80002cb6fca0] do_anonymous_page at ffff80000829f5a8
 #8 [ffff80002cb6fce0] __handle_mm_fault at ffff8000082a5974
 #9 [ffff80002cb6fd90] handle_mm_fault at ffff8000082a5bd4

At this point, the pgdat contains the following two zones:

        NODE: 4  ZONE: 0  ADDR: ffff00817fffe540  NAME: "DMA32"
          SIZE: 20480  MIN/LOW/HIGH: 11/28/45
          VM_STAT:
                NR_FREE_PAGES: 359
        NR_ZONE_INACTIVE_ANON: 18813
          NR_ZONE_ACTIVE_ANON: 0
        NR_ZONE_INACTIVE_FILE: 50
          NR_ZONE_ACTIVE_FILE: 0
          NR_ZONE_UNEVICTABLE: 0
        NR_ZONE_WRITE_PENDING: 0
                     NR_MLOCK: 0
                    NR_BOUNCE: 0
                   NR_ZSPAGES: 0
            NR_FREE_CMA_PAGES: 0

        NODE: 4  ZONE: 1  ADDR: ffff00817fffec00  NAME: "Normal"
          SIZE: 8454144  PRESENT: 98304  MIN/LOW/HIGH: 68/166/264
          VM_STAT:
                NR_FREE_PAGES: 146
        NR_ZONE_INACTIVE_ANON: 94668
          NR_ZONE_ACTIVE_ANON: 3
        NR_ZONE_INACTIVE_FILE: 735
          NR_ZONE_ACTIVE_FILE: 78
          NR_ZONE_UNEVICTABLE: 0
        NR_ZONE_WRITE_PENDING: 0
                     NR_MLOCK: 0
                    NR_BOUNCE: 0
                   NR_ZSPAGES: 0
            NR_FREE_CMA_PAGES: 0

In allow_direct_reclaim(), while processing ZONE_DMA32, the sum of
inactive/active file-backed pages calculated in zone_reclaimable_pages()
based on the result of zone_page_state_snapshot() is zero.

Additionally, since this system lacks swap, the calculation of inactive/
active anonymous pages is skipped.

        crash> p nr_swap_pages
        nr_swap_pages = $1937 = {
          counter = 0
        }

As a result, ZONE_DMA32 is deemed unreclaimable and skipped, moving on to
the processing of the next zone, ZONE_NORMAL, despite ZONE_DMA32 having
free pages significantly exceeding the high watermark.

The problem is that the pgdat->kswapd_failures hasn't been incremented.

        crash> px ((struct pglist_data *) 0xffff00817fffe540)->kswapd_failures
        $1935 = 0x0

This is because the node deemed balanced.  The node balancing logic in
balance_pgdat() evaluates all zones collectively.  If one or more zones
(e.g., ZONE_DMA32) have enough free pages to meet their watermarks, the
entire node is deemed balanced.  This causes balance_pgdat() to exit early
before incrementing the kswapd_failures, as it considers the overall
memory state acceptable, even though some zones (like ZONE_NORMAL) remain
under significant pressure.


The patch ensures that zone_reclaimable_pages() includes free pages
(NR_FREE_PAGES) in its calculation when no other reclaimable pages are
available (e.g., file-backed or anonymous pages).  This change prevents
zones like ZONE_DMA32, which have sufficient free pages, from being
mistakenly deemed unreclaimable.  By doing so, the patch ensures proper
node balancing, avoids masking pressure on other zones like ZONE_NORMAL,
and prevents infinite loops in throttle_direct_reclaim() caused by
allow_direct_reclaim(pgdat) repeatedly returning false.


The kernel hangs due to a task stuck in throttle_direct_reclaim(), caused
by a node being incorrectly deemed balanced despite pressure in certain
zones, such as ZONE_NORMAL.  This issue arises from
zone_reclaimable_pages() returning 0 for zones without reclaimable file-
backed or anonymous pages, causing zones like ZONE_DMA32 with sufficient
free pages to be skipped.

The lack of swap or reclaimable pages results in ZONE_DMA32 being ignored
during reclaim, masking pressure in other zones.  Consequently,
pgdat->kswapd_failures remains 0 in balance_pgdat(), preventing fallback
mechanisms in allow_direct_reclaim() from being triggered, leading to an
infinite loop in throttle_direct_reclaim().

This patch modifies zone_reclaimable_pages() to account for free pages
(NR_FREE_PAGES) when no other reclaimable pages exist.  This ensures zones
with sufficient free pages are not skipped, enabling proper balancing and
reclaim behavior.

[akpm@linux-foundation.org: coding-style cleanups]
Link: https://lkml.kernel.org/r/20241130164346.436469-1-snishika@redhat.com
Link: https://lkml.kernel.org/r/20241130161236.433747-2-snishika@redhat.com
Fixes: 5a1c84b ("mm: remove reclaim and compaction retry approximations")
Signed-off-by: Seiji Nishikawa <snishika@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 2e3dbf9 ]

Since the netlink attribute range validation provides inclusive
checking, the *max* of attribute NL80211_ATTR_MLO_LINK_ID should be
IEEE80211_MLD_MAX_NUM_LINKS - 1 otherwise causing an off-by-one.

One crash stack for demonstration:
==================================================================
BUG: KASAN: wild-memory-access in ieee80211_tx_control_port+0x3b6/0xca0 net/mac80211/tx.c:5939
Read of size 6 at addr 001102080000000c by task fuzzer.386/9508

CPU: 1 PID: 9508 Comm: syz.1.386 Not tainted 6.1.70 #2
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x177/0x231 lib/dump_stack.c:106
 print_report+0xe0/0x750 mm/kasan/report.c:398
 kasan_report+0x139/0x170 mm/kasan/report.c:495
 kasan_check_range+0x287/0x290 mm/kasan/generic.c:189
 memcpy+0x25/0x60 mm/kasan/shadow.c:65
 ieee80211_tx_control_port+0x3b6/0xca0 net/mac80211/tx.c:5939
 rdev_tx_control_port net/wireless/rdev-ops.h:761 [inline]
 nl80211_tx_control_port+0x7b3/0xc40 net/wireless/nl80211.c:15453
 genl_family_rcv_msg_doit+0x22e/0x320 net/netlink/genetlink.c:756
 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
 genl_rcv_msg+0x539/0x740 net/netlink/genetlink.c:850
 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2508
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
 netlink_unicast+0x74b/0x8c0 net/netlink/af_netlink.c:1352
 netlink_sendmsg+0x882/0xb90 net/netlink/af_netlink.c:1874
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 ____sys_sendmsg+0x5cc/0x8f0 net/socket.c:2499
 ___sys_sendmsg+0x21c/0x290 net/socket.c:2553
 __sys_sendmsg net/socket.c:2582 [inline]
 __do_sys_sendmsg net/socket.c:2591 [inline]
 __se_sys_sendmsg+0x19e/0x270 net/socket.c:2589
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x45/0x90 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Update the policy to ensure correct validation.

Fixes: 7b0a0e3 ("wifi: cfg80211: do some rework towards MLO link APIs")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Suggested-by: Cengiz Can <cengiz.can@canonical.com>
Link: https://patch.msgid.link/20241130170526.96698-1-linma@zju.edu.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 05aa156 ]

The mapping VMA address is saved in VAS window struct when the
paste address is mapped. This VMA address is used during migration
to unmap the paste address if the window is active. The paste
address mapping will be removed when the window is closed or with
the munmap(). But the VMA address in the VAS window is not updated
with munmap() which is causing invalid access during migration.

The KASAN report shows:
[16386.254991] BUG: KASAN: slab-use-after-free in reconfig_close_windows+0x1a0/0x4e8
[16386.255043] Read of size 8 at addr c00000014a819670 by task drmgr/696928

[16386.255096] CPU: 29 UID: 0 PID: 696928 Comm: drmgr Kdump: loaded Tainted: G    B              6.11.0-rc5-nxgzip #2
[16386.255128] Tainted: [B]=BAD_PAGE
[16386.255148] Hardware name: IBM,9080-HEX Power11 (architected) 0x820200 0xf000007 of:IBM,FW1110.00 (NH1110_016) hv:phyp pSeries
[16386.255181] Call Trace:
[16386.255202] [c00000016b297660] [c0000000018ad0ac] dump_stack_lvl+0x84/0xe8 (unreliable)
[16386.255246] [c00000016b297690] [c0000000006e8a90] print_report+0x19c/0x764
[16386.255285] [c00000016b297760] [c0000000006e9490] kasan_report+0x128/0x1f8
[16386.255309] [c00000016b297880] [c0000000006eb5c8] __asan_load8+0xac/0xe0
[16386.255326] [c00000016b2978a0] [c00000000013f898] reconfig_close_windows+0x1a0/0x4e8
[16386.255343] [c00000016b297990] [c000000000140e58] vas_migration_handler+0x3a4/0x3fc
[16386.255368] [c00000016b297a90] [c000000000128848] pseries_migrate_partition+0x4c/0x4c4
...

[16386.256136] Allocated by task 696554 on cpu 31 at 16377.277618s:
[16386.256149]  kasan_save_stack+0x34/0x68
[16386.256163]  kasan_save_track+0x34/0x80
[16386.256175]  kasan_save_alloc_info+0x58/0x74
[16386.256196]  __kasan_slab_alloc+0xb8/0xdc
[16386.256209]  kmem_cache_alloc_noprof+0x200/0x3d0
[16386.256225]  vm_area_alloc+0x44/0x150
[16386.256245]  mmap_region+0x214/0x10c4
[16386.256265]  do_mmap+0x5fc/0x750
[16386.256277]  vm_mmap_pgoff+0x14c/0x24c
[16386.256292]  ksys_mmap_pgoff+0x20c/0x348
[16386.256303]  sys_mmap+0xd0/0x160
...

[16386.256350] Freed by task 0 on cpu 31 at 16386.204848s:
[16386.256363]  kasan_save_stack+0x34/0x68
[16386.256374]  kasan_save_track+0x34/0x80
[16386.256384]  kasan_save_free_info+0x64/0x10c
[16386.256396]  __kasan_slab_free+0x120/0x204
[16386.256415]  kmem_cache_free+0x128/0x450
[16386.256428]  vm_area_free_rcu_cb+0xa8/0xd8
[16386.256441]  rcu_do_batch+0x2c8/0xcf0
[16386.256458]  rcu_core+0x378/0x3c4
[16386.256473]  handle_softirqs+0x20c/0x60c
[16386.256495]  do_softirq_own_stack+0x6c/0x88
[16386.256509]  do_softirq_own_stack+0x58/0x88
[16386.256521]  __irq_exit_rcu+0x1a4/0x20c
[16386.256533]  irq_exit+0x20/0x38
[16386.256544]  interrupt_async_exit_prepare.constprop.0+0x18/0x2c
...

[16386.256717] Last potentially related work creation:
[16386.256729]  kasan_save_stack+0x34/0x68
[16386.256741]  __kasan_record_aux_stack+0xcc/0x12c
[16386.256753]  __call_rcu_common.constprop.0+0x94/0xd04
[16386.256766]  vm_area_free+0x28/0x3c
[16386.256778]  remove_vma+0xf4/0x114
[16386.256797]  do_vmi_align_munmap.constprop.0+0x684/0x870
[16386.256811]  __vm_munmap+0xe0/0x1f8
[16386.256821]  sys_munmap+0x54/0x6c
[16386.256830]  system_call_exception+0x1a0/0x4a0
[16386.256841]  system_call_vectored_common+0x15c/0x2ec

[16386.256868] The buggy address belongs to the object at c00000014a819670
                which belongs to the cache vm_area_struct of size 168
[16386.256887] The buggy address is located 0 bytes inside of
                freed 168-byte region [c00000014a819670, c00000014a819718)

[16386.256915] The buggy address belongs to the physical page:
[16386.256928] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14a81
[16386.256950] memcg:c0000000ba430001
[16386.256961] anon flags: 0x43ffff800000000(node=4|zone=0|lastcpupid=0x7ffff)
[16386.256975] page_type: 0xfdffffff(slab)
[16386.256990] raw: 043ffff800000000 c00000000501c080 0000000000000000 5deadbee00000001
[16386.257003] raw: 0000000000000000 00000000011a011a 00000001fdffffff c0000000ba430001
[16386.257018] page dumped because: kasan: bad access detected

This patch adds close() callback in vas_vm_ops vm_operations_struct
which will be executed during munmap() before freeing VMA. The VMA
address in the VAS window is set to NULL after holding the window
mmap_mutex.

Fixes: 37e6764 ("powerpc/pseries/vas: Add VAS migration handler")
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20241214051758.997759-1-haren@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 542ed81 ]

Access to genmask field in struct nft_set_ext results in unaligned
atomic read:

[   72.130109] Unable to handle kernel paging request at virtual address ffff0000c2bb708c
[   72.131036] Mem abort info:
[   72.131213]   ESR = 0x0000000096000021
[   72.131446]   EC = 0x25: DABT (current EL), IL = 32 bits
[   72.132209]   SET = 0, FnV = 0
[   72.133216]   EA = 0, S1PTW = 0
[   72.134080]   FSC = 0x21: alignment fault
[   72.135593] Data abort info:
[   72.137194]   ISV = 0, ISS = 0x00000021, ISS2 = 0x00000000
[   72.142351]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[   72.145989]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[   72.150115] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000237d27000
[   72.154893] [ffff0000c2bb708c] pgd=0000000000000000, p4d=180000023ffff403, pud=180000023f84b403, pmd=180000023f835403,
+pte=0068000102bb7707
[   72.163021] Internal error: Oops: 0000000096000021 [#1] SMP
[...]
[   72.170041] CPU: 7 UID: 0 PID: 54 Comm: kworker/7:0 Tainted: G            E      6.13.0-rc3+ #2
[   72.170509] Tainted: [E]=UNSIGNED_MODULE
[   72.170720] Hardware name: QEMU QEMU Virtual Machine, BIOS edk2-stable202302-for-qemu 03/01/2023
[   72.171192] Workqueue: events_power_efficient nft_rhash_gc [nf_tables]
[   72.171552] pstate: 21400005 (nzCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
[   72.171915] pc : nft_rhash_gc+0x200/0x2d8 [nf_tables]
[   72.172166] lr : nft_rhash_gc+0x128/0x2d8 [nf_tables]
[   72.172546] sp : ffff800081f2bce0
[   72.172724] x29: ffff800081f2bd40 x28: ffff0000c2bb708c x27: 0000000000000038
[   72.173078] x26: ffff0000c6780ef0 x25: ffff0000c643df00 x24: ffff0000c6778f78
[   72.173431] x23: 000000000000001a x22: ffff0000c4b1f000 x21: ffff0000c6780f78
[   72.173782] x20: ffff0000c2bb70dc x19: ffff0000c2bb7080 x18: 0000000000000000
[   72.174135] x17: ffff0000c0a4e1c0 x16: 0000000000003000 x15: 0000ac26d173b978
[   72.174485] x14: ffffffffffffffff x13: 0000000000000030 x12: ffff0000c6780ef0
[   72.174841] x11: 0000000000000000 x10: ffff800081f2bcf8 x9 : ffff0000c3000000
[   72.175193] x8 : 00000000000004be x7 : 0000000000000000 x6 : 0000000000000000
[   72.175544] x5 : 0000000000000040 x4 : ffff0000c3000010 x3 : 0000000000000000
[   72.175871] x2 : 0000000000003a98 x1 : ffff0000c2bb708c x0 : 0000000000000004
[   72.176207] Call trace:
[   72.176316]  nft_rhash_gc+0x200/0x2d8 [nf_tables] (P)
[   72.176653]  process_one_work+0x178/0x3d0
[   72.176831]  worker_thread+0x200/0x3f0
[   72.176995]  kthread+0xe8/0xf8
[   72.177130]  ret_from_fork+0x10/0x20
[   72.177289] Code: 54fff984 d503201f d2800080 91003261 (f820303f)
[   72.177557] ---[ end trace 0000000000000000 ]---

Align struct nft_set_ext to word size to address this and
documentation it.

pahole reports that this increases the size of elements for rhash and
pipapo in 8 bytes on x86_64.

Fixes: 7ffc748 ("netfilter: nft_set_hash: skip duplicated elements pending gc run")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 4d94f05 ]

This reworks hci_cb_list to not use mutex hci_cb_list_lock to avoid bugs
like the bellow:

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:585
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5070, name: kworker/u9:2
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
4 locks held by kworker/u9:2/5070:
 #0: ffff888015be3948 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3229 [inline]
 #0: ffff888015be3948 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x1770 kernel/workqueue.c:3335
 #1: ffffc90003b6fd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3230 [inline]
 #1: ffffc90003b6fd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x1770 kernel/workqueue.c:3335
 #2: ffff8880665d0078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xcf/0xae0 net/bluetooth/hci_event.c:6914
 #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline]
 #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline]
 #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: hci_le_create_big_complete_evt+0xdb/0xae0 net/bluetooth/hci_event.c:6915
CPU: 0 PID: 5070 Comm: kworker/u9:2 Not tainted 6.8.0-syzkaller-08073-g480e035fc4c7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: hci0 hci_rx_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 __might_resched+0x5d4/0x780 kernel/sched/core.c:10187
 __mutex_lock_common kernel/locking/mutex.c:585 [inline]
 __mutex_lock+0xc1/0xd70 kernel/locking/mutex.c:752
 hci_connect_cfm include/net/bluetooth/hci_core.h:2004 [inline]
 hci_le_create_big_complete_evt+0x3d9/0xae0 net/bluetooth/hci_event.c:6939
 hci_event_func net/bluetooth/hci_event.c:7514 [inline]
 hci_event_packet+0xa53/0x1540 net/bluetooth/hci_event.c:7569
 hci_rx_work+0x3e8/0xca0 net/bluetooth/hci_core.c:4171
 process_one_work kernel/workqueue.c:3254 [inline]
 process_scheduled_works+0xa00/0x1770 kernel/workqueue.c:3335
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416
 kthread+0x2f0/0x390 kernel/kthread.c:388
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
 </TASK>

Reported-by: syzbot+2fb0835e0c9cefc34614@syzkaller.appspotmail.com
Tested-by: syzbot+2fb0835e0c9cefc34614@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2fb0835e0c9cefc34614
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
…le_direct_reclaim()

commit 6aaced5 upstream.

The task sometimes continues looping in throttle_direct_reclaim() because
allow_direct_reclaim(pgdat) keeps returning false.

 #0 [ffff80002cb6f8d0] __switch_to at ffff8000080095ac
 #1 [ffff80002cb6f900] __schedule at ffff800008abbd1c
 #2 [ffff80002cb6f990] schedule at ffff800008abc50c
 #3 [ffff80002cb6f9b0] throttle_direct_reclaim at ffff800008273550
 #4 [ffff80002cb6fa20] try_to_free_pages at ffff800008277b68
 #5 [ffff80002cb6fae0] __alloc_pages_nodemask at ffff8000082c4660
 #6 [ffff80002cb6fc50] alloc_pages_vma at ffff8000082e4a98
 #7 [ffff80002cb6fca0] do_anonymous_page at ffff80000829f5a8
 #8 [ffff80002cb6fce0] __handle_mm_fault at ffff8000082a5974
 #9 [ffff80002cb6fd90] handle_mm_fault at ffff8000082a5bd4

At this point, the pgdat contains the following two zones:

        NODE: 4  ZONE: 0  ADDR: ffff00817fffe540  NAME: "DMA32"
          SIZE: 20480  MIN/LOW/HIGH: 11/28/45
          VM_STAT:
                NR_FREE_PAGES: 359
        NR_ZONE_INACTIVE_ANON: 18813
          NR_ZONE_ACTIVE_ANON: 0
        NR_ZONE_INACTIVE_FILE: 50
          NR_ZONE_ACTIVE_FILE: 0
          NR_ZONE_UNEVICTABLE: 0
        NR_ZONE_WRITE_PENDING: 0
                     NR_MLOCK: 0
                    NR_BOUNCE: 0
                   NR_ZSPAGES: 0
            NR_FREE_CMA_PAGES: 0

        NODE: 4  ZONE: 1  ADDR: ffff00817fffec00  NAME: "Normal"
          SIZE: 8454144  PRESENT: 98304  MIN/LOW/HIGH: 68/166/264
          VM_STAT:
                NR_FREE_PAGES: 146
        NR_ZONE_INACTIVE_ANON: 94668
          NR_ZONE_ACTIVE_ANON: 3
        NR_ZONE_INACTIVE_FILE: 735
          NR_ZONE_ACTIVE_FILE: 78
          NR_ZONE_UNEVICTABLE: 0
        NR_ZONE_WRITE_PENDING: 0
                     NR_MLOCK: 0
                    NR_BOUNCE: 0
                   NR_ZSPAGES: 0
            NR_FREE_CMA_PAGES: 0

In allow_direct_reclaim(), while processing ZONE_DMA32, the sum of
inactive/active file-backed pages calculated in zone_reclaimable_pages()
based on the result of zone_page_state_snapshot() is zero.

Additionally, since this system lacks swap, the calculation of inactive/
active anonymous pages is skipped.

        crash> p nr_swap_pages
        nr_swap_pages = $1937 = {
          counter = 0
        }

As a result, ZONE_DMA32 is deemed unreclaimable and skipped, moving on to
the processing of the next zone, ZONE_NORMAL, despite ZONE_DMA32 having
free pages significantly exceeding the high watermark.

The problem is that the pgdat->kswapd_failures hasn't been incremented.

        crash> px ((struct pglist_data *) 0xffff00817fffe540)->kswapd_failures
        $1935 = 0x0

This is because the node deemed balanced.  The node balancing logic in
balance_pgdat() evaluates all zones collectively.  If one or more zones
(e.g., ZONE_DMA32) have enough free pages to meet their watermarks, the
entire node is deemed balanced.  This causes balance_pgdat() to exit early
before incrementing the kswapd_failures, as it considers the overall
memory state acceptable, even though some zones (like ZONE_NORMAL) remain
under significant pressure.


The patch ensures that zone_reclaimable_pages() includes free pages
(NR_FREE_PAGES) in its calculation when no other reclaimable pages are
available (e.g., file-backed or anonymous pages).  This change prevents
zones like ZONE_DMA32, which have sufficient free pages, from being
mistakenly deemed unreclaimable.  By doing so, the patch ensures proper
node balancing, avoids masking pressure on other zones like ZONE_NORMAL,
and prevents infinite loops in throttle_direct_reclaim() caused by
allow_direct_reclaim(pgdat) repeatedly returning false.


The kernel hangs due to a task stuck in throttle_direct_reclaim(), caused
by a node being incorrectly deemed balanced despite pressure in certain
zones, such as ZONE_NORMAL.  This issue arises from
zone_reclaimable_pages() returning 0 for zones without reclaimable file-
backed or anonymous pages, causing zones like ZONE_DMA32 with sufficient
free pages to be skipped.

The lack of swap or reclaimable pages results in ZONE_DMA32 being ignored
during reclaim, masking pressure in other zones.  Consequently,
pgdat->kswapd_failures remains 0 in balance_pgdat(), preventing fallback
mechanisms in allow_direct_reclaim() from being triggered, leading to an
infinite loop in throttle_direct_reclaim().

This patch modifies zone_reclaimable_pages() to account for free pages
(NR_FREE_PAGES) when no other reclaimable pages exist.  This ensures zones
with sufficient free pages are not skipped, enabling proper balancing and
reclaim behavior.

[akpm@linux-foundation.org: coding-style cleanups]
Link: https://lkml.kernel.org/r/20241130164346.436469-1-snishika@redhat.com
Link: https://lkml.kernel.org/r/20241130161236.433747-2-snishika@redhat.com
Fixes: 5a1c84b ("mm: remove reclaim and compaction retry approximations")
Signed-off-by: Seiji Nishikawa <snishika@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 2e3dbf9 ]

Since the netlink attribute range validation provides inclusive
checking, the *max* of attribute NL80211_ATTR_MLO_LINK_ID should be
IEEE80211_MLD_MAX_NUM_LINKS - 1 otherwise causing an off-by-one.

One crash stack for demonstration:
==================================================================
BUG: KASAN: wild-memory-access in ieee80211_tx_control_port+0x3b6/0xca0 net/mac80211/tx.c:5939
Read of size 6 at addr 001102080000000c by task fuzzer.386/9508

CPU: 1 PID: 9508 Comm: syz.1.386 Not tainted 6.1.70 #2
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x177/0x231 lib/dump_stack.c:106
 print_report+0xe0/0x750 mm/kasan/report.c:398
 kasan_report+0x139/0x170 mm/kasan/report.c:495
 kasan_check_range+0x287/0x290 mm/kasan/generic.c:189
 memcpy+0x25/0x60 mm/kasan/shadow.c:65
 ieee80211_tx_control_port+0x3b6/0xca0 net/mac80211/tx.c:5939
 rdev_tx_control_port net/wireless/rdev-ops.h:761 [inline]
 nl80211_tx_control_port+0x7b3/0xc40 net/wireless/nl80211.c:15453
 genl_family_rcv_msg_doit+0x22e/0x320 net/netlink/genetlink.c:756
 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
 genl_rcv_msg+0x539/0x740 net/netlink/genetlink.c:850
 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2508
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
 netlink_unicast+0x74b/0x8c0 net/netlink/af_netlink.c:1352
 netlink_sendmsg+0x882/0xb90 net/netlink/af_netlink.c:1874
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 ____sys_sendmsg+0x5cc/0x8f0 net/socket.c:2499
 ___sys_sendmsg+0x21c/0x290 net/socket.c:2553
 __sys_sendmsg net/socket.c:2582 [inline]
 __do_sys_sendmsg net/socket.c:2591 [inline]
 __se_sys_sendmsg+0x19e/0x270 net/socket.c:2589
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x45/0x90 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Update the policy to ensure correct validation.

Fixes: 7b0a0e3 ("wifi: cfg80211: do some rework towards MLO link APIs")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Suggested-by: Cengiz Can <cengiz.can@canonical.com>
Link: https://patch.msgid.link/20241130170526.96698-1-linma@zju.edu.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 05aa156 ]

The mapping VMA address is saved in VAS window struct when the
paste address is mapped. This VMA address is used during migration
to unmap the paste address if the window is active. The paste
address mapping will be removed when the window is closed or with
the munmap(). But the VMA address in the VAS window is not updated
with munmap() which is causing invalid access during migration.

The KASAN report shows:
[16386.254991] BUG: KASAN: slab-use-after-free in reconfig_close_windows+0x1a0/0x4e8
[16386.255043] Read of size 8 at addr c00000014a819670 by task drmgr/696928

[16386.255096] CPU: 29 UID: 0 PID: 696928 Comm: drmgr Kdump: loaded Tainted: G    B              6.11.0-rc5-nxgzip #2
[16386.255128] Tainted: [B]=BAD_PAGE
[16386.255148] Hardware name: IBM,9080-HEX Power11 (architected) 0x820200 0xf000007 of:IBM,FW1110.00 (NH1110_016) hv:phyp pSeries
[16386.255181] Call Trace:
[16386.255202] [c00000016b297660] [c0000000018ad0ac] dump_stack_lvl+0x84/0xe8 (unreliable)
[16386.255246] [c00000016b297690] [c0000000006e8a90] print_report+0x19c/0x764
[16386.255285] [c00000016b297760] [c0000000006e9490] kasan_report+0x128/0x1f8
[16386.255309] [c00000016b297880] [c0000000006eb5c8] __asan_load8+0xac/0xe0
[16386.255326] [c00000016b2978a0] [c00000000013f898] reconfig_close_windows+0x1a0/0x4e8
[16386.255343] [c00000016b297990] [c000000000140e58] vas_migration_handler+0x3a4/0x3fc
[16386.255368] [c00000016b297a90] [c000000000128848] pseries_migrate_partition+0x4c/0x4c4
...

[16386.256136] Allocated by task 696554 on cpu 31 at 16377.277618s:
[16386.256149]  kasan_save_stack+0x34/0x68
[16386.256163]  kasan_save_track+0x34/0x80
[16386.256175]  kasan_save_alloc_info+0x58/0x74
[16386.256196]  __kasan_slab_alloc+0xb8/0xdc
[16386.256209]  kmem_cache_alloc_noprof+0x200/0x3d0
[16386.256225]  vm_area_alloc+0x44/0x150
[16386.256245]  mmap_region+0x214/0x10c4
[16386.256265]  do_mmap+0x5fc/0x750
[16386.256277]  vm_mmap_pgoff+0x14c/0x24c
[16386.256292]  ksys_mmap_pgoff+0x20c/0x348
[16386.256303]  sys_mmap+0xd0/0x160
...

[16386.256350] Freed by task 0 on cpu 31 at 16386.204848s:
[16386.256363]  kasan_save_stack+0x34/0x68
[16386.256374]  kasan_save_track+0x34/0x80
[16386.256384]  kasan_save_free_info+0x64/0x10c
[16386.256396]  __kasan_slab_free+0x120/0x204
[16386.256415]  kmem_cache_free+0x128/0x450
[16386.256428]  vm_area_free_rcu_cb+0xa8/0xd8
[16386.256441]  rcu_do_batch+0x2c8/0xcf0
[16386.256458]  rcu_core+0x378/0x3c4
[16386.256473]  handle_softirqs+0x20c/0x60c
[16386.256495]  do_softirq_own_stack+0x6c/0x88
[16386.256509]  do_softirq_own_stack+0x58/0x88
[16386.256521]  __irq_exit_rcu+0x1a4/0x20c
[16386.256533]  irq_exit+0x20/0x38
[16386.256544]  interrupt_async_exit_prepare.constprop.0+0x18/0x2c
...

[16386.256717] Last potentially related work creation:
[16386.256729]  kasan_save_stack+0x34/0x68
[16386.256741]  __kasan_record_aux_stack+0xcc/0x12c
[16386.256753]  __call_rcu_common.constprop.0+0x94/0xd04
[16386.256766]  vm_area_free+0x28/0x3c
[16386.256778]  remove_vma+0xf4/0x114
[16386.256797]  do_vmi_align_munmap.constprop.0+0x684/0x870
[16386.256811]  __vm_munmap+0xe0/0x1f8
[16386.256821]  sys_munmap+0x54/0x6c
[16386.256830]  system_call_exception+0x1a0/0x4a0
[16386.256841]  system_call_vectored_common+0x15c/0x2ec

[16386.256868] The buggy address belongs to the object at c00000014a819670
                which belongs to the cache vm_area_struct of size 168
[16386.256887] The buggy address is located 0 bytes inside of
                freed 168-byte region [c00000014a819670, c00000014a819718)

[16386.256915] The buggy address belongs to the physical page:
[16386.256928] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14a81
[16386.256950] memcg:c0000000ba430001
[16386.256961] anon flags: 0x43ffff800000000(node=4|zone=0|lastcpupid=0x7ffff)
[16386.256975] page_type: 0xfdffffff(slab)
[16386.256990] raw: 043ffff800000000 c00000000501c080 0000000000000000 5deadbee00000001
[16386.257003] raw: 0000000000000000 00000000011a011a 00000001fdffffff c0000000ba430001
[16386.257018] page dumped because: kasan: bad access detected

This patch adds close() callback in vas_vm_ops vm_operations_struct
which will be executed during munmap() before freeing VMA. The VMA
address in the VAS window is set to NULL after holding the window
mmap_mutex.

Fixes: 37e6764 ("powerpc/pseries/vas: Add VAS migration handler")
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20241214051758.997759-1-haren@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 8fac326 ]

When I try to manually set bitrates:

iw wlan0 set bitrates legacy-2.4 1

I get sleeping from invalid context error, see below. Fix that by switching to
use recently introduced ieee80211_iterate_stations_mtx().

Do note that WCN6855 firmware is still crashing, I'm not sure if that firmware
even supports bitrate WMI commands and should we consider disabling
ath12k_mac_op_set_bitrate_mask() for WCN6855? But that's for another patch.

BUG: sleeping function called from invalid context at drivers/net/wireless/ath/ath12k/wmi.c:420
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 2236, name: iw
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
3 locks held by iw/2236:
 #0: ffffffffabc6f1d8 (cb_lock){++++}-{3:3}, at: genl_rcv+0x14/0x40
 #1: ffff888138410810 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: nl80211_pre_doit+0x54d/0x800 [cfg80211]
 #2: ffffffffab2cfaa0 (rcu_read_lock){....}-{1:2}, at: ieee80211_iterate_stations_atomic+0x2f/0x200 [mac80211]
CPU: 3 UID: 0 PID: 2236 Comm: iw Not tainted 6.11.0-rc7-wt-ath+ #1772
Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0067.2021.0528.1339 05/28/2021
Call Trace:
 <TASK>
 dump_stack_lvl+0xa4/0xe0
 dump_stack+0x10/0x20
 __might_resched+0x363/0x5a0
 ? __alloc_skb+0x165/0x340
 __might_sleep+0xad/0x160
 ath12k_wmi_cmd_send+0xb1/0x3d0 [ath12k]
 ? ath12k_wmi_init_wcn7850+0xa40/0xa40 [ath12k]
 ? __netdev_alloc_skb+0x45/0x7b0
 ? __asan_memset+0x39/0x40
 ? ath12k_wmi_alloc_skb+0xf0/0x150 [ath12k]
 ? reacquire_held_locks+0x4d0/0x4d0
 ath12k_wmi_set_peer_param+0x340/0x5b0 [ath12k]
 ath12k_mac_disable_peer_fixed_rate+0xa3/0x110 [ath12k]
 ? ath12k_mac_vdev_stop+0x4f0/0x4f0 [ath12k]
 ieee80211_iterate_stations_atomic+0xd4/0x200 [mac80211]
 ath12k_mac_op_set_bitrate_mask+0x5d2/0x1080 [ath12k]
 ? ath12k_mac_vif_chan+0x320/0x320 [ath12k]
 drv_set_bitrate_mask+0x267/0x470 [mac80211]
 ieee80211_set_bitrate_mask+0x4cc/0x8a0 [mac80211]
 ? __this_cpu_preempt_check+0x13/0x20
 nl80211_set_tx_bitrate_mask+0x2bc/0x530 [cfg80211]
 ? nl80211_parse_tx_bitrate_mask+0x2320/0x2320 [cfg80211]
 ? trace_contention_end+0xef/0x140
 ? rtnl_unlock+0x9/0x10
 ? nl80211_pre_doit+0x557/0x800 [cfg80211]
 genl_family_rcv_msg_doit+0x1f0/0x2e0
 ? genl_family_rcv_msg_attrs_parse.isra.0+0x250/0x250
 ? ns_capable+0x57/0xd0
 genl_family_rcv_msg+0x34c/0x600
 ? genl_family_rcv_msg_dumpit+0x310/0x310
 ? __lock_acquire+0xc62/0x1de0
 ? he_set_mcs_mask.isra.0+0x8d0/0x8d0 [cfg80211]
 ? nl80211_parse_tx_bitrate_mask+0x2320/0x2320 [cfg80211]
 ? cfg80211_external_auth_request+0x690/0x690 [cfg80211]
 genl_rcv_msg+0xa0/0x130
 netlink_rcv_skb+0x14c/0x400
 ? genl_family_rcv_msg+0x600/0x600
 ? netlink_ack+0xd70/0xd70
 ? rwsem_optimistic_spin+0x4f0/0x4f0
 ? genl_rcv+0x14/0x40
 ? down_read_killable+0x580/0x580
 ? netlink_deliver_tap+0x13e/0x350
 ? __this_cpu_preempt_check+0x13/0x20
 genl_rcv+0x23/0x40
 netlink_unicast+0x45e/0x790
 ? netlink_attachskb+0x7f0/0x7f0
 netlink_sendmsg+0x7eb/0xdb0
 ? netlink_unicast+0x790/0x790
 ? __this_cpu_preempt_check+0x13/0x20
 ? selinux_socket_sendmsg+0x31/0x40
 ? netlink_unicast+0x790/0x790
 __sock_sendmsg+0xc9/0x160
 ____sys_sendmsg+0x620/0x990
 ? kernel_sendmsg+0x30/0x30
 ? __copy_msghdr+0x410/0x410
 ? __kasan_check_read+0x11/0x20
 ? mark_lock+0xe6/0x1470
 ___sys_sendmsg+0xe9/0x170
 ? copy_msghdr_from_user+0x120/0x120
 ? __lock_acquire+0xc62/0x1de0
 ? do_fault_around+0x2c6/0x4e0
 ? do_user_addr_fault+0x8c1/0xde0
 ? reacquire_held_locks+0x220/0x4d0
 ? do_user_addr_fault+0x8c1/0xde0
 ? __kasan_check_read+0x11/0x20
 ? __fdget+0x4e/0x1d0
 ? sockfd_lookup_light+0x1a/0x170
 __sys_sendmsg+0xd2/0x180
 ? __sys_sendmsg_sock+0x20/0x20
 ? reacquire_held_locks+0x4d0/0x4d0
 ? debug_smp_processor_id+0x17/0x20
 __x64_sys_sendmsg+0x72/0xb0
 ? lockdep_hardirqs_on+0x7d/0x100
 x64_sys_call+0x894/0x9f0
 do_syscall_64+0x64/0x130
 entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x7f230fe04807
Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10
RSP: 002b:00007ffe996a7ea8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000556f9f9c3390 RCX: 00007f230fe04807
RDX: 0000000000000000 RSI: 00007ffe996a7ee0 RDI: 0000000000000003
RBP: 0000556f9f9c88c0 R08: 0000000000000002 R09: 0000000000000000
R10: 0000556f965ca190 R11: 0000000000000246 R12: 0000556f9f9c8780
R13: 00007ffe996a7ee0 R14: 0000556f9f9c87d0 R15: 0000556f9f9c88c0
 </TASK>

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241007165932.78081-2-kvalo@kernel.org
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 542ed81 ]

Access to genmask field in struct nft_set_ext results in unaligned
atomic read:

[   72.130109] Unable to handle kernel paging request at virtual address ffff0000c2bb708c
[   72.131036] Mem abort info:
[   72.131213]   ESR = 0x0000000096000021
[   72.131446]   EC = 0x25: DABT (current EL), IL = 32 bits
[   72.132209]   SET = 0, FnV = 0
[   72.133216]   EA = 0, S1PTW = 0
[   72.134080]   FSC = 0x21: alignment fault
[   72.135593] Data abort info:
[   72.137194]   ISV = 0, ISS = 0x00000021, ISS2 = 0x00000000
[   72.142351]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[   72.145989]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[   72.150115] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000237d27000
[   72.154893] [ffff0000c2bb708c] pgd=0000000000000000, p4d=180000023ffff403, pud=180000023f84b403, pmd=180000023f835403,
+pte=0068000102bb7707
[   72.163021] Internal error: Oops: 0000000096000021 [#1] SMP
[...]
[   72.170041] CPU: 7 UID: 0 PID: 54 Comm: kworker/7:0 Tainted: G            E      6.13.0-rc3+ #2
[   72.170509] Tainted: [E]=UNSIGNED_MODULE
[   72.170720] Hardware name: QEMU QEMU Virtual Machine, BIOS edk2-stable202302-for-qemu 03/01/2023
[   72.171192] Workqueue: events_power_efficient nft_rhash_gc [nf_tables]
[   72.171552] pstate: 21400005 (nzCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
[   72.171915] pc : nft_rhash_gc+0x200/0x2d8 [nf_tables]
[   72.172166] lr : nft_rhash_gc+0x128/0x2d8 [nf_tables]
[   72.172546] sp : ffff800081f2bce0
[   72.172724] x29: ffff800081f2bd40 x28: ffff0000c2bb708c x27: 0000000000000038
[   72.173078] x26: ffff0000c6780ef0 x25: ffff0000c643df00 x24: ffff0000c6778f78
[   72.173431] x23: 000000000000001a x22: ffff0000c4b1f000 x21: ffff0000c6780f78
[   72.173782] x20: ffff0000c2bb70dc x19: ffff0000c2bb7080 x18: 0000000000000000
[   72.174135] x17: ffff0000c0a4e1c0 x16: 0000000000003000 x15: 0000ac26d173b978
[   72.174485] x14: ffffffffffffffff x13: 0000000000000030 x12: ffff0000c6780ef0
[   72.174841] x11: 0000000000000000 x10: ffff800081f2bcf8 x9 : ffff0000c3000000
[   72.175193] x8 : 00000000000004be x7 : 0000000000000000 x6 : 0000000000000000
[   72.175544] x5 : 0000000000000040 x4 : ffff0000c3000010 x3 : 0000000000000000
[   72.175871] x2 : 0000000000003a98 x1 : ffff0000c2bb708c x0 : 0000000000000004
[   72.176207] Call trace:
[   72.176316]  nft_rhash_gc+0x200/0x2d8 [nf_tables] (P)
[   72.176653]  process_one_work+0x178/0x3d0
[   72.176831]  worker_thread+0x200/0x3f0
[   72.176995]  kthread+0xe8/0xf8
[   72.177130]  ret_from_fork+0x10/0x20
[   72.177289] Code: 54fff984 d503201f d2800080 91003261 (f820303f)
[   72.177557] ---[ end trace 0000000000000000 ]---

Align struct nft_set_ext to word size to address this and
documentation it.

pahole reports that this increases the size of elements for rhash and
pipapo in 8 bytes on x86_64.

Fixes: 7ffc748 ("netfilter: nft_set_hash: skip duplicated elements pending gc run")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
[ Upstream commit 4d94f05 ]

This reworks hci_cb_list to not use mutex hci_cb_list_lock to avoid bugs
like the bellow:

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:585
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5070, name: kworker/u9:2
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
4 locks held by kworker/u9:2/5070:
 #0: ffff888015be3948 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3229 [inline]
 #0: ffff888015be3948 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x1770 kernel/workqueue.c:3335
 #1: ffffc90003b6fd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3230 [inline]
 #1: ffffc90003b6fd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x1770 kernel/workqueue.c:3335
 #2: ffff8880665d0078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xcf/0xae0 net/bluetooth/hci_event.c:6914
 #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline]
 #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline]
 #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: hci_le_create_big_complete_evt+0xdb/0xae0 net/bluetooth/hci_event.c:6915
CPU: 0 PID: 5070 Comm: kworker/u9:2 Not tainted 6.8.0-syzkaller-08073-g480e035fc4c7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: hci0 hci_rx_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 __might_resched+0x5d4/0x780 kernel/sched/core.c:10187
 __mutex_lock_common kernel/locking/mutex.c:585 [inline]
 __mutex_lock+0xc1/0xd70 kernel/locking/mutex.c:752
 hci_connect_cfm include/net/bluetooth/hci_core.h:2004 [inline]
 hci_le_create_big_complete_evt+0x3d9/0xae0 net/bluetooth/hci_event.c:6939
 hci_event_func net/bluetooth/hci_event.c:7514 [inline]
 hci_event_packet+0xa53/0x1540 net/bluetooth/hci_event.c:7569
 hci_rx_work+0x3e8/0xca0 net/bluetooth/hci_core.c:4171
 process_one_work kernel/workqueue.c:3254 [inline]
 process_scheduled_works+0xa00/0x1770 kernel/workqueue.c:3335
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416
 kthread+0x2f0/0x390 kernel/kthread.c:388
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
 </TASK>

Reported-by: syzbot+2fb0835e0c9cefc34614@syzkaller.appspotmail.com
Tested-by: syzbot+2fb0835e0c9cefc34614@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2fb0835e0c9cefc34614
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tobetter pushed a commit that referenced this issue Jan 10, 2025
…le_direct_reclaim()

commit 6aaced5 upstream.

The task sometimes continues looping in throttle_direct_reclaim() because
allow_direct_reclaim(pgdat) keeps returning false.

 #0 [ffff80002cb6f8d0] __switch_to at ffff8000080095ac
 #1 [ffff80002cb6f900] __schedule at ffff800008abbd1c
 #2 [ffff80002cb6f990] schedule at ffff800008abc50c
 #3 [ffff80002cb6f9b0] throttle_direct_reclaim at ffff800008273550
 #4 [ffff80002cb6fa20] try_to_free_pages at ffff800008277b68
 #5 [ffff80002cb6fae0] __alloc_pages_nodemask at ffff8000082c4660
 #6 [ffff80002cb6fc50] alloc_pages_vma at ffff8000082e4a98
 #7 [ffff80002cb6fca0] do_anonymous_page at ffff80000829f5a8
 #8 [ffff80002cb6fce0] __handle_mm_fault at ffff8000082a5974
 #9 [ffff80002cb6fd90] handle_mm_fault at ffff8000082a5bd4

At this point, the pgdat contains the following two zones:

        NODE: 4  ZONE: 0  ADDR: ffff00817fffe540  NAME: "DMA32"
          SIZE: 20480  MIN/LOW/HIGH: 11/28/45
          VM_STAT:
                NR_FREE_PAGES: 359
        NR_ZONE_INACTIVE_ANON: 18813
          NR_ZONE_ACTIVE_ANON: 0
        NR_ZONE_INACTIVE_FILE: 50
          NR_ZONE_ACTIVE_FILE: 0
          NR_ZONE_UNEVICTABLE: 0
        NR_ZONE_WRITE_PENDING: 0
                     NR_MLOCK: 0
                    NR_BOUNCE: 0
                   NR_ZSPAGES: 0
            NR_FREE_CMA_PAGES: 0

        NODE: 4  ZONE: 1  ADDR: ffff00817fffec00  NAME: "Normal"
          SIZE: 8454144  PRESENT: 98304  MIN/LOW/HIGH: 68/166/264
          VM_STAT:
                NR_FREE_PAGES: 146
        NR_ZONE_INACTIVE_ANON: 94668
          NR_ZONE_ACTIVE_ANON: 3
        NR_ZONE_INACTIVE_FILE: 735
          NR_ZONE_ACTIVE_FILE: 78
          NR_ZONE_UNEVICTABLE: 0
        NR_ZONE_WRITE_PENDING: 0
                     NR_MLOCK: 0
                    NR_BOUNCE: 0
                   NR_ZSPAGES: 0
            NR_FREE_CMA_PAGES: 0

In allow_direct_reclaim(), while processing ZONE_DMA32, the sum of
inactive/active file-backed pages calculated in zone_reclaimable_pages()
based on the result of zone_page_state_snapshot() is zero.

Additionally, since this system lacks swap, the calculation of inactive/
active anonymous pages is skipped.

        crash> p nr_swap_pages
        nr_swap_pages = $1937 = {
          counter = 0
        }

As a result, ZONE_DMA32 is deemed unreclaimable and skipped, moving on to
the processing of the next zone, ZONE_NORMAL, despite ZONE_DMA32 having
free pages significantly exceeding the high watermark.

The problem is that the pgdat->kswapd_failures hasn't been incremented.

        crash> px ((struct pglist_data *) 0xffff00817fffe540)->kswapd_failures
        $1935 = 0x0

This is because the node deemed balanced.  The node balancing logic in
balance_pgdat() evaluates all zones collectively.  If one or more zones
(e.g., ZONE_DMA32) have enough free pages to meet their watermarks, the
entire node is deemed balanced.  This causes balance_pgdat() to exit early
before incrementing the kswapd_failures, as it considers the overall
memory state acceptable, even though some zones (like ZONE_NORMAL) remain
under significant pressure.


The patch ensures that zone_reclaimable_pages() includes free pages
(NR_FREE_PAGES) in its calculation when no other reclaimable pages are
available (e.g., file-backed or anonymous pages).  This change prevents
zones like ZONE_DMA32, which have sufficient free pages, from being
mistakenly deemed unreclaimable.  By doing so, the patch ensures proper
node balancing, avoids masking pressure on other zones like ZONE_NORMAL,
and prevents infinite loops in throttle_direct_reclaim() caused by
allow_direct_reclaim(pgdat) repeatedly returning false.


The kernel hangs due to a task stuck in throttle_direct_reclaim(), caused
by a node being incorrectly deemed balanced despite pressure in certain
zones, such as ZONE_NORMAL.  This issue arises from
zone_reclaimable_pages() returning 0 for zones without reclaimable file-
backed or anonymous pages, causing zones like ZONE_DMA32 with sufficient
free pages to be skipped.

The lack of swap or reclaimable pages results in ZONE_DMA32 being ignored
during reclaim, masking pressure in other zones.  Consequently,
pgdat->kswapd_failures remains 0 in balance_pgdat(), preventing fallback
mechanisms in allow_direct_reclaim() from being triggered, leading to an
infinite loop in throttle_direct_reclaim().

This patch modifies zone_reclaimable_pages() to account for free pages
(NR_FREE_PAGES) when no other reclaimable pages exist.  This ensures zones
with sufficient free pages are not skipped, enabling proper balancing and
reclaim behavior.

[akpm@linux-foundation.org: coding-style cleanups]
Link: https://lkml.kernel.org/r/20241130164346.436469-1-snishika@redhat.com
Link: https://lkml.kernel.org/r/20241130161236.433747-2-snishika@redhat.com
Fixes: 5a1c84b ("mm: remove reclaim and compaction retry approximations")
Signed-off-by: Seiji Nishikawa <snishika@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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