linux/drivers/media/usb/dvb-usb
Mauro Carvalho Chehab 43fab9793c [media] dvb-usb: don't use stack for firmware load
As reported by Marc Duponcheel <marc@offline.be>, firmware load on
dvb-usb is using the stack, with is not allowed anymore on default
Kernel configurations:

[ 1025.958836] dvb-usb: found a 'WideView WT-220U PenType Receiver (based on ZL353)' in cold state, will try to load a firmware
[ 1025.958853] dvb-usb: downloading firmware from file 'dvb-usb-wt220u-zl0353-01.fw'
[ 1025.958855] dvb-usb: could not stop the USB controller CPU.
[ 1025.958856] dvb-usb: error while transferring firmware (transferred size: -11, block size: 3)
[ 1025.958856] dvb-usb: firmware download failed at 8 with -22
[ 1025.958867] usbcore: registered new interface driver dvb_usb_dtt200u

[    2.789902] dvb-usb: downloading firmware from file 'dvb-usb-wt220u-zl0353-01.fw'
[    2.789905] ------------[ cut here ]------------
[    2.789911] WARNING: CPU: 3 PID: 2196 at drivers/usb/core/hcd.c:1584 usb_hcd_map_urb_for_dma+0x430/0x560 [usbcore]
[    2.789912] transfer buffer not dma capable
[    2.789912] Modules linked in: btusb dvb_usb_dtt200u(+) dvb_usb_af9035(+) btrtl btbcm dvb_usb dvb_usb_v2 btintel dvb_core bluetooth rc_core rfkill x86_pkg_temp_thermal intel_powerclamp coretemp crc32_pclmul aesni_intel aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd drm_kms_helper syscopyarea sysfillrect pcspkr i2c_i801 sysimgblt fb_sys_fops drm i2c_smbus i2c_core r8169 lpc_ich mfd_core mii thermal fan rtc_cmos video button acpi_cpufreq processor snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd crc32c_intel ahci libahci libata xhci_pci ehci_pci xhci_hcd ehci_hcd usbcore usb_common dm_mirror dm_region_hash dm_log dm_mod
[    2.789936] CPU: 3 PID: 2196 Comm: systemd-udevd Not tainted 4.9.0-gentoo #1
[    2.789937] Hardware name: ASUS All Series/H81I-PLUS, BIOS 0401 07/23/2013
[    2.789938]  ffffc9000339b690 ffffffff812bd397 ffffc9000339b6e0 0000000000000000
[    2.789939]  ffffc9000339b6d0 ffffffff81055c86 000006300339b6a0 ffff880116c0c000
[    2.789941]  0000000000000000 0000000000000000 0000000000000001 ffff880116c08000
[    2.789942] Call Trace:
[    2.789945]  [<ffffffff812bd397>] dump_stack+0x4d/0x66
[    2.789947]  [<ffffffff81055c86>] __warn+0xc6/0xe0
[    2.789948]  [<ffffffff81055cea>] warn_slowpath_fmt+0x4a/0x50
[    2.789952]  [<ffffffffa006d460>] usb_hcd_map_urb_for_dma+0x430/0x560 [usbcore]
[    2.789954]  [<ffffffff814ed5a8>] ? io_schedule_timeout+0xd8/0x110
[    2.789956]  [<ffffffffa006e09c>] usb_hcd_submit_urb+0x9c/0x980 [usbcore]
[    2.789958]  [<ffffffff812d0ebf>] ? copy_page_to_iter+0x14f/0x2b0
[    2.789960]  [<ffffffff81126818>] ? pagecache_get_page+0x28/0x240
[    2.789962]  [<ffffffff8118c2a0>] ? touch_atime+0x20/0xa0
[    2.789964]  [<ffffffffa006f7c4>] usb_submit_urb+0x2c4/0x520 [usbcore]
[    2.789967]  [<ffffffffa006feca>] usb_start_wait_urb+0x5a/0xe0 [usbcore]
[    2.789969]  [<ffffffffa007000c>] usb_control_msg+0xbc/0xf0 [usbcore]
[    2.789970]  [<ffffffffa067903d>] usb_cypress_writemem+0x3d/0x40 [dvb_usb]
[    2.789972]  [<ffffffffa06791cf>] usb_cypress_load_firmware+0x4f/0x130 [dvb_usb]
[    2.789973]  [<ffffffff8109dbbe>] ? console_unlock+0x2fe/0x5d0
[    2.789974]  [<ffffffff8109e10c>] ? vprintk_emit+0x27c/0x410
[    2.789975]  [<ffffffff8109e40a>] ? vprintk_default+0x1a/0x20
[    2.789976]  [<ffffffff81124d76>] ? printk+0x43/0x4b
[    2.789977]  [<ffffffffa0679310>] dvb_usb_download_firmware+0x60/0xd0 [dvb_usb]
[    2.789979]  [<ffffffffa0679898>] dvb_usb_device_init+0x3d8/0x610 [dvb_usb]
[    2.789981]  [<ffffffffa069e302>] dtt200u_usb_probe+0x92/0xd0 [dvb_usb_dtt200u]
[    2.789984]  [<ffffffffa007420c>] usb_probe_interface+0xfc/0x270 [usbcore]
[    2.789985]  [<ffffffff8138bf95>] driver_probe_device+0x215/0x2d0
[    2.789986]  [<ffffffff8138c0e6>] __driver_attach+0x96/0xa0
[    2.789987]  [<ffffffff8138c050>] ? driver_probe_device+0x2d0/0x2d0
[    2.789988]  [<ffffffff81389ffb>] bus_for_each_dev+0x5b/0x90
[    2.789989]  [<ffffffff8138b7b9>] driver_attach+0x19/0x20
[    2.789990]  [<ffffffff8138b33c>] bus_add_driver+0x11c/0x220
[    2.789991]  [<ffffffff8138c91b>] driver_register+0x5b/0xd0
[    2.789994]  [<ffffffffa0072f6c>] usb_register_driver+0x7c/0x130 [usbcore]
[    2.789994]  [<ffffffffa06a5000>] ? 0xffffffffa06a5000
[    2.789996]  [<ffffffffa06a501e>] dtt200u_usb_driver_init+0x1e/0x20 [dvb_usb_dtt200u]
[    2.789997]  [<ffffffff81000408>] do_one_initcall+0x38/0x140
[    2.789998]  [<ffffffff8116001c>] ? __vunmap+0x7c/0xc0
[    2.789999]  [<ffffffff81124fb0>] ? do_init_module+0x22/0x1d2
[    2.790000]  [<ffffffff81124fe8>] do_init_module+0x5a/0x1d2
[    2.790002]  [<ffffffff810c96b1>] load_module+0x1e11/0x2580
[    2.790003]  [<ffffffff810c68b0>] ? show_taint+0x30/0x30
[    2.790004]  [<ffffffff81177250>] ? kernel_read_file+0x100/0x190
[    2.790005]  [<ffffffff810c9ffa>] SyS_finit_module+0xba/0xc0
[    2.790007]  [<ffffffff814f13e0>] entry_SYSCALL_64_fastpath+0x13/0x94
[    2.790008] ---[ end trace c78a74e78baec6fc ]---

So, allocate the structure dynamically.

Cc: stable@vger.kernel.org # Kernel 4.9+
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03 14:23:41 -02:00
..
a800.c [media] media: change email address 2016-01-25 12:01:08 -02:00
af9005-fe.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
af9005-remote.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
af9005-script.h
af9005.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
af9005.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
az6027.c [media] az6027: Add support for Elgato EyeTV Sat v3 2016-05-06 15:53:23 -03:00
az6027.h
cinergyT2-core.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cinergyT2-fe.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cinergyT2.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cxusb.c [media] cxusb: port to rc-core 2017-01-30 11:50:32 -02:00
cxusb.h [media] dvb-usb-cxusb: Geniatech T230 - resync TS FIFO after lock 2016-11-18 13:46:28 -02:00
dib07x0.h
dib0700.h [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
dib0700_core.c Linux 4.9-rc5 2016-11-16 16:42:27 -02:00
dib0700_devices.c [media] dvb-usb: don't break long lines 2016-10-21 09:39:51 -02:00
dibusb-common.c [media] dibusb: fix possible memory leak in dibusb_rc_query() 2016-11-21 11:40:45 -02:00
dibusb-mb.c [media] media: change email address 2016-01-25 12:01:08 -02:00
dibusb-mc-common.c [media] dvb-usb: remove another redundant #include <linux/kconfig.h> 2016-11-21 14:30:01 -02:00
dibusb-mc.c [media] media: change email address 2016-01-25 12:01:08 -02:00
dibusb.h [media] dibusb: don't do DMA on stack 2016-10-14 12:38:34 -03:00
digitv.c [media] digitv: handle error code on RC query 2016-10-14 12:52:27 -03:00
digitv.h [media] digitv: don't do DMA on stack 2016-10-14 12:40:47 -03:00
dtt200u-fe.c [media] dvb: make DVB frontend *_ops instances "const" 2016-11-18 15:00:22 -02:00
dtt200u.c dvb-usb: move data_mutex to struct dvb_usb_device 2016-11-13 10:02:22 -08:00
dtt200u.h [media] media: change email address 2016-01-25 12:01:08 -02:00
dtv5100.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
dtv5100.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
dvb-usb-common.h [media] media: change email address 2016-01-25 12:01:08 -02:00
dvb-usb-dvb.c [media] dvb-usb: don't break long lines 2016-10-21 09:39:51 -02:00
dvb-usb-firmware.c [media] dvb-usb: don't use stack for firmware load 2017-02-03 14:23:41 -02:00
dvb-usb-i2c.c [media] media: change email address 2016-01-25 12:01:08 -02:00
dvb-usb-init.c dvb-usb: move data_mutex to struct dvb_usb_device 2016-11-13 10:02:22 -08:00
dvb-usb-remote.c [media] rc-main: assign driver type during allocation 2017-01-30 13:59:57 -02:00
dvb-usb-urb.c [media] media: change email address 2016-01-25 12:01:08 -02:00
dvb-usb.h Linux 4.9-rc5 2016-11-16 16:42:27 -02:00
dw2102.c [media] Add Cinergy S2 rev.4 support 2016-10-24 18:33:11 -02:00
dw2102.h
friio-fe.c [media] dvb: make DVB frontend *_ops instances "const" 2016-11-18 15:00:22 -02:00
friio.c [media] dvb-usb: don't break long lines 2016-10-21 09:39:51 -02:00
friio.h
gp8psk.c [media] gp8psk: make local symbol gp8psk_fe_ops static 2017-02-03 14:23:34 -02:00
gp8psk.h gp8psk: Fix DVB frontend attach 2016-11-13 10:02:22 -08:00
Kconfig [media] dvb-usb: avoid link error with dib3000m{b,c| 2016-09-22 12:38:27 -03:00
m920x.c [media] squash lines for simple wrapper functions 2016-11-16 13:28:40 -02:00
m920x.h
Makefile gp8psk: Fix DVB frontend attach 2016-11-13 10:02:22 -08:00
nova-t-usb2.c [media] nova-t-usb2: handle error code on RC query 2016-10-14 12:52:25 -03:00
opera1.c [media] dvb-usb: don't break long lines 2016-10-21 09:39:51 -02:00
pctv452e.c [media] pctv452e: move buffer to heap, no mutex 2016-12-21 07:15:36 -02:00
technisat-usb2.c [media] rc: raw IR drivers cannot handle cec, unknown or other 2017-01-30 12:40:50 -02:00
ttusb2.c [media] media: change email address 2016-01-25 12:01:08 -02:00
ttusb2.h
umt-010.c [media] media: change email address 2016-01-25 12:01:08 -02:00
usb-urb.c [media] media: change email address 2016-01-25 12:01:08 -02:00
vp702x-fe.c [media] dvb: make DVB frontend *_ops instances "const" 2016-11-18 15:00:22 -02:00
vp702x.c [media] media: change email address 2016-01-25 12:01:08 -02:00
vp702x.h
vp7045-fe.c [media] dvb: make DVB frontend *_ops instances "const" 2016-11-18 15:00:22 -02:00
vp7045.c [media] media: change email address 2016-01-25 12:01:08 -02:00
vp7045.h [media] media: change email address 2016-01-25 12:01:08 -02:00