lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 18 Jul 2010 20:34:18 +0200
From:	Jiri Slaby <jslaby@...e.cz>
To:	mchehab@...radead.org
Cc:	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	jirislaby@...il.com, Markus Rechberger <markus.rechberger@....com>
Subject: [PATCH 1/1] DVB: fix dvr node refcounting

In dvb_dvr_release, there is a test dvbdev->users==-1, but users are
never negative. This error results in hung tasks:
  task                        PC stack   pid father
bash          D ffffffffa000c948     0  3264   3170 0x00000000
 ffff88003aec5ce8 0000000000000086 0000000000011f80 0000000000011f80
 ffff88003aec5fd8 ffff88003aec5fd8 ffff88003b848670 0000000000011f80
 ffff88003aec5fd8 0000000000011f80 ffff88003e02a030 ffff88003b848670
Call Trace:
 [<ffffffff813dd4a5>] dvb_dmxdev_release+0xc5/0x130
 [<ffffffff8107b750>] ? autoremove_wake_function+0x0/0x40
 [<ffffffffa00013a2>] dvb_usb_adapter_dvb_exit+0x42/0x70 [dvb_usb]
 [<ffffffffa0000525>] dvb_usb_exit+0x55/0xd0 [dvb_usb]
 [<ffffffffa00005ee>] dvb_usb_device_exit+0x4e/0x70 [dvb_usb]
 [<ffffffffa000a065>] af9015_usb_device_exit+0x55/0x60 [dvb_usb_af9015]
 [<ffffffff813a3f05>] usb_unbind_interface+0x55/0x1a0
 [<ffffffff81316000>] __device_release_driver+0x70/0xe0
...

So check against 1 there instead.

BTW why's the TODO there? Adding TODOs to the code without
descriptions is like adding nothing.

Signed-off-by: Jiri Slaby <jslaby@...e.cz>
Cc: Markus Rechberger <markus.rechberger@....com>
Cc: Mauro Carvalho Chehab <mchehab@...radead.org>
---
 drivers/media/dvb/dvb-core/dmxdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c
index 425862f..0042306 100644
--- a/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/drivers/media/dvb/dvb-core/dmxdev.c
@@ -207,7 +207,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
 	}
 	/* TODO */
 	dvbdev->users--;
-	if(dvbdev->users==-1 && dmxdev->exit==1) {
+	if (dvbdev->users == 1 && dmxdev->exit == 1) {
 		fops_put(file->f_op);
 		file->f_op = NULL;
 		mutex_unlock(&dmxdev->mutex);
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ