kernel-fxtec-pro1x/drivers/media/video
Jesper Juhl bafefc0cf8 V4L/DVB (4154): Fix use-after-free bug in cpia2 driver
The coverity checker detected a use-after-free error in
drivers/media/video/cpia2/cpia2_v4l.c::cpia2_close() (coverity
error #1281).
What happens is that we lock cam->busy_lock, then proceed to free
resources, and in the case of (--cam->open_count == 0) we finish off by
doing a kfree(cam) and then at the end of the function we do a
mutex_unlock(&cam->busy_lock) which will explode since it'll dereference
the free'd `cam' :
...
mutex_lock(&cam->busy_lock);
...
if (--cam->open_count == 0) {
    ...
    if (!cam->present) {
        video_unregister_device(dev);
        kfree(cam);
    }
}
mutex_unlock(&cam->busy_lock);   <--- PROBLEM, cam no longer around.
...
Since this only happens in the case of open_count going down to zero I
don't see a problem with just releasing the mutex after unregistering the
device and just before the kfree().  In this case there is nothing around
that we can race against; we are in the release method, open_count is zero,
(!cam->present) and the device has just been unregistered, so letting go of
the mutex at this point looks safe to me.
Patch below to implement that solution.
Acked-by: Randy Dunlap <rdunlap@xenotime.net>

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-25 02:05:14 -03:00
..
bt8xx V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
cpia2 V4L/DVB (4154): Fix use-after-free bug in cpia2 driver 2006-06-25 02:05:14 -03:00
cx88 V4L/DVB (4150): Cx88: clear EN_I2SIN_ENABLE bit for ASUS PVR-416 to enable audio 2006-06-25 02:05:14 -03:00
cx25840 V4L/DVB (4067): Fixed cx25840 to work with PAL/M 2006-06-25 02:05:04 -03:00
em28xx V4L/DVB (4023): Subject: Pinnacle PCTV grey remote control support 2006-06-25 02:00:28 -03:00
et61x251 V4L/DVB (4064): No drivers should use VIDIOC_*_OLD 2006-06-25 02:05:04 -03:00
ovcamchip V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
pwc V4L/DVB (4147): Drivers/media/video/pwc/: make code static 2006-06-25 02:05:13 -03:00
saa7134 V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
sn9c102 V4L/DVB (4064): No drivers should use VIDIOC_*_OLD 2006-06-25 02:05:04 -03:00
usbvideo V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
zc0301 V4L/DVB (4064): No drivers should use VIDIOC_*_OLD 2006-06-25 02:05:04 -03:00
adv7170.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
adv7175.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
arv.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
bt819.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
bt856.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
bt866.c V4L/DVB (3916): AverMedia 6 Eyes AVS6EYES support 2006-06-25 01:59:28 -03:00
btcx-risc.c
btcx-risc.h
bw-qcam.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
bw-qcam.h V4L/DVB (3318b): sem2mutex: drivers/media/, #2 2006-02-07 06:49:14 -02:00
c-qcam.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
compat_ioctl32.c [PATCH] drivers/media/video __user annotations and fixes 2006-02-08 01:03:39 -05:00
cpia.c V4L/DVB (4086): There were a cross-reference on cpia and cpia_pp/cpia_usb 2006-06-25 02:05:06 -03:00
cpia.h V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
cpia_pp.c V4L/DVB (4086): There were a cross-reference on cpia and cpia_pp/cpia_usb 2006-06-25 02:05:06 -03:00
cpia_usb.c V4L/DVB (4086): There were a cross-reference on cpia and cpia_pp/cpia_usb 2006-06-25 02:05:06 -03:00
cs53l32a.c V4L/DVB (3599): Implement new routing commands for wm8775 and cs53l32a. 2006-03-24 16:27:00 -03:00
cs8420.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
dabfirmware.h V4L/DVB (3599a): Move drivers/usb/media to drivers/media/video 2006-03-25 09:29:04 -03:00
dabusb.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
dabusb.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
dpc7146.c V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
dsbr100.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
font.h V4L/DVB (3518): Creates a virtual video device driver 2006-03-24 16:26:49 -03:00
hexium_gemini.c V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
hexium_orion.c V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
ibmmpeg2.h
indycam.c
indycam.h
ir-kbd-i2c.c V4L/DVB (4023): Subject: Pinnacle PCTV grey remote control support 2006-06-25 02:00:28 -03:00
Kconfig V4L/DVB (4124): Kconfig: fix description for saa7115 module 2006-06-25 02:05:11 -03:00
ks0127.c V4L/DVB (3916): AverMedia 6 Eyes AVS6EYES support 2006-06-25 01:59:28 -03:00
ks0127.h V4L/DVB (3916): AverMedia 6 Eyes AVS6EYES support 2006-06-25 01:59:28 -03:00
Makefile V4L/DVB (4048): Add support for the Texas Instruments TLV320AIC23B audio codec 2006-06-25 02:05:00 -03:00
meye.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
meye.h V4L/DVB (3318b): sem2mutex: drivers/media/, #2 2006-02-07 06:49:14 -02:00
msp3400-driver.c V4L/DVB (3709): Improve line-in handling 2006-06-25 01:57:34 -03:00
msp3400-driver.h V4L/DVB (3697): More msp3400 and bttv fixes 2006-04-02 04:56:08 -03:00
msp3400-kthreads.c V4L/DVB (3709): Improve line-in handling 2006-06-25 01:57:34 -03:00
mt20xx.c
mxb.c V4L/DVB (3584): Implement V4L2_TUNER_MODE_LANG1_LANG2 audio mode 2006-03-24 16:26:58 -03:00
mxb.h V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
ov511.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
ov511.h V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
planb.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
planb.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
pms.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
saa711x.c [PATCH] I2C: Drop unneeded i2c-dev.h includes 2006-03-23 14:21:55 -08:00
saa5246a.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
saa5246a.h
saa5249.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
saa6588.c V4L/DVB (3546): Fix Compilation after moving bttv code 2006-03-24 16:26:51 -03:00
saa7110.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
saa7111.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7114.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7115.c V4L/DVB (3712): Fix video input setting of em28xx, use _INT_S_VIDEO_ROUTING in tvp5150 2006-06-25 01:57:38 -03:00
saa7121.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7127.c V4L/DVB (4110): Small bug in saa7127.c 2006-06-25 02:05:09 -03:00
saa7146.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7146reg.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7185.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7191.c
saa7191.h
saa7196.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
se401.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
se401.h V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
stradis.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
stv680.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
stv680.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tda7432.c V4L/DVB (3577): Cleanup audio input handling 2006-03-24 16:26:56 -03:00
tda8290.c V4L/DVB (3378): Restore power on defaults of tda9887 after tda8290 probe 2006-03-03 14:18:07 -03:00
tda9840.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tda9840.h V4L/DVB (3548): Renamed I2C_foo addresses to I2C_ADDR_foo 2006-03-24 16:26:51 -03:00
tda9875.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
tda9887.c V4L/DVB (3300): Add standard for South Korean NTSC-M using A2 audio. 2006-02-07 06:48:40 -02:00
tea5767.c V4L/DVB (3715): Change all emails to the currently used one. 2006-06-25 01:57:39 -03:00
tea6415c.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tea6415c.h
tea6420.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tea6420.h V4L/DVB (3548): Renamed I2C_foo addresses to I2C_ADDR_foo 2006-03-24 16:26:51 -03:00
tlv320aic23b.c V4L/DVB (4048): Add support for the Texas Instruments TLV320AIC23B audio codec 2006-06-25 02:05:00 -03:00
tuner-3036.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
tuner-core.c V4L/DVB (3919): V4l: rename TUNER_LG_TDVS_H062F to TUNER_LG_TDVS_H06XF 2006-06-25 01:59:29 -03:00
tuner-simple.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
tuner-types.c V4L/DVB (3919): V4l: rename TUNER_LG_TDVS_H062F to TUNER_LG_TDVS_H06XF 2006-06-25 01:59:29 -03:00
tvaudio.c V4L/DVB (3609): Remove VIDIOC_S_AUDIO from tvaudio: no longer used. 2006-04-02 04:54:58 -03:00
tveeprom.c V4L/DVB (3814): Add support for Samsung TCPG 6121P30A PAL tuner. 2006-06-25 01:58:14 -03:00
tvmixer.c V4L/DVB (3968a): Remove compatibility check for I2C_PEC 2006-06-25 01:59:57 -03:00
tvp5150.c V4L/DVB (3712): Fix video input setting of em28xx, use _INT_S_VIDEO_ROUTING in tvp5150 2006-06-25 01:57:38 -03:00
tvp5150_reg.h V4L/DVB (3408): Included new sliced VBI types to videodev2.h and tvp5150 2006-01-23 17:11:05 -02:00
upd64031a.c V4L/DVB (3666): Remove trailing newlines 2006-04-02 04:55:52 -03:00
upd64083.c V4L/DVB (3665): Add new NEC uPD64031A and uPD64083 i2c drivers 2006-04-02 04:55:51 -03:00
v4l1-compat.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
v4l2-common.c V4L/DVB (4148): Fix userbits debug prints 2006-06-25 02:05:13 -03:00
video-buf-dvb.c V4L/DVB (3762): Add sysfs device links to dvb devices 2006-06-25 01:57:55 -03:00
video-buf.c V4L/DVB (3620): Fix video-buf PCI wrappers 2006-04-02 04:55:12 -03:00
videocodec.c
videocodec.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
videodev.c V4L/DVB (4148): Fix userbits debug prints 2006-06-25 02:05:13 -03:00
vino.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
vino.h
vivi.c V4L/DVB (4146): Drivers/media/video/vivi.c: make 2 functions static 2006-06-25 02:05:13 -03:00
vpx3220.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
w9966.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
w9968cf.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
w9968cf.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
w9968cf_decoder.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
w9968cf_vpp.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
wm8739.c V4L/DVB (3661): Add wm8739 stereo audio ADC i2c driver 2006-04-02 04:55:45 -03:00
wm8775.c V4L/DVB (3599): Implement new routing commands for wm8775 and cs53l32a. 2006-03-24 16:27:00 -03:00
zoran.h V4L/DVB (3916): AverMedia 6 Eyes AVS6EYES support 2006-06-25 01:59:28 -03:00
zoran_card.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
zoran_card.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zoran_device.c V4L/DVB (4036): Fix some compilation warnings 2006-06-25 02:00:36 -03:00
zoran_device.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zoran_driver.c V4L/DVB (4070): Zoran strncpy() fix 2006-06-25 02:05:05 -03:00
zoran_procfs.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
zoran_procfs.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36016.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36016.h
zr36050.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36050.h
zr36057.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36060.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36060.h
zr36120.c Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb 2006-03-25 08:37:36 -08:00
zr36120.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36120_i2c.c V4L/DVB (3413): Typos grab bag of the month 2006-03-08 12:30:19 -03:00
zr36120_mem.c
zr36120_mem.h