Thread (2 messages) 2 messages, 1 author, 2013-10-29
STALE4629d

[patch] libertas: potential oops in debugfs

From: Dan Carpenter <hidden>
Date: 2013-10-29 19:10:24
Also in: linux-wireless
Subsystem: networking drivers (wireless), the rest · Maintainers: Johannes Berg, Linus Torvalds

If we do a zero size write then it will oops.  This can only be
triggered by root.

Reported-by: Nico Golde <redacted>
Reported-by: Fabian Yamaguchi <redacted>
Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 668dd27..a148f14 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -913,6 +913,9 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
 	char *p2;
 	struct debug_data *d = f->private_data;
 
+	if (cnt == 0)
+		return 0;
+
 	pdata = kmalloc(cnt, GFP_KERNEL);
 	if (pdata == NULL)
 		return 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help