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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1333927151-13014-1-git-send-email-Larry.Finger@lwfinger.net>
Date:	Sun,  8 Apr 2012 18:19:11 -0500
From:	Larry Finger <Larry.Finger@...inger.net>
To:	Mauro Carvalho Chehab <mchehab@...radead.org>
Cc:	Larry Finger <Larry.Finger@...inger.net>,
	Hans Verkuil <hans.verkuil@...co.com>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	jrh <jharbestonus@...il.com>
Subject: [PATCH] media: au0828: Convert BUG_ON to WARN_ONCE

In the mail thread at http://www.mythtv.org/pipermail/mythtv-users/2012-April/331164.html,
a kernel crash is triggered when trying to run mythtv with a HVR950Q tuner.
The crash condition is due to res_free() being called to free something that
has is not reserved. The actual reason for this mismatch of reserve/free is
not known; however, using a BUG_ON rather than a WARN_ON seems unfortunate.

Signed-off-by: Larry Finger <Larry.Finger@...inger.net>
---
 drivers/media/video/au0828/au0828-video.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
index 0b3e481..5c53e38 100644
--- a/drivers/media/video/au0828/au0828-video.c
+++ b/drivers/media/video/au0828/au0828-video.c
@@ -891,8 +891,13 @@ static int res_locked(struct au0828_dev *dev, unsigned int bit)
 static void res_free(struct au0828_fh *fh, unsigned int bits)
 {
 	struct au0828_dev    *dev = fh->dev;
+	unsigned int bits2 = fh->resources & bits;
 
-	BUG_ON((fh->resources & bits) != bits);
+	if (bits2 != bits) {
+		WARN_ONCE(true, "au0828: Trying to free resource 0x%x"
+			  " without reserving it\n", bits);
+		return;
+	}
 
 	mutex_lock(&dev->lock);
 	fh->resources  &= ~bits;
-- 
1.7.10

--
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