OpenCloudOS-Kernel/drivers/media/dvb/dvb-usb
Jan Nikitenko 1e7439388a V4L/DVB (11999): af9015: fix stack corruption bug
This patch fixes stack corruption bug present in af9015_eeprom_dump():
the buffer buf is one byte smaller than required - there is 4 chars
for address prefix, 16*3 chars for dump of 16 eeprom bytes per line
and 1 byte for zero ending the string required, i.e. 53 bytes, but
only 52 are provided.
The one byte missing in stack based buffer buf causes following oops
on MIPS little endian platform, because i2c_adap pointer in
af9015_af9013_frontend_attach() is corrupted by inlined function
af9015_eeprom_dump():

CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc ==
803a4488, ra == c049a1c8
Oops[#1]:
Cpu 0
$ 0   : 00000000 10003c00 00000000 803a4468
$ 4   : 8f17c600 8f067b30 00000002 00000038
$ 8   : 00000001 8faf3e98 11da000d 09010002
$12   : 00000000 00000000 00000000 0000000a
$16   : 8f17c600 8f067b68 8faf3c00 8f067c04
$20   : 8f067b9c 00000100 8f067bf0 80104100
$24   : 00000000 2aba9fb0
$28   : 8f066000 8f067af0 802cbc48 c049a1c8
Hi    : 00000000
Lo    : 00000000
epc   : 803a4488 i2c_transfer+0x20/0x104
   Not tainted
ra    : c049a1c8 af9013_read_reg+0x78/0xc4 [af9013]
Status: 10003c03    KERNEL EXL IE
Cause : 00808008
BadVA : 00000000
PrId  : 03030200 (Au1550)
Modules linked in: af9013 dvb_usb_af9015(+) dvb_usb dvb_core firmware_class
i2c_au1550 au1550_spi
Process modprobe (pid: 2757, threadinfo=8f066000, task=8fade098, tls=2aad6470)
Stack : c049f5e0 80163090 805ba880 00000100 8f067bf0 0000d733 8f067b68 8faf3c00
       8f067c04 c049a1c8 80163bc0 8056a630 8f067b40 80163224 80569fc8 8f0033d7
       00000038 80140003 8f067b2c 00010038 c0420001 8f067b28 c049f5e0 00000004
       00000004 c049a524 c049d5a8 c049d5a8 00000000 803a6700 00000000 8f17c600
       c042a7a4 8f17c600 c042a7a4 c049c924 00000000 00000000 00000002 613a6c00
       ...
Call Trace:
[<803a4488>] i2c_transfer+0x20/0x104
[<c049a1c8>] af9013_read_reg+0x78/0xc4 [af9013]
[<c049a524>] af9013_read_reg_bits+0x2c/0x70 [af9013]
[<c049c924>] af9013_attach+0x98/0x65c [af9013]
[<c04257bc>] af9015_af9013_frontend_attach+0x214/0x67c [dvb_usb_af9015]
[<c03e2428>] dvb_usb_adapter_frontend_init+0x20/0x12c [dvb_usb]
[<c03e1ad8>] dvb_usb_device_init+0x374/0x6b0 [dvb_usb]
[<c0426120>] af9015_usb_probe+0x4fc/0xfcc [dvb_usb_af9015]
[<80381024>] usb_probe_interface+0xbc/0x218
[<803227fc>] driver_probe_device+0x12c/0x30c
[<80322a80>] __driver_attach+0xa4/0xac
[<80321ed0>] bus_for_each_dev+0x60/0xd0
[<8032162c>] bus_add_driver+0x1e8/0x2a8
[<80322cdc>] driver_register+0x7c/0x17c
[<80380d30>] usb_register_driver+0xa0/0x12c
[<c042e030>] af9015_usb_module_init+0x30/0x6c [dvb_usb_af9015]
[<8010d2a4>] __kprobes_text_end+0x3c/0x1f4
[<80167150>] sys_init_module+0xb8/0x1cc
[<80102370>] stack_done+0x20/0x3c

Code: afb10018  7000003f  00808021 <8c430000> 7000003f  1060002d  00c09021
8f830014  3c02efff

Signed-off-by: Jan Nikitenko <jan.nikitenko@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:55 -03:00
..
Kconfig V4L/DVB (11986): Kconfig: DVBWorld DVB-C USB Cable card needs tda1002x frontend 2009-06-16 19:07:49 -03:00
Makefile V4L/DVB (11216): Add driver for Intel CE6230 DVB-T USB2.0 2009-03-30 12:43:40 -03:00
a800.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
af9005-fe.c V4L/DVB (10248): v4l-dvb: fix a bunch of compile warnings. 2009-01-29 08:38:04 -02:00
af9005-remote.c V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings 2008-10-12 09:36:58 -02:00
af9005-script.h V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings 2008-10-12 09:36:58 -02:00
af9005.c V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings 2008-10-12 09:36:58 -02:00
af9005.h
af9015.c V4L/DVB (11999): af9015: fix stack corruption bug 2009-06-16 19:07:55 -03:00
af9015.h V4L/DVB (11339): af9015: remove wrong definitions 2009-04-06 21:43:54 -03:00
anysee.c V4L/DVB (10180): drivers/media: Fix a number of sparse warnings 2009-01-07 22:18:55 -02:00
anysee.h V4L/DVB (8032): Anysee: fix Kconfig 2008-07-20 07:09:33 -03:00
au6610.c V4L/DVB (7952): AU6610: various cosmetic changes 2008-07-20 07:07:56 -03:00
au6610.h V4L/DVB (7952): AU6610: various cosmetic changes 2008-07-20 07:07:56 -03:00
ce6230.c V4L/DVB (11328): Add AVerMedia A310 USB IDs to CE6230 driver. 2009-04-06 21:43:49 -03:00
ce6230.h V4L/DVB (11216): Add driver for Intel CE6230 DVB-T USB2.0 2009-03-30 12:43:40 -03:00
cinergyT2-core.c V4L/DVB (9636): dvb: cinergyt2 annotate struct endianness, remove unused variable, add static 2008-12-29 17:53:34 -02:00
cinergyT2-fe.c V4L/DVB (9107): Alternative version of Terratec Cinergy T2 driver 2008-10-12 09:37:14 -02:00
cinergyT2.h V4L/DVB (9636): dvb: cinergyt2 annotate struct endianness, remove unused variable, add static 2008-12-29 17:53:34 -02:00
cxusb.c V4L/DVB (9049): convert tuner drivers to use dvb_frontend->callback 2008-10-12 09:37:09 -02:00
cxusb.h V4L/DVB (8147): cxusb: add initial support for AVerTVHD Volar 2008-07-20 07:14:14 -03:00
dib07x0.h
dib0700.h V4L/DVB (9639): Make dib0700 remote control support work with firmware v1.20 2008-11-16 23:57:53 -02:00
dib0700_core.c V4L/DVB (10415): dib0700: add data debug to dib0700_i2c_xfer_new 2009-03-30 12:42:36 -03:00
dib0700_devices.c V4L/DVB (11831): dib0700: added USB IDs for Terratec T3 and T5 2009-06-16 18:21:09 -03:00
dibusb-common.c V4L/DVB (11832): dibusb_mc: fix i2c to not corrupt eeprom in case of strange read pattern 2009-06-16 18:21:09 -03:00
dibusb-mb.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dibusb-mc.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dibusb.h
digitv.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
digitv.h V4L/DVB (6578): dvb-usb: make some debug vars static 2008-01-25 19:02:06 -02:00
dtt200u-fe.c
dtt200u.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dtt200u.h
dtv5100.c V4L/DVB (8739): dtv5100: remove prohibited space... 2008-10-12 09:36:52 -02:00
dtv5100.h V4L/DVB (8738): dtv5100: remove old definition from header 2008-10-12 09:36:51 -02:00
dvb-usb-common.h V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dvb-usb-dvb.c net: convert more to %pM 2008-10-27 17:47:26 -07:00
dvb-usb-firmware.c V4L/DVB (7971): usb: unaligned 2008-06-05 06:35:53 -03:00
dvb-usb-i2c.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
dvb-usb-ids.h V4L/DVB (11915): af9015: support for Genius TVGo DVB-T03 2009-06-16 19:07:17 -03:00
dvb-usb-init.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dvb-usb-remote.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
dvb-usb-urb.c V4L/DVB (9492): unplug oops from dvb_frontend_init... 2008-11-11 08:11:26 -02:00
dvb-usb.h V4L/DVB (11571): Add Elgato EyeTV DTT deluxe to dibcom driver 2009-06-16 18:20:37 -03:00
dw2102.c V4L/DVB (11983): Add support for DVBWorld DVB-C USB Cable card. 2009-06-16 19:07:48 -03:00
dw2102.h V4L/DVB (11981): Remote control debugging for dw2102 driver based USB cards 2009-06-16 19:07:46 -03:00
gl861.c V4L/DVB (8014): gl861: coding style fixes 2008-07-20 07:08:55 -03:00
gl861.h V4L/DVB (8014): gl861: coding style fixes 2008-07-20 07:08:55 -03:00
gp8psk-fe.c V4L/DVB (9928): Convert GP8PSK module to use S2API 2008-12-30 09:39:21 -02:00
gp8psk.c V4L/DVB (11833): dvb-usb: Remove support for Genpix-CW3K (damages hardware) 2009-06-16 18:21:09 -03:00
gp8psk.h V4L/DVB (9928): Convert GP8PSK module to use S2API 2008-12-30 09:39:21 -02:00
m920x.c V4L/DVB (7969): m920x: unaligned access 2008-06-05 06:35:52 -03:00
m920x.h
nova-t-usb2.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
opera1.c V4L/DVB (7662): stv0299: Fixed some typos 2008-04-24 14:09:45 -03:00
ttusb2.c V4L/DVB (7654): tda10086: make the xtal frequency a configuration option 2008-04-24 14:09:44 -03:00
ttusb2.h
umt-010.c V4L/DVB (8042): DVB-USB UMT-010 channel scan oops 2008-06-26 15:58:51 -03:00
usb-urb.c V4L/DVB (9981): [PATCH] usb-urb.c: Fix initialization of URB list. 2008-12-30 09:39:38 -02:00
vp702x-fe.c V4L/DVB (7513): media/dvb/dvb-usb replace remaining __FUNCTION__ occurrences 2008-04-24 14:07:58 -03:00
vp702x.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
vp702x.h V4L/DVB (6572): dvb-usb/vp702x.c: cleanups 2008-01-25 19:02:04 -02:00
vp7045-fe.c
vp7045.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
vp7045.h V4L/DVB (6578): dvb-usb: make some debug vars static 2008-01-25 19:02:06 -02:00