Page 1 of 2

drm_kms_helper: kernel panic

PostPosted: Sat Jul 12, 2014 8:55 am
by rainbow
After 3.14.4 (near 3.14.5-rc2 i think) I get the follwoing kernel panic.

Code: Select all
[   37.132894] ------------[ cut here ]------------
[   37.189279] kernel BUG at include/asm-generic/dma-mapping-common.h:20!
[   37.268559] invalid opcode: 0000 [#1] SMP
[   37.319061] CPU: 3 PID: 624 Comm: khubd Not tainted 3.15.5+ #1
[   37.390027] Hardware name: Gigabyte Technology Co., Ltd. AM1M-S2P/AM1M-S2P, BIOS F1 01/09/2014
[   37.494350] task: ffff880233da3660 ti: ffff880233da3c08 task.ti: ffff880233da3c08
[   37.585163] RIP: 0010:[<ffffffff89846fd7>]  [<ffffffff89846fd7>] ffffffff89846fd7
[   37.676185] RSP: 0000:ffffc900113c3830  EFLAGS: 00010246
[   37.741022] RAX: 0000000000000000 RBX: ffff8802324d3000 RCX: 0000000000000028
[   37.827681] RDX: 0000000000000041 RSI: 00000000991791a8 RDI: 00004100113c39e5
[   37.914442] RBP: ffff8800985f8000 R08: 0000000000000003 R09: 0000000000000000
[   38.001204] R10: ffffffff89849734 R11: ffffffff895e7ca0 R12: ffffc900113c39e5
[   38.087968] R13: ffffffff895e7ca0 R14: ffff880233cf1098 R15: 0000000000000002
[   38.174730] FS:  0000000000000000(0000) GS:ffff88023ed80000(0000) knlGS:0000000000000000
[   38.273025] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   38.343266] CR2: 0000040000000000 CR3: 0000000009c96000 CR4: 00000000000407f0
[   38.430130] Stack:
[   38.455693]  0000000000000003 00000000000009e5 ffff8802324d3000 ffff8800985f8000
[   38.546090]  ffffc900113c398c 0000000000000010 ffff8802324d9000 00000000000000c0
[   38.636489]  ffffffff89847416 00000000ffffffff ffffffff8a2aea10 0000000100150015
[   38.726888] Call Trace:
[   38.757654]  [<ffffffff89847416>] ? usb_hcd_submit_urb+0x146/0x900
[   38.833190]  [<ffffffff89132e6e>] ? vprintk_emit+0x17e/0x4e0
[   38.902493]  [<ffffffff8984a60e>] ? usb_start_wait_urb+0x5e/0xf0
[   38.975954]  [<ffffffff8984ab33>] ? usb_control_msg+0xd3/0x130
[   39.047341]  [<ffffffff899436bd>] ? technisat_usb2_identify_state+0x6d/0xc0
[   39.132231]  [<ffffffff89940514>] ? dvb_usb_device_init+0x134/0x600
[   39.208812]  [<ffffffff899437cb>] ? technisat_usb2_probe+0x2b/0xe0
[   39.284350]  [<ffffffff8984e169>] ? usb_probe_interface+0x1d9/0x2b0
[   39.360931]  [<ffffffff897adcb0>] ? driver_probe_device+0x280/0x280
[   39.437508]  [<ffffffff897adace>] ? driver_probe_device+0x9e/0x280
[   39.513049]  [<ffffffff897adcb0>] ? driver_probe_device+0x280/0x280
[   39.589628]  [<ffffffff897adcb0>] ? driver_probe_device+0x280/0x280
[   39.666207]  [<ffffffff897ac432>] ? bus_for_each_drv+0x62/0xa0
[   39.737592]  [<ffffffff897ad980>] ? device_attach+0xa0/0xc0
[   39.805859]  [<ffffffff897ac6e0>] ? bus_probe_device+0xa0/0xd0
[   39.877242]  [<ffffffff897aa1f6>] ? device_add+0x4e6/0x5f0
[   39.944364]  [<ffffffff8984ab43>] ? usb_control_msg+0xe3/0x130
[   40.015646]  [<ffffffff8984c915>] ? usb_set_configuration+0x505/0x800
[   40.094303]  [<ffffffff8984044b>] ? usb_device_is_owned+0x1b/0x50
[   40.168806]  [<ffffffff8985944e>] ? generic_probe+0x2e/0x90
[   40.236967]  [<ffffffff897adcb0>] ? driver_probe_device+0x280/0x280
[   40.313443]  [<ffffffff897adace>] ? driver_probe_device+0x9e/0x280
[   40.388878]  [<ffffffff897adcb0>] ? driver_probe_device+0x280/0x280
[   40.465355]  [<ffffffff897adcb0>] ? driver_probe_device+0x280/0x280
[   4.541830]  [<ffffffff897ac432>] ? bus_for_each_drv+0x62/0xa0
[   40.613110]  [<ffffffff897ad980>] ? device_attach+0xa0/0xc0
[   40.681273]  [<ffffffff897ac6e0>] ? bus_probe_device+0xa0/0xd0
[   40.752552]  [<ffffffff87aa1f6>] ? device_add+0x4e6/0x5f0
[   40.819676]  [<ffffffff89842458>] ? usb_new_device+0x358/0x610
[   40.890851]  [<ffffffff89844f18>] ? hub_thread+0xdb8/0x1390
[   40.958913]  [<ffffffff8912a0b3>] ? __wake_up_common+0x63/0xa0
[   41.030086]  [<ffffffff8912a0f0>] ? __wake_up_common+0xa0/0xa0
[   41.101263]  [<ffffffff89844160>] ? usb_reset_device+0x1b0/0x1b0
[   41.174413]  [<ffffffff8910d788>] ? kthread+0xc8/0xe0
[   41.236133]  [<ffffffff8910d6c0>] ? insert_kthread_work+0x60/0x60
[   41.310323]  [<ffffffff89c7d4f4>] ? ret_from_fork+0x74/0xa0
[   41.378277]  [<ffffffff8910d6c0>] ? insert_kthread_work+0x60/0x60
[   41.452465] Code: ff ff 48 8b 05 ab cb 9c 00 e9 f3 fb ff ff be c3 05 00 00 48 c7 c7 07 be 05 8a e8 95 49 8a ff b8 ea ff ff ff e9 b5 fc ff ff 0f 0b <0f> 0b 0f 1f 80 00 00 00 00 48 83 ec 18 48 89 6c 24 08 48 89 1c
[   41.687501] RIP  [<ffffffff89846fd7>] ffffffff89846fd7
[   41.750365]  RSP <ffffc900113c3830>
[   41.793414] ---[ end trace 2fadaa17cae18550 ]---
[   41.850024] Kernel panic - not syncing: grsec: halting the system due to suspicious kernel crash caused by root
[   41.972127] Kernel Offset: 0x8000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[   42.101466] drm_kms_helper: panic occurred, switching back to text console
[   42.185196] ---[ end Kernel panic - not syncing: grsec: halting the system due to suspicious kernel crash caused by root


I already tried the last patch (testing and stable) and the same error appear.
Without grsecurity the system works flawless.
The config can be found here http://www.pastebay.net/1464629.

thanks

Re: drm_kms_helper: kernel panic

PostPosted: Sat Jul 12, 2014 11:52 am
by PaX Team
can you enable frame pointers and post a new kernel log please?

Re: drm_kms_helper: kernel panic

PostPosted: Sun Jul 13, 2014 4:29 am
by rainbow
Thank you for the fast answer.
I found that the problem appears only when I attach a usb device, either on ehci or on xhci port.
In the UEFI I enable xhci hand-off otherwise the kernel freeze during the loading of the xhci driver (without any oops).

This is the new oops with your suggestion:
Code: Select all
[   32.957305] ------------[ cut here ]------------
[   33.014211] kernel BUG at include/asm-generic/dma-mapping-common.h:20!
[   33.094013] invalid opcode: 0000 [#1] SMP
[   33.144930] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 3.14.12+ #1
[   33.154007] atkbd serio0: Failed to enable keyboard on isa0060/serio0
[   33.154185] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[   33.403030] Hardware name: Gigabyte Technology Co., Ltd. AM1M-S2P/AM1M-S2P, BIOS F2 06/19/2014
[   33.507771] task: ffff8802342d0000 ti: ffff8802342d0880 task.ti: fff8802342d0880
[   33.599103] RIP: 0010:[<ffffffffa5848c66>]  [<ffffffffa5848c66>] ffffffffa5848c66
[   33.690644] RSP: 0000:ffffc90000023a48  EFLAGS: 00010246
[   33.756003] RAX: 0000000000000000 RBX: ffff88023254bf00 RCX: 0000000000000028
[   33.843179] RDX: 0000000000000041 RSI: 0000000233215500 RDI: 0000410000023c7d
[   33.930357] RBP: ffffc90000023a88 R08: 0000000000000003 R09: 0000000000000000
[   34.017432] R10: 0000000000000001 R11: 0000000000aaaaaa R12: ffffc90000023c7d
[   34.104506] R13: ffff880233cf6098 R14: 0000000000000002 R15: ffff88023327e400
[   34.191578] FS:  0000000000000000(0000) GS:ffff88023ed00000(0000) knlGS:0000000000000000
[   34.290187] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   34.360739] CR2: 0000000000000000 CR3: 0000000025c89000 CR4: 00000000000407f0
[   34.447916] Stack:
[   34.473789]  0000000000000c7d ffffffffa55ee2c0 0000000000000003 ffff88023254bf00
[   34.564395]  ffff88023327e400 0000000000000010 0000000000000010 0000000000000000
[   34.655105]  ffffc90000023b48 ffffffffa584902e ffffffffa55cfb77 ffffc90000023ab0
[   34.745817] Call Trace:
[   34.776892]  [<ffffffffa55ee2c0>] ? swiotlb_free_coherent+0xa0/0xa0
[   34.853781]  [<ffffffffa584902e>] usb_hcd_submit_urb+0x10e/0x970
[   34.927450]  [<ffffffffa55cfb77>] ? __delay+0x17/0x20
[   34.989791]  [<ffffffffa55cfbb5>] ? __const_udelay+0x35/0x40
[   35.059411]  [<ffffffffa5682f68>] ? wait_for_xmitr+0x48/0xc0
[   35.129028]  [<ffffffffa5c7288b>] ? retint_restore_args+0x6/0x10
[   35.202801]  [<ffffffffa584b8ec>] usb_submit_urb+0x30c/0x580
[   35.272315]  [<ffffffffa5133720>] ? vprintk_emit+0x170/0x480
[   35.341827]  [<ffffffffa584c275>] usb_start_wait_urb+0x65/0x100
[   35.414459]  [<ffffffffa54b2e9>] ? usb_init_urb+0x19/0x40
[   35.481895]  [<ffffffffa584c7ad>] usb_control_msg+0xcd/0x120
[   35.551409]  [<ffffffffa59384c2>] technisat_usb2_identify_state+0x72/0xc0
[   35.634430]  [<ffffffffa524c940>] ? kernfs_addrm_finish+0x20/0xe0
[   35.709138]  [<ffffffffa59352c0>] dvb_usb_device_init+0x130/0x610
[   35.783848]  [<ffffffffa59385cd>] technisat_usb2_probe+0x2d/0xe0
[   35.857414]  [<ffffffffa584fda0>] usb_probe_interface+0x1c0/0x2a0
[   35.932020]  [<ffffffffa57b499f>] driver_probe_device+0x9f/0x280
[   36.005585]  [<ffffffffa57b4be0>] ? __device_attach+0x60/0x60
[   36.076034]  [<ffffffffa57b4c83>] __driver_attach+0xa3/0xb0
[   36.144402]  [<ffffffffa57b4be0>] ? __device_attach+0x60/0x60
[   36.214853]  [<ffffffffa57b2d63>] bus_for_each_dev+0x73/0xc0
[   36.284263]  [<ffffffffa57b4869>] driver_attach+0x19/0x30
[   36.350451]  [<ffffffffa57b3858>] bus_add_driver+0x178/0x220
[   36.419755]  [<ffffffffa57b528b>] driver_register+0x5b/0xe0
[   36.488024]  [<ffffffffa584f929>] usb_register_driver+0x89/0x160
[   36.561485]  [<ffffffffa646a306>] ? a800_driver_init+0x3c/0x3c
[   36.632870]  [<ffffffffa646a33a>] technisat_usb2_driver_init+0x34/0x3c
[   36.712566]  [<ffffffffa64118b1>] do_one_initcall+0xa9/0x198
[   36.781871]  [<ffffffffa6411b86>] kernel_init_freeable+0x1e6/0x2e1
[   36.857410]  [<ffffffffa6410d3c>] ? do_early_param+0x143/0x143
[   36.928795]  [<ffffffffa5c56210>] ? rest_init+0x80/0x80
[   36.992801]  [<ffffffffa5c56219>] kernel_init+0x9/0xf0
[   37.055768]  [<ffffffffa5c73134>] ret_from_fork+0x74/0xa0
[   37.121854]  [<ffffffffa5c56210>] ? rest_init+0x80/0x80
[   37.185752] Code: ff ff 48 8b 05 d4 74 9c 00 e9 01 fc ff ff be c3 05 00 00 48 c7 c7 29 7d 04 a6 e8 06 31 8a ff b8 ea ff ff ff e9 c6 fc ff ff 0f 0b <0f> 0b 0f 1f 84 00 00 00 00 00 55 48 89 e5 48 83 ec 18 4c 89 65
[   37.421101] RIP  [<ffffffffa5848c66>] ffffffffa5848c66
[   37.484174]  RSP <ffffc90000023a48>
[   37.527413] atkbd serio0: Spurious ACK on isa0060/serio0. Some program might be trying to access hardware directly.
[   37.653883] ---[ end trace 7a4c03b2501be6ee ]---
[   37.710700] Kernel panic - not syncing: grsec: halting the system due to suspicious kernel crash caused by root
[   37.833013] Kernel Offset: 0x24000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[   37.963704] drm_kms_helper: panic occurred, switching back to text console
[   38.047746] ------------[ cut here ]------------
[   38.104605] WARNING: CPU: 2 PID: 1 at arch/x86/kernel/smp.c:124 native_smp_send_reschedule+0x68/0x70()
[   38.217653] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G      D      3.14.12+ #1
[   38.303684] Hardware name: Gigabyte Technology Co., Ltd. AM1M-S2P/AM1M-S2P, BIOS F2 06/19/2014
[   38.408422]  0000000000000009 ffff88023ed03dd0 ffffffffa5c602f2 0000000000000000
[   38.499030]  ffff88023ed03e08 ffffffffa50ebc5d 0000000000000000 ffff88023ec0e840
[   38.589637]  0000000000000002 ffff8802342d0000 7fffffffffffffff ffff88023ed03e18
[   38.680243] Call Trace:
[   38.711206]  <IRQ>  [<ffffffffa5c602f2>] dump_stack+0x45/0x5c
[   38.781868]  [<ffffffffa50ebc5d>] warn_slowpath_common+0x7d/0xb0
[   38.855538]  [<ffffffffa50ebd75>] warn_slowpath_null+0x15/0x20
[   38.927128]  [<ffffffffa506ab48>] native_smp_send_reschedule+0x68/0x70
[   39.007032]  [<ffffffffa5125f9c>] trigger_load_balance+0x15c/0x1f0
[   39.082780]  [<ffffffffa5119012>] scheduler_tick+0xb2/0x100
[   39.151255]  [<ffffffffa50f8ae6>] update_process_times+0x66/0x90
[   39.224926]  [<ffffffffa51484e0>] tick_sched_handle.isra.17+0x30/0x40
[   39.303790]  [<ffffffffa5148534>] tick_sched_timer+0x44/0x70
[   39.373304]  [<ffffffffa5110ecb>] __run_hrtimer.isra.32+0x5b/0x110
[   39.449051]  [<ffffffffa5111805>] hrtimer_interrupt+0xe5/0x220
[   39.520643]  [<ffffffffa506d04f>] local_apic_timer_interrupt+0x3f/0x70
[   39.600548]  [<ffffffffa506d777>] smp_apic_timer_interrupt+0x47/0x70
[   39.678374]  [<ffffffffa5c73e63>] apic_timer_interrupt+0x83/0x90
[   39.752042]  <EOI>  [<ffffffffa512f56c>] ? up+0x2c/0x50
[   39.816466]  [<ffffffffa5c5a0e5>] ? panic+0x19b/0x1e4
[   39.878706]  [<ffffffffa5c5a044>] ? panic+0xfa/0x1e4
[   39.939909]  [<ffffffffa55b3673>] gr_handle_kernel_exploit+0x143/0x150
[   40.019812]  [<ffffffffa5043925>] oops_end+0x65/0xa0
[   40.081012]  [<ffffffffa5043aa3>] die+0x53/0x90
[   40.137018]  [<ffffffffa503ffe1>] do_trap+0x91/0x190
[   40.198220]  [<ffffffffa5040320>] do_invalid_op+0x90/0xb0
[   40.264615]  [<ffffffffa5848c66>] ? usb_hcd_map_urb_for_dma+0x596/0x5a0
[   40.345560]  [<ffffffffa5624032>] ? soft_cursor+0x1a2/0x250
[   40.414033]  [<ffffffffa5c743f8>] invalid_op+0x18/0x20
[   40.477313]  [<ffffffffa5848c66>] ? usb_hcd_map_urb_for_dma+0x596/0x5a0
[   40.558254]  [<ffffffffa5848866>] ? usb_hcd_map_urb_for_dma+0x196/0x5a0
[   40.639199]  [<ffffffffa55ee2c0>] ? swiotlb_free_coherent+0xa0/0xa0
[   40.715985]  [<ffffffffa584902e>] usb_hcd_submit_urb+0x10e/0x970
[   40.789655]  [<ffffffffa55cfb77>] ? __delay+0x17/0x20
[   40.851894]  [<ffffffffa55cfbb5>] ? __const_udelay+0x35/0x40
[   40.921410]  [<ffffffffa5682f68>] ? wait_for_xmitr+0x48/0xc0
[   40.990819]  [<ffffffffa5c7288b>] ? retint_restore_args+0x6/0x10
[   41.064385]  [<ffffffffa584b8ec>] usb_submit_urb+0x30c/0x580
[   41.133793]  [<ffffffffa5133720>] ? vprintk_emit+0x170/0x480
[   41.203204]  [<ffffffffa584c275>] usb_start_wait_urb+0x65/0x100
[   41.275627]  [<ffffffffa584b2e9>] ? usb_init_urb+0x19/0x40
[   41.342855]  [<ffffffffa584c7ad>] usb_control_msg+0xcd/0x120
[   41.412056]  [<ffffffffa59384c2>] technisat_usb2_identify_state+0x72/0xc0
[   41.494767]  [<ffffffffa524c940>] ? kernfs_addrm_finish+0x20/0xe0
[   41.569163]  [<ffffffffa59352c0>] dvb_usb_device_init+0x130/0x610
[   41.643560]  [<ffffffffa59385cd>] technisat_usb2_probe+0x2d/0xe0
[   41.716816]  [<ffffffffa584fda0>] usb_probe_interface+0x1c0/0x2a0
[   41.791107]  [<ffffffffa57b499f>] driver_probe_device+0x9f/0x280
[   41.864362]  [<ffffffffa57b4be0>] ? __device_attach+0x60/0x60
[   41.934499]  [<ffffffffa57b4c83>] __driver_attach+0xa3/0xb0
[   42.002453]  [<ffffffffa57b4be0>] ? __device_attach+0x60/0x60
[   42.072488]  [<ffffffffa57b2d63>] bus_for_each_dev+0x73/0xc0
[   42.141482]  [<ffffffffa57b4869>] driver_attach+0x19/0x30
[   42.207359]  [<ffffffffa57b3858>] bus_add_driver+0x178/0x220
[   42.276353]  [<ffffffffa57b528b>] driver_register+0x5b/0xe0
[   42.344308]  [<ffffffffa584f929>] usb_register_driver+0x89/0x160
[   42.417458]  [<ffffffffa646a306>] ? a800_driver_init+0x3c/0x3c
[   42.488530]  [<ffffffffa646a33a>] technisat_usb2_driver_init+0x34/0x3c
[   42.567915]  [<ffffffffa64118b1>] do_one_initcall+0xa9/0x198
[   42.636909]  [<ffffffffa6411b86>] kernel_init_freeable+0x1e6/0x2e1
[   42.712136]  [<ffffffffa6410d3c>] ? do_early_param+0x143/0x143
[   42.783208]  [<ffffffffa5c56210>] ? rest_init+0x80/0x80
[   42.847007]  [<ffffffffa5c56219>] kernel_init+0x9/0xf0
[   42.909768]  [<ffffffffa5c73134>] ret_from_fork+0x74/0xa0
[   42.975644]  [<ffffffffa5c56210>] ? rest_init+0x80/0x80
[   43.039442] ---[ end trace 7a4c03b2501be6ef ]---

Re: drm_kms_helper: kernel panic

PostPosted: Sun Jul 13, 2014 6:18 am
by PaX Team
thanks, the problem is in drivers/media/usb/dvb-usb/technisat-usb2.c:technisat_usb2_identify_state() where usb_control_msg is called on a local variable (stack based buffer) which the USB stack will apparently initiate DMA to and which is against kernel policy (see Documentation/DMA-API-HOWTO.txt). in any case, the next grsec will fix it and if you feel like patching the code yourself, the version[3] array has to be kmalloc'd (and kfree'd). note that the same issue is present in technisat_usb2_set_led (the led[8] array), technisat_usb2_set_led_timer (the variable 'b') and technisat_usb2_get_ir (buf[62]) as well so they'll need the same fix. i guesss we may also end up writing a plugin to find these easier-to-detect instances.

Re: drm_kms_helper: kernel panic

PostPosted: Sun Jul 13, 2014 12:15 pm
by spender
Hi,

This should be fixed in the latest patches. Let me know if you still have problems.

Thanks,
-Brad

Re: drm_kms_helper: kernel panic

PostPosted: Mon Jul 14, 2014 8:52 am
by rainbow
thank you so much for the great work but unfortunately the kernel still hangs.
Now the oops is

Code: Select all
[   33.526712] ------------[ cut here ]------------
[   33.583522] kernel BUG at include/asm-generic/dma-mapping-common.h:20!
[   33.663219] invalid opcode: 0000 [#1] SMP
[   33.714134] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 3.14.12+ #2
[   33.788632] Hardware name: Gigabyte Technology Co., Ltd. AM1M-S2P/AM1M-S2P, BIOS F2 06/19/2014
[   33.893270] task: ffff8802342d0000 ti: ffff8802342d04e8 task.ti: ffff8802342d04e8
[   33.984498] RIP: 0010:[<ffffffff83842736>]  [<ffffffff83842736>] ffffffff83842736
[   34.075831] RSP: 0000:ffffc900000238c8  EFLAGS: 00010246
[   34.141086] RAX: 0000000000000000 RBX: ffff880233253780 RCX: 0000000000000028
[   34.228159] RDX: 0000000000000041 RSI: ffff880233253780 RDI: 0000410000023a60
[   34.315233] RBP: ffffc90000023908 R08: 0000000000000003 R09: 00000000000003e8
[   34.402306] R10: ffffc90000023b8f R11: 0000000000aaaaaa R12: ffffc90000023a60
[   34.489381] R13: ffff88023343e098 R14: 0000000000000001 R15: ffff880097f43800
[   34.576454] FS:  0000000000000000(0000) GS:ffff88023ed80000(0000) knlGS:0000000000000000
[   34.674957] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   34.745405] CR2: ffffc900000ec000 CR3: 0000000003c87000 CR4: 00000000000407f0
[   34.832480] Stack:
[   34.858248]  0000000000000a60 ffffffff835e8610 0000000000000003 ffff880233253780
[   34.948854]  ffff88023362f800 ffff880097f43800 0000000000000010 0000000000000002
[   35.039461]  ffffc90000023940 ffffffff83843206 ffff880233253780 ffff88023362f800
[   35.130069] Call Trace:
[   35.161042]  [<ffffffff835e8610>] ? swiotlb_free_coherent+0xa0/0xa0
[   35.237824]  [<ffffffff83843206>] usb_hcd_submit_urb+0xe6/0x290
[   35.310455]  [<ffffffff8384540c>] usb_submit_urb+0x30c/0x580
[   35.379967]  [<ffffffff83845d95>] usb_start_wait_urb+0x65/0x100
[   35.452599]  [<ffffffff831b0000>] ? hugetlb_fault+0x610/0x830
[   35.523151]  [<ffffffff838465e5>] usb_bulk_msg+0xc5/0x180
[   35.589547]  [<ffffffff8392f68d>] technisat_usb2_i2c_access+0xad/0x1f0
[   35.669450]  [<ffffffff8392f89a>] technisat_usb2_i2c_xfer+0xca/0x110
[   35.747174]  [<ffffffff838a0802>] __i2c_transfer+0x72/0x90
[   35.814505]  [<ffffffff838a0881>] i2c_transfer+0x61/0x90
[   35.879758]  [<ffffffff8392ff1a>] technisat_usb2_read_mac_address+0x9a/0x100
[   35.965792]  [<ffffffff83918399>] ? dvb_register_adapter+0x169/0x190
[   36.043515]  [<ffffffff8392d5fa>] dvb_usb_adapter_dvb_init+0x8a/0x220
[   36.122277]  [<ffffffff8392c704>] dvb_usb_adapter_init+0x1c4/0x2c0
[   36.197921]  [<ffffffff8392c8f2>] dvb_usb_init+0x92/0x100
[   36.264212]  [<ffffffff8392cb30>] dvb_usb_device_init+0x1d0/0x2b0
[   36.338817]  [<ffffffff8392fa9d>] technisat_usb2_probe+0x2d/0xe0
[   36.412383]  [<ffffffff838498c0>] usb_probe_interface+0x1c0/0x2a0
[   36.486991]  [<ffffffff837af75f>] driver_probe_device+0x9f/0x280
[   36.560554]  [<ffffffff837af9a0>] ? __device_attach+0x60/0x60
[   36.630900]  [<ffffffff837afa43>] __driver_attach+0xa3/0xb0
[   36.699165]  [<ffffffff837af9a0>] ? __device_attach+0x60/0x60
[   36.769511]  [<ffffffff837adb63>] bus_for_each_dev+0x73/0xc0
[   36.838817]  [<ffffffff837af629>] driver_attach+0x19/0x30
[   36.905004]  [<ffffffff837ae620>] bus_add_driver+0x170/0x220
[   36.974311]  [<ffffffff837b004b>] driver_register+0x5b/0xe0
[   37.042578]  [<ffffffff83849449>] usb_register_driver+0x89/0x160
[   37.115936]  [<ffffffff844690df>] ? a800_driver_init+0x3c/0x3c
[   37.187216]  [<ffffffff84469113>] technisat_usb2_driver_init+0x34/0x3c
[   37.266810]  [<ffffffff844118b1>] do_one_initcall+0xa9/0x198
[   37.336010]  [<ffffffff84411b86>] kernel_init_freeable+0x1e6/0x2e1
[   37.411446]  [<ffffffff84410d3c>] ? do_early_param+0x143/0x143
[   37.482726]  [<ffffffff83c4dbe0>] ? rest_init+0x80/0x80
[   37.546629]  [<ffffffff83c4dbe9>] kernel_init+0x9/0xf0
[   37.609492]  [<ffffffff83c6f0b4>] ret_from_fork+0x74/0xa0
[   37.675474]  [<ffffffff83c4dbe0>] ? rest_init+0x80/0x80
[   37.739373] Code: ff ff 48 8b 05 04 da 9c 00 e9 01 fc ff ff be c3 05 00 00 48 c7 c7 09 5e 04 84 e8 96 96 8a ff b8 ea ff ff ff e9 c6 fc ff ff 0f 0b <0f> 0b 0f 1f 84 00 00 00 00 00 55 48 89 e5 48 83 ec 18 4c 89 65
[   37.974617] RIP  [<ffffffff83842736>] ffffffff83842736
[   38.037689]  RSP <ffffc900000238c8>
[   38.080959] ---[ end trace 37ab73ce2a79d09c ]---
[   38.137660] Kernel panic - not syncing: grsec: halting the system due to suspicious kernel crash caused by root
[   38.259867] Kernel Offset: 0x2000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[   38.389414] drm_kms_helper: panic occurred, switching back to text console
[   38.473251] ------------[ cut here ]------------
[   38.530003] WARNING: CPU: 3 PID: 1 at arch/x86/kernel/smp.c:124 native_smp_send_reschedule+0x68/0x70()
[   38.642946] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G      D      3.14.12+ #2
[   38.728877] Hardware name: Gigabyte Technology Co., Ltd. AM1M-S2P/AM1M-S2P, BIOS F2 06/19/2014
[   38.833511]  0000000000000009 ffff88023ed83dd0 ffffffff83c59769 0000000000000000
[   38.924012]  ffff88023ed83e08 ffffffff830ebcbd 0000000000000000 ffff88023ec0e880
[   39.014515]  0000000000000003 ffff8802342d0000 7fffffffffffffff ffff88023ed83e18
[   39.105018] Call Trace:
[   39.135880]  <IRQ>  [<ffffffff83c59769>] dump_stack+0x45/0x5c
[   39.206436]  [<ffffffff830ebcbd>] warn_slowpath_common+0x7d/0xb0
[   39.280001]  [<ffffffff830ebdd5>] warn_slowpath_null+0x15/0x20
[   39.351489]  [<ffffffff8306ac68>] native_smp_send_reschedule+0x68/0x70
[   39.431288]  [<ffffffff8312607c>] trigger_load_balance+0x15c/0x1f0
[   39.506933]  [<ffffffff831192f2>] scheduler_tick+0xb2/0x100
[   39.575305]  [<ffffffff830f8af6>] update_process_times+0x66/0x90
[   39.648870]  [<ffffffff83148250>] tick_sched_handle.isra.17+0x30/0x40
[   39.727629]  [<ffffffff831482a4>] tick_sched_timer+0x44/0x70
[   39.797040]  [<ffffffff83110ddb>] __run_hrtimer.isra.32+0x5b/0x110
[   39.872683]  [<ffffffff83111715>] hrtimer_interrupt+0xe5/0x220
[   39.944173]  [<ffffffff8306d11f>] local_apic_timer_interrupt+0x3f/0x70
[   40.023971]  [<ffffffff8306d847>] smp_apic_timer_interrupt+0x47/0x70
[   40.101694]  [<ffffffff83c6fde3>] apic_timer_interrupt+0x83/0x90
[   40.175258]  <EOI>  [<ffffffff8312f68c>] ? up+0x2c/0x50
[   40.239578]  [<ffffffff83c51dd1>] ? panic+0x19b/0x1e4
[   40.301716]  [<ffffffff83c51d30>] ? panic+0xfa/0x1e4
[   40.362812]  [<ffffffff835ad906>] gr_handle_kernel_exploit+0x146/0x150
[   40.442611]  [<ffffffff83043895>] oops_end+0x65/0xa0
[   40.503709]  [<ffffffff83043a13>] die+0x53/0x90
[   40.559611]  [<ffffffff8303ff41>] do_trap+0x91/0x190
[   40.620708]  [<ffffffff83040280>] do_invalid_op+0x90/0xb0
[   40.687001]  [<ffffffff83842736>] ? usb_hcd_map_urb_for_dma+0x596/0x5a0
[   40.767839]  [<ffffffff83c70378>] invalid_op+0x18/0x20
[   40.831015]  [<ffffffff83842736>] ? usb_hcd_map_urb_for_dma+0x596/0x5a0
[   40.911854]  [<ffffffff83842336>] ? usb_hcd_map_urb_for_dma+0x196/0x5a0
[   40.992694]  [<ffffffff835e8610>] ? swiotlb_free_coherent+0xa0/0xa0
[   41.069377]  [<ffffffff83843206>] usb_hcd_submit_urb+0xe6/0x290
[   41.141903]  [<ffffffff8384540c>] usb_submit_urb+0x30c/0x580
[   41.211313]  [<ffffffff83845d95>] usb_start_wait_urb+0x65/0x100
[   41.283840]  [<ffffffff831b0000>] ? hugetlb_fault+0x610/0x830
[   41.354289]  [<ffffffff838465e5>] usb_bulk_msg+0xc5/0x180
[   41.420582]  [<ffffffff8392f68d>] technisat_usb2_i2c_access+0xad/0x1f0
[   41.500278]  [<ffffffff8392f89a>] technisat_usb2_i2c_xfer+0xca/0x110
[   41.577896]  [<ffffffff838a0802>] __i2c_transfer+0x72/0x90
[   41.645125]  [<ffffffff838a0881>] i2c_transfer+0x61/0x90
[   41.710272]  [<ffffffff8392ff1a>] technisat_usb2_read_mac_address+0x9a/0x100
[   41.796204]  [<ffffffff83918399>] ? dvb_register_adapter+0x169/0x190
[   41.873720]  [<ffffffff8392d5fa>] dvb_usb_adapter_dvb_init+0x8a/0x220
[   41.952272]  [<ffffffff8392c704>] dvb_usb_adapter_init+0x1c4/0x2c0
[   42.027709]  [<ffffffff8392c8f2>] dvb_usb_init+0x92/0x100
[   42.093689]  [<ffffffff8392cb30>] dvb_usb_device_init+0x1d0/0x2b0
[   42.167982]  [<ffffffff8392fa9d>] technisat_usb2_probe+0x2d/0xe0
[   42.241237]  [<ffffffff838498c0>] usb_probe_interface+0x1c0/0x2a0
[   42.315531]  [<ffffffff837af75f>] driver_probe_device+0x9f/0x280
[   42.388679]  [<ffffffff837af9a0>] ? __device_attach+0x60/0x60
[   42.458712]  [<ffffffff837afa43>] __driver_attach+0xa3/0xb0
[   42.526668]  [<ffffffff837af9a0>] ? __device_attach+0x60/0x60
[   42.596701]  [<ffffffff837adb63>] bus_for_each_dev+0x73/0xc0
[   42.665695]  [<ffffffff837af629>] driver_attach+0x19/0x30
[   42.731571]  [<ffffffff837ae620>] bus_add_driver+0x170/0x220
[   42.800567]  [<ffffffff837b004b>] driver_register+0x5b/0xe0
[   42.868522]  [<ffffffff83849449>] usb_register_driver+0x89/0x160
[   42.941671]  [<ffffffff844690df>] ? a800_driver_init+0x3c/0x3c
[   43.012744]  [<ffffffff84469113>] technisat_usb2_driver_init+0x34/0x3c
[   43.092129]  [<ffffffff844118b1>] do_one_initcall+0xa9/0x198
[   43.161124]  [<ffffffff84411b86>] kernel_init_freeable+0x1e6/0x2e1
[   43.236352]  [<ffffffff84410d3c>] ? do_early_param+0x143/0x143
[   43.307423]  [<ffffffff83c4dbe0>] ? rest_init+0x80/0x80
[   43.371221]  [<ffffffff83c4dbe9>] kernel_init+0x9/0xf0
[   43.433981]  [<ffffffff83c6f0b4>] ret_from_fork+0x74/0xa0
[   43.499858]  [<ffffffff83c4dbe0>] ? rest_init+0x80/0x80
[   43.563551] ---[ end trace 37ab73ce2a79d09d ]---

with the same configuration and with kernel 3.14.12 and grsecurity-3.0-3.14.12-201407132026.patch
Without the Technisat attached the server works great.

thanks

Re: drm_kms_helper: kernel panic

PostPosted: Mon Jul 14, 2014 10:53 pm
by spender
Hi,

That should be fixed in the patch I just uploaded. Let me know if any new problems crop up.

Thanks,
-Brad

Re: drm_kms_helper: kernel panic

PostPosted: Tue Jul 15, 2014 3:35 am
by rainbow
Unfortunately, no way.
This time I inserted the usb device at the end of boot and I have received the following oops:

Code: Select all
[   90.157521] ------------[ cut here ]------------
[   90.212874] kernel BUG at include/asm-generic/dma-mapping-common.h:20!
[   90.291115] invalid opcode: 0000 [#1] SMP
[   90.340373] CPU: 3 PID: 620 Comm: khubd Not tainted 3.14.12+ #1
[   90.411232] Hardware name: Gigabyte Technology Co., Ltd. AM1M-S2P/AM1M-S2P, BIOS F2 06/19/2014
[   90.514414] task: ffff880234383e90 ti: ffff880234384238 task.ti: ffff880234384238
[   90.604081] RIP: 0010:[<ffffffffaf831897>]  [<ffffffffaf831897>] ffffffffaf831897
[   90.693857] RSP: 0000:ffffc900113a36d0  EFLAGS: 00010246
[   90.757448] RAX: 0000000000000000 RBX: ffff88022d744900 RCX: 0000000000000028
[   90.842962] RDX: 0000000000000041 RSI: 0000000099c80800 RDI: 00004100113a388f
[   90.928479] RBP: ffff8802325e0000 R08: 0000000000000001 R09: 0000000000000020
[   91.013994] R10: 0000000000000000 R11: ffffffffaf5df770 R12: ffffc900113a388f
[   91.099509] R13: ffffffffaf5df770 R14: ffff8802335f2098 R15: 0000000000000001
[   91.185025] FS:  000002d64e9fa740(0000) GS:ffff88023ed80000(0000) knlGS:0000000000000000
[   91.281970] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   91.350754] CR2: 000002d64e890000 CR3: 000000002fc69000 CR4: 00000000000407f0
[   91.436268] Stack:
[   91.460375]  0000000000000001 000000000000088f ffff88022d744900 ffff8802325e0000
[   91.549632]  ffffc900113a382c 0000000000000010 ffff880093498800 0000000000000040
[   91.638888]  ffffffffaf831cd6 0000000200000002 71c1bf748617b255 ffffffffaff6ddc2
[   91.728144] Call Trace:
[   91.757462]  [<ffffffffaf831cd6>] ? usb_hcd_submit_urb+0x146/0x900
[   91.831540]  [<ffffffffaf5bfd8d>] ? vsnprintf+0x21d/0x690
[   91.896168]  [<ffffffffaf834dfe>] ? usb_start_wait_urb+0x5e/0xf0
[   91.968070]  [<ffffffffaf835333>] ? usb_control_msg+0xd3/0x130
[   92.037896]  [<ffffffffaf12e8c4>] ? print_prefix+0x84/0x150
[   92.104606]  [<ffffffffaf91c294>] ? usb_cypress_writemem+0x34/0x40
[   92.178585]  [<ffffffffaf91c401>] ? usb_cypress_load_firmware+0x61/0x160
[   92.258905]  [<ffffffffaf12bffd>] ? up+0xd/0x40
[   92.313143]  [<ffffffffaf12fdff>] ? console_unlock+0x25f/0x3b0
[   92.382967]  [<ffffffffaf12fb8b>] ? wake_up_klogd+0x2b/0x40
[   92.449679]  [<ffffffffafc38118>] ? printk+0x4f/0x57
[   92.509113]  [<ffffffffaf91c566>] ? dvb_usb_download_firmware+0x66/0xf0
[   92.588393]  [<ffffffffaf91cac6>] ? dvb_usb_device_init+0x3e6/0x600
[   92.663417]  [<ffffffffaf91fb2b>] ? technisat_usb2_probe+0x2b/0xe0
[   92.737501]  [<ffffffffaf838929>] ? usb_probe_interface+0x1d9/0x2b0
[   92.812626]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   92.887749]  [<ffffffffaf79f2be>] ? driver_probe_device+0x9e/0x280
[   92.961729]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   93.036752]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   93.111874]  [<ffffffffaf79dc22>] ? bus_for_each_drv+0x62/0xa0
[   93.181699]  [<ffffffffaf79f170>] ? device_attach+0xa0/0xc0
[   93.248407]  [<ffffffffaf79ded0>] ? bus_probe_device+0xa0/0xd0
[   93.318234]  [<ffffffffaf79b9e6>] ? device_add+0x4e6/0x5f0
[   93.383902]  [<ffffffffaf835343>] ? usb_control_msg+0xe3/0x130
[   93.457678]  [<ffffffffaf8370d5>] ? usb_set_configuration+0x505/0x800
[   93.538726]  [<ffffffffaf8436ce>] ? generic_probe+0x2e/0x90
[   93.609380]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   93.688349]  [<ffffffffaf79f2be>] ? driver_probe_device+0x9e/0x280
[   93.766175]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   93.844939]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   93.923700]  [<ffffffffaf79dc22>] ? bus_for_each_drv+0x62/0xa0
[   93.997162]  [<ffffffffaf79f170>] ? device_attach+0xa0/0xc0
[   94.067402]  [<ffffffffaf79ded0>] ? bus_probe_device+0xa0/0xd0
[   94.140768]  [<ffffffffaf79b9e6>] ? device_add+0x4e6/0x5f0
[   94.209862]  [<ffffffffaf82cd88>] ? usb_new_device+0x358/0x610
[   94.283113]  [<ffffffffaf82f798>] ? hub_thread+0xd88/0x13a0
[   94.353250]  [<ffffffffaf1277d3>] ? __wake_up_common+0x63/0xa0
[   94.426504]  [<ffffffffaf127810>] ? __wake_up_common+0xa0/0xa0
[   94.499653]  [<ffffffffaf82ea10>] ? usb_reset_device+0x1b0/0x1b0
[   94.574882]  [<ffffffffaf10b608>] ? kthread+0xc8/0xe0
[   94.638577]  [<ffffffffaf10b540>] ? insert_kthread_work+0x60/0x60
[   94.714743]  [<ffffffffafc50834>] ? ret_from_fork+0x74/0xa0
[   94.784565]  [<ffffffffaf10b540>] ? insert_kthread_work+0x60/0x60
[   94.860618] Code: ff ff 48 8b 05 63 e8 9d 00 e9 f3 fb ff ff be c3 05 00 00 48 c7 c7 21 5c 02 b0 e8 c5 80 8b ff b8 ea ff ff ff e9 b5 fc ff ff 0f 0b <0f> 0b 0f 1f 80 00 00 00 00 48 83 ec 18 48 89 6c 24 08 48 89 1c
[   95.099396] RIP  [<ffffffffaf831897>] ffffffffaf831897
[   95.164337]  RSP <ffffc900113a36d0>
[   95.209457] ---[ end trace e994358331d55a73 ]---
[   95.267960] Kernel panic - not syncing: grsec: halting the system due to suspicious kernel crash caused by root
[   95.390174] Kernel Offset: 0x2e000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[   95.522711] drm_kms_helper: panic occurred, switching back to text console
[   95.608696] ------------[ cut here ]------------
[   95.667572] WARNING: CPU: 3 PID: 620 at arch/x86/kernel/smp.c:124 update_process_times+0x62/0x80()
[   95.778536] CPU: 3 PID: 620 Comm: khubd Tainted: G      D      3.14.12+ #1
[   95.864565] Hardware name: Gigabyte Technology Co., Ltd. AM1M-S2P/AM1M-S2P, BIOS F2 06/19/2014
[   95.971485]  0000000000000009 ffffffffafc3db3f 0000000000000000 ffffffffaf0e985c
[   96.064584]  ffff880234383e90 0000000000000000 0000000000000003 0000000000000000
[   96.157790]  7fffffffffffffff ffffffffaf0f6422 ffff88023ed8c700 00000015a5dc19eb
[   96.250994] Call Trace:
[   96.284244]  <IRQ>  [<ffffffffafc3db3f>] ? dump_stack+0x41/0x57
[   96.359378]  [<ffffffffaf0e985c>] ? warn_slowpath_common+0x7c/0xb0
[   96.437410]  [<ffffffffaf0f6422>] ? update_process_times+0x62/0x80
[   96.515444]  [<ffffffffaf1448c2>] ? tick_sched_timer+0x42/0x80
[   96.589322]  [<ffffffffaf10e3aa>] ? __run_hrtimer.isra.32+0x5a/0x110
[   96.669435]  [<ffffffffaf10ec85>] ? hrtimer_interrupt+0xe5/0x220
[   96.745494]  [<ffffffffaf06bd35>] ? smp_apic_timer_interrupt+0x45/0x60
[   96.827789]  [<ffffffffafc51563>] ? apic_timer_interrupt+0x83/0x90
[   96.905918]  <EOI>  [<ffffffffafc37b26>] ? panic+0x19b/0x1e4
[   96.978034]  [<ffffffffafc37a85>] ? panic+0xfa/0x1e4
[   97.041732]  [<ffffffffaf5df770>] ? swiotlb_free_coherent+0xb0/0xb0
[   97.121014]  [<ffffffffaf5a52f7>] ? gr_handle_kernel_exploit+0x147/0x150
[   97.205486]  [<ffffffffaf042b5f>] ? oops_end+0x5f/0x90
[   97.271262]  [<ffffffffaf03f1af>] ? do_trap+0x9f/0x1f0
[   97.337033]  [<ffffffffaf5df770>] ? swiotlb_free_coherent+0xb0/0xb0
[   97.416313]  [<ffffffffaf5df770>] ? swiotlb_free_coherent+0xb0/0xb0
[   97.495597]  [<ffffffffaf03f531>] ? do_invalid_op+0x81/0xa0
[   97.566564]  [<ffffffffaf831897>] ? usb_hcd_map_urb_for_dma+0x5a7/0x5b0
[   97.650104]  [<ffffffffafc51af8>] ? invalid_op+0x18/0x20
[   97.718059]  [<ffffffffaf5df770>] ? swiotlb_free_coherent+0xb0/0xb0
[   97.797445]  [<ffffffffaf5df770>] ? swiotlb_free_coherent+0xb0/0xb0
[   97.876828]  [<ffffffffaf831897>] ? usb_hcd_map_urb_for_dma+0x5a7/0x5b0
[   97.960369]  [<ffffffffaf831cd6>] ? usb_hcd_submit_urb+0x146/0x900
[   98.038716]  [<ffffffffaf5bfd8d>] ? vsnprintf+0x21d/0x690
[   98.107710]  [<ffffffffaf834dfe>] ? usb_start_wait_urb+0x5e/0xf0
[   98.183978]  [<ffffffffaf835333>] ? usb_control_msg+0xd3/0x130
[   98.258167]  [<ffffffffaf12e8c4>] ? print_prefix+0x84/0x150
[   98.329239]  [<ffffffffaf91c294>] ? usb_cypress_writemem+0x34/0x40
[   98.407586]  [<ffffffffaf91c401>] ? usb_cypress_load_firmware+0x61/0x160
[   98.492164]  [<ffffffffaf12bffd>] ? up+0xd/0x40
[   98.550768]  [<ffffffffaf12fdff>] ? console_unlock+0x25f/0x3b0
[   98.624955]  [<ffffffffaf12fb8b>] ? wake_up_klogd+0x2b/0x40
[   98.695926]  [<ffffffffafc38118>] ? printk+0x4f/0x57
[   98.759516]  [<ffffffffaf91c566>] ? dvb_usb_download_firmware+0x66/0xf0
[   98.842848]  [<ffffffffaf91cac6>] ? dvb_usb_device_init+0x3e6/0x600
[   98.921924]  [<ffffffffaf91fb2b>] ? technisat_usb2_probe+0x2b/0xe0
[   98.999956]  [<ffffffffaf838929>] ? usb_probe_interface+0x1d9/0x2b0
[   99.078927]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   99.157790]  [<ffffffffaf79f2be>] ? driver_probe_device+0x9e/0x280
[   99.235512]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   99.314171]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   99.392725]  [<ffffffffaf79dc22>] ? bus_for_each_drv+0x62/0xa0
[   99.465978]  [<ffffffffaf79f170>] ? device_attach+0xa0/0xc0
[   99.536010]  [<ffffffffaf79ded0>] ? bus_probe_device+0xa0/0xd0
[   99.609161]  [<ffffffffaf79b9e6>] ? device_add+0x4e6/0x5f0
[   99.678051]  [<ffffffffaf835343>] ? usb_control_msg+0xe3/0x130
[   99.751098]  [<ffffffffaf8370d5>] ? usb_set_configuration+0x505/0x800
[   99.831417]  [<ffffffffaf8436ce>] ? generic_probe+0x2e/0x90
[   99.901243]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[   99.979381]  [<ffffffffaf79f2be>] ? driver_probe_device+0x9e/0x280
[  100.056478]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[  100.134616]  [<ffffffffaf79f4a0>] ? driver_probe_device+0x280/0x280
[  100.212650]  [<ffffffffaf79dc22>] ? bus_for_each_drv+0x62/0xa0
[  100.285489]  [<ffffffffaf79f170>] ? device_attach+0xa0/0xc0
[  100.355211]  [<ffffffffaf79ded0>] ? bus_probe_device+0xa0/0xd0
[  100.428048]  [<ffffffffaf79b9e6>] ? device_add+0x4e6/0x5f0
[  100.496628]  [<ffffffffaf82cd88>] ? usb_new_device+0x358/0x610
[  100.569361]  [<ffffffffaf82f798>] ? hub_thread+0xd88/0x13a0
[  100.638980]  [<ffffffffaf1277d3>] ? __wake_up_common+0x63/0xa0
[  100.711714]  [<ffffffffaf127810>] ? __wake_up_common+0xa0/0xa0
[  100.784343]  [<ffffffffaf82ea10>] ? usb_reset_device+0x1b0/0x1b0
[  100.859157]  [<ffffffffaf10b608>] ? kthread+0xc8/0xe0
[  100.922437]  [<ffffffffaf10b540>] ? insert_kthread_work+0x60/0x60
[  100.998288]  [<ffffffffafc50834>] ? ret_from_fork+0x74/0xa0
[  101.067908]  [<ffffffffaf10b540>] ? insert_kthread_work+0x60/0x60
[  101.143752] ---[ end trace e994358331d55a74 ]---

Re: drm_kms_helper: kernel panic

PostPosted: Tue Jul 15, 2014 6:45 pm
by spender
Hi,

The latest patch should fix this as well.

Thanks,
-Brad

Re: drm_kms_helper: kernel panic

PostPosted: Wed Jul 16, 2014 2:49 pm
by rainbow
Wonderful, now works perfectly!
Many thanks for your work!!

Just a note from git-am
Code: Select all
/var/tmp/linux-stable/.git/rebase-apply/patch:2423: trailing whitespace.
        @ store old DACR on stack
/var/tmp/linux-stable/.git/rebase-apply/patch:14948: trailing whitespace.
        andl  $~X86_EFLAGS_IF,EFLAGS(%rsp)
/var/tmp/linux-stable/.git/rebase-apply/patch:18804: space before tab in indent.
                if (cs == __KERNEL_CS || cs == __KERNEXEC_KERNEL_CS)
/var/tmp/linux-stable/.git/rebase-apply/patch:28072: trailing whitespace.
                die("grsec: kernel stack overflow detected", regs, error_code);
/var/tmp/linux-stable/.git/rebase-apply/patch:32652: trailing whitespace.

Re: drm_kms_helper: kernel panic

PostPosted: Fri Sep 05, 2014 1:21 pm
by sainz76
Hi everybody,
first of all, thanks to every developer and contributor of grsecurity. This is the first small issue I have with grsec in many many years.

Apparently I'm also stuck with 3.14.5-hardened-r2, the latest 3.14 version where the following error does not happen (supposedly caused by another DVB-T driver with the same issue).

From 3.14.6 onwards (I just tried 3.14.17-hardened-r4 including grsecurity-3.0-3.14.17-201409021816, same issue still present), and also on 3.15, I get this kernel BUG when I attach a USB DVB-T TerraTec Cinergy T2 device (normally is always attached, so it happens usually at boot when USB devices are probed and discovered). After this the system then appears to work normally (but not the DVB-T device), but it hangs during shutdown/reboot (I have to force a hardware poweroff).

Code: Select all
[    2.404075] usb 1-1.2: New USB device found, idVendor=0ccd, idProduct=0038
[    2.406301] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.408495] usb 1-1.2: Product: Cinergy T<C2><B2>
[    2.410681] usb 1-1.2: Manufacturer: TerraTec GmbH
[    2.413761] dvb-usb: found a 'TerraTec/qanu USB2.0 Highspeed DVB-T Receiver' in warm state.
[    2.416044] ------------[ cut here ]------------
[    2.418314] kernel BUG at include/asm-generic/dma-mapping-common.h:20!
[    2.420578] invalid opcode: 0000 [#1] SMP
[    2.422876] CPU: 0 PID: 708 Comm: khubd Not tainted 3.14.17-hardened-r4 #1
[    2.425184] Hardware name: Shuttle Inc. DS47D/FS47D, BIOS 1.05 02/06/2014
[    2.427537] task: ffff88011a285180 ti: ffff88011a2858c8 task.ti: ffff88011a2858c8
[    2.429919] RIP: 0010:[<ffffffff8d7e4f37>]  [<ffffffff8d7e4f37>] ffffffff8d7e4f37
[    2.432282] RSP: 0000:ffffc9000564b778  EFLAGS: 00010246
[    2.434611] RAX: 0000000000000000 RBX: ffff8800d5907070 RCX: 0000000000000002
[    2.436955] RDX: 0000000000000410 RSI: ffff88011a27e960 RDI: ffffc9000564b983
[    2.439281] RBP: ffffc9000564b983 R08: 0000000000000002 R09: ffff88011a27e960
[    2.441599] R10: 0000000000000001 R11: 0000000000000000 R12: 8000000000000000
[    2.443915] R13: ffff88011abba0b8 R14: 0000000000000001 R15: ffff88011a27e960
[    2.446274] FS:  0000000000000000(0000) GS:ffff88011f200000(0000) knlGS:0000000000000000
[    2.448648] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    2.451059] CR2: 000002a8499f5ec0 CR3: 000000000dc07000 CR4: 00000000000607f0
[    2.453459] Stack:
[    2.455881]  0000000000000002 0000000000000080 0000000000000002 ffffffff8d4d49f0
[    2.458371]  0000000000000983 ffff8800d58d1428 ffff88011a27e960 ffff8800d5907070
[    2.460850]  ffffc9000564b8b0 0000000000000010 00000000000007d0 ffffffff8d7e54f6
[    2.463322] Call Trace:
[    2.465729]  [<ffffffff8d4d49f0>] ? swiotlb_free_coherent+0xc0/0xc0
[    2.468185]  [<ffffffff8d7e54f6>] ? usb_hcd_submit_urb+0x236/0x960
[    2.470649]  [<ffffffff8d12d992>] ? __alloc_pages_nodemask+0x162/0xae0
[    2.473102]  [<ffffffff8d5a067e>] ? notify_update+0x2e/0x40
[    2.475551]  [<ffffffff8dbf6c63>] ? retint_restore_args+0x6/0xe
[    2.477981]  [<ffffffff8d5a0ea0>] ? vt_console_print+0x230/0x3e0
[    2.480379]  [<ffffffff8d7e8a8d>] ? usb_start_wait_urb+0x6d/0x100
[    2.482752]  [<ffffffff8d8a13b3>] ? dvb_usb_generic_rw+0xd3/0x210
[    2.485116]  [<ffffffff8d12e331>] ? __get_free_pages+0x21/0xc0
[    2.487462]  [<ffffffff8d8a3114>] ? cinergyt2_power_ctrl+0x44/0x60
[    2.489823]  [<ffffffff8d8a0c7f>] ? dvb_usb_device_init+0x24f/0x6c0
[    2.492159]  [<ffffffff8d7ec5b5>] ? usb_probe_interface+0x1b5/0x290
[    2.494514]  [<ffffffff8d688b38>] ? driver_probe_device+0xa8/0x280
[    2.496831]  [<ffffffff8d688dc0>] ? __driver_attach+0xb0/0xb0
[    2.499148]  [<ffffffff8d6871ab>] ? bus_for_each_drv+0x5b/0xb0
[    2.501443]  [<ffffffff8d6887d8>] ? device_attach+0xa8/0xc0
[    2.503761]  [<ffffffff8d687438>] ? bus_probe_device+0x98/0xd0
[    2.506053]  [<ffffffff8d684b93>] ? device_add+0x4d3/0x5e0
[    2.508320]  [<ffffffff8d7eab9c>] ? usb_set_configuration+0x56c/0x8c0
[    2.510579]  [<ffffffff8d7f7537>] ? generic_probe+0x37/0xa0
[    2.512802]  [<ffffffff8d688b38>] ? driver_probe_device+0xa8/0x280
[    2.515042]  [<ffffffff8d688dc0>] ? __driver_attach+0xb0/0xb0
[    2.517235]  [<ffffffff8d6871ab>] ? bus_for_each_drv+0x5b/0xb0
[    2.519448]  [<ffffffff8d6887d8>] ? device_attach+0xa8/0xc0
[    2.521611]  [<ffffffff8d687438>] ? bus_probe_device+0x98/0xd0
[    2.523799]  [<ffffffff8d684b93>] ? device_add+0x4d3/0x5e0
[    2.525944]  [<ffffffff8d7df744>] ? usb_new_device+0x1c4/0x3d0
[    2.528045]  [<ffffffff8d7df7b8>] ? usb_new_device+0x238/0x3d0
[    2.530117]  [<ffffffff8d7e23b2>] ? hub_thread+0x692/0x14b0
[    2.532171]  [<ffffffff8d0a1410>] ? __wake_up_common+0x90/0x90
[    2.534203]  [<ffffffff8d7e1d20>] ? usb_port_resume+0x3f0/0x3f0
[    2.536223]  [<ffffffff8d07eb7d>] ? kthread+0xcd/0xf0
[    2.538206]  [<ffffffff8d07eab0>] ? insert_kthread_work+0x70/0x70
[    2.540178]  [<ffffffff8dbf790f>] ? ret_from_fork+0x6f/0xa0
[    2.542148]  [<ffffffff8d07eab0>] ? insert_kthread_work+0x70/0x70
[    2.544078] Code: a2 00 eb 94 48 8b 05 39 af a2 00 e9 e1 fe ff ff be c3 05 00 00 48 c7 c7 53 95 fd 8d e8 83 09 87 ff b8 ea ff ff ff e9 12 fb ff ff <0f> 0b 0f 0b 0f 1f 44 00 00 66 66 66 66 90 48 83 ec 18 48 89 6c
[    2.548739] RIP  [<ffffffff8d7e4f37>] ffffffff8d7e4f37
[    2.550894]  RSP <ffffc9000564b778>
[    2.553080] ---[ end trace 03171ec42f1a723a ]---


Configuration is here: http://www.pastebay.net/1488342

Thanks in advance

Re: drm_kms_helper: kernel panic

PostPosted: Mon Sep 08, 2014 7:14 pm
by spender
Hi,

Thanks for the report -- this is yet another case of DMA operations using stack buffers, something that is against the upstream API policy. If you were to enable some specific debugging features on an upstream kernel, the system would crash as well. It should be fixed in the next patches, but let me know if you continue to have problems as there are many incorrect uses of the API in the kernel.

-Brad

Re: drm_kms_helper: kernel panic

PostPosted: Sat Sep 20, 2014 4:41 am
by azurit
Hi,

i'm having the similar problem with kernel 3.2.63 and grsec grsecurity-3.0-3.2.63-201409180857.patch. Trace is displayed during boot but everything continues ok and also seems to work fine. BTW, i have nothing connected to USB.



Code: Select all
 ------------[ cut here ]------------
 kernel BUG at include/asm-generic/dma-mapping-common.h:19!
 invalid opcode: 0000 [#1] SMP
 CPU 0
 Pid: 141, comm: usb-storage Not tainted 3.2.63-grsec #1 Intel S5000VSA/S5000VSA
 RIP: 0010:[<ffffffff81473f18>]  [<ffffffff81473f18>] usb_hcd_map_urb_for_dma+0x4f8/0x500
 RSP: 0018:ffffc9001035bc00  EFLAGS: 00010297
 RAX: 0000000000000000 RBX: ffff8803ca32fa80 RCX: 0000000000000026
 RDX: 0000000000000000 RSI: 000000009b927800 RDI: 000041001035bdd8
 RBP: ffffc9001035bc50 R08: 000000000000007f R09: 0000000000000066
 R10: ffff8803c9c65090 R11: 0000000000000002 R12: ffff8803c934e000
 R13: 000000000000000c R14: ffffc9001035bdd8 R15: 0000000000000001
 FS:  0000000000000000(0000) GS:ffff8803dfc00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 00007f58e9a5dfa3 CR3: 000000000163d000 CR4: 00000000000006f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process usb-storage (pid: 141, threadinfo ffff8803c90fdc38, task ffff8803c90fd810)
 Stack:
  7fffffffffffffff ffff8803c9c65090 ffffc9001035bcb0 ffffffff8135c220
  ffff8803c90fdc38 ffff8803ca32fa80 ffff8803c934e000 0000000000000000
  0000000000000010 ffffc9001035bda0 ffffc9001035bcb0 ffffffff8147409e
 Call Trace:
  [<ffffffff8135c220>] ? swiotlb_map_sg+0x10/0x10
  [<ffffffff8147409e>] usb_hcd_submit_urb+0x12e/0x6c0
  [<ffffffff81051c30>] ? try_to_wake_up+0x260/0x260
  [<ffffffff814755f5>] usb_submit_urb+0xe5/0x2a0
  [<ffffffff81492bdb>] usb_stor_msg_common+0xbb/0x150
  [<ffffffff814939f3>] usb_stor_ctrl_transfer+0xa3/0xd0
  [<ffffffff81493c51>] usb_stor_CB_transport+0x51/0x250
  [<ffffffff81492f91>] usb_stor_invoke_transport+0x181/0x4e0
  [<ffffffff814928d5>] usb_stor_ufi_command+0x55/0xa0
  [<ffffffff81494d5e>] usb_stor_control_thread+0x15e/0x230
  [<ffffffff81494c00>] ? fill_inquiry_response+0x120/0x120
  [<ffffffff81494c00>] ? fill_inquiry_response+0x120/0x120
  [<ffffffff81079ec6>] kthread+0x96/0xa0
  [<ffffffff8161aca4>] kernel_thread_helper+0x4/0x10
  [<ffffffff81079e30>] ? kthread_worker_fn+0x190/0x190
  [<ffffffff8161aca0>] ? gs_change+0xb/0xb
 Code: 31 c0 4d 85 ed 0f 94 c0 eb c4 48 8b 05 82 de 3a 00 eb ad 48 8b 05 79 de 3a 00 e9 0f ff ff ff 0f 0b eb fe 0f 0b eb fe 0f 0b eb fe <0f> 0b eb fe 0f 1f 40 00 55 48 89 e5 48 83 ec 10 48 89 1c 24 4c
 RIP  [<ffffffff81473f18>] usb_hcd_map_urb_for_dma+0x4f8/0x500
  RSP <ffffc9001035bc00>
---[ end trace 936afa1ae140043e ]---

Re: drm_kms_helper: kernel panic

PostPosted: Mon Sep 22, 2014 1:54 pm
by pyllyukko
Same here with 3.14.19 and grsecurity-3.0-3.14.19-201409180900.patch, except my boot stops right there :(
Code: Select all
[   48.163139] ------------[ cut here ]------------
[   48.163219] kernel BUG at include/asm-generic/dma-mapping-common.h:20!
[   48.163318] invalid opcode: 0000 [#1] SMP
[   48.164012] Modules linked in: hid_generic(+) usbhid hid usb_storage radeon ttm psmouse i2c_dev coretemp acpi_cpufreq serio_raw ioatdma drm_kms_helper processor lpc_ich kvm drm i2c_i801 agpgart i2c_algo_bit thermal_sys i5k_amb uhci_hcd hwmon ehci_pci i2c_core dca shpchp ehci_hcd evdev button microcode loop ext4 jbd2 mbcache netconsole e1000e ptp pps_core
[   48.164012] CPU: 1 PID: 586 Comm: usb-storage Not tainted 3.14.19-grsec #1
[   48.164012] Hardware name: Intel MP Server/S5000PSL, BIOS S5000.86B.03.00.0059.080820061609 08/08/2006
[   48.164012] task: ffff88007f4c37e0 ti: ffff88007f4c3f90 task.ti: ffff88007f4c3f90
[   48.164012] RIP: 0010:[<ffffffff814e3032>]  [<ffffffff814e3032>] ffffffff814e3032
[   48.164012] RSP: 0000:ffffc90012563b60  EFLAGS: 00010246
[   48.164012] RAX: 0000000000000000 RBX: ffff880079ec0408 RCX: 0000000000000024
[   48.164012] RDX: 0000000000000410 RSI: ffff88007b4120a8 RDI: ffffc90012563dd0
[   48.164012] RBP: ffffc90012563ba0 R08: 000000000000000c R09: 0000000000000000
[   48.164012] R10: 0000000000000000 R11: 0000000000000000 R12: ffffc90012563dd0
[   48.164012] R13: ffff88007b4120a8 R14: 0000000000000001 R15: ffff880077a14bb8
[   48.164012] FS:  0000000000000000(0000) GS:ffff88007f040000(0000) knlGS:0000000000000000
[   48.164012] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   48.164012] CR2: 000006b9ad59d000 CR3: 00000000016b9000 CR4: 00000000000007f0
[   48.164012] Stack:
[   48.164012]  0000000000000dd0 ffffffff8100c770 000000000000000c ffff880077a14bb8
[   48.164012]  ffff880079ec0408 0000000000000000 0000000000000010 ffff880079f03838
[   48.164012]  ffffc90012563c60 ffffffff814e34ae ffffc90012563cc8 7fffffffffffffff
[   48.164012] Call Trace:
[   48.164012]  [<ffffffff8100c770>] ? nommu_map_sg+0xf0/0xf0
[   48.164012]  [<ffffffff814e34ae>] usb_hcd_submit_urb+0x20e/0x9e0
[   48.164012]  [<ffffffff816a4620>] ? __sched_text_start+0x8/0x8
[   48.164012]  [<ffffffff816a5a3d>] ? schedule+0x2d/0x80
[   48.164012]  [<ffffffff816a479d>] ? schedule_timeout+0x17d/0x270
[   48.164012]  [<ffffffff810c975f>] ? dequeue_entity+0x11f/0x540
[   48.164012]  [<ffffffff814e4b51>] usb_submit_urb+0x301/0x580
[   48.164012]  [<ffffffff810c2650>] ? wake_up_state+0x30/0x30
[   48.164012]  [<ffffffffa098502d>] usb_stor_msg_common+0x9d/0x130 [usb_storage]
[   48.164012]  [<ffffffffa09853b3>] usb_stor_ctrl_transfer+0xc3/0x100 [usb_storage]
[   48.164012]  [<ffffffffa0985d25>] usb_stor_CB_transport+0x55/0x250 [usb_storage]
[   48.164012]  [<ffffffffa09862d8>] usb_stor_invoke_transport+0x278/0x550 [usb_storage]
[   48.164012]  [<ffffffffa0984f22>] usb_stor_ufi_command+0x72/0xb0 [usb_storage]
[   48.164012]  [<ffffffffa0986f3b>] usb_stor_control_thread+0x17b/0x2a0 [usb_storage]
[   48.164012]  [<ffffffff810d32ca>] ? __wake_up_locked+0x2a/0x40
[   48.164012]  [<ffffffffa0986dc0>] ? fill_inquiry_response+0x40/0x40 [usb_storage]
[   48.164012]  [<ffffffff810b0502>] kthread+0xe2/0x100
[   48.164012]  [<ffffffff810b0420>] ? insert_kthread_work+0x50/0x50
[   48.164012]  [<ffffffff816aa3c4>] ret_from_fork+0x74/0xa0
[   48.164012]  [<ffffffff810b0420>] ? insert_kthread_work+0x50/0x50
[   48.164012] Code: 72 00 eb 8b 48 8b 05 06 d8 72 00 e9 dd fe ff ff be c3 05 00 00 48 c7 c7 19 e9 a1 81 e8 e8 3c ba ff b8 ea ff ff ff e9 fc fa ff ff <0f> 0b 0f 0b 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48
[   48.164012] RIP  [<ffffffff814e3032>] ffffffff814e3032
[   48.164012]  RSP <ffffc90012563b60>
[   48.499303] ---[ end trace 1b9acfd78dfd86ac ]---
[   48.506981] Kernel panic - not syncing: grsec: halting the system due to suspicious kernel crash caused by root
[   48.507906] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff)
[   48.507906] drm_kms_helper: panic occurred, switching back to text console
[   48.530399] ------------[ cut here ]------------
[   48.531391] WARNING: CPU: 1 PID: 10 at arch/x86/kernel/smp.c:124 native_smp_send_reschedule+0x72/0x80()
[   48.531391] Modules linked in: hid_generic(+) usbhid hid usb_storage radeon ttm psmouse i2c_dev coretemp acpi_cpufreq serio_raw ioatdma drm_kms_helper processor lpc_ich kvm drm i2c_i801 agpgart i2c_algo_bit thermal_sys i5k_amb uhci_hcd hwmon ehci_pci i2c_core dca shpchp ehci_hcd evdev button microcode loop ext4 jbd2 mbcache netconsole e1000e ptp pps_core
[   48.531391] CPU: 1 PID: 10 Comm: migration/1 Tainted: G      D      3.14.19-grsec #1
[   48.531391] Hardware name: Intel MP Server/S5000PSL, BIOS S5000.86B.03.00.0059.080820061609 08/08/2006
[   48.531391]  ffffffff81c0d843 0000000000000000 0000000000000009 ffffc90000093cc0
[   48.531391]  ffffffff816a1362 0000000000000000 ffffc90000093cf8 ffffffff81086bed
[   48.531391]  ffffffff819d8a03 000000000000007c ffff88007f4c37e0 ffff88007b95a540
[   48.531391] Call Trace:
[   48.531391]  [<ffffffff816a1362>] dump_stack+0x45/0x5c
[   48.531391]  [<ffffffff81086bed>] warn_slowpath_common+0x7d/0xa0
[   48.531391]  [<ffffffff81086d39>] warn_slowpath_null+0x29/0x40
[   48.531391]  [<ffffffff81035612>] native_smp_send_reschedule+0x72/0x80
[   48.531391]  [<ffffffff810bd983>] resched_task+0x63/0x80
[   48.531391]  [<ffffffff810be42d>] check_preempt_curr+0x8d/0xd0
[   48.531391]  [<ffffffff810c67ec>] move_task+0x4c/0x60
[   48.531391]  [<ffffffff810c6e0e>] active_load_balance_cpu_stop+0x19e/0x1e0
[   48.531391]  [<ffffffff81114d26>] cpu_stopper_thread+0x66/0xf0
[   48.531391]  [<ffffffff810b80ec>] smpboot_thread_fn+0x12c/0x1f0
[   48.531391]  [<ffffffff810b7fc0>] ? SyS_setgroups+0x1a0/0x1a0
[   48.531391]  [<ffffffff810b0502>] kthread+0xe2/0x100
[   48.531391]  [<ffffffff810b0420>] ? insert_kthread_work+0x50/0x50
[   48.531391]  [<ffffffff816aa3c4>] ret_from_fork+0x74/0xa0
[   48.531391]  [<ffffffff810b0420>] ? insert_kthread_work+0x50/0x50
[   48.531391] ---[ end trace 1b9acfd78dfd86ad ]---

Re: drm_kms_helper: kernel panic

PostPosted: Mon Sep 22, 2014 9:17 pm
by spender
Can you use sysrq+t to provide me a stack dump of each task at the time of the crash? The bad code is from a different task not displayed in your oopses. You'll need to enable GRKERNSEC_KERN_LOCKOUT so that the system panics when the BUG() triggers instead of proceeding to boot.

Thanks,
-Brad