[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131029190641.GB21820@longonot.mountain>
Date: Tue, 29 Oct 2013 22:06:41 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "John W. Linville" <linville@...driver.com>
Cc: libertas-dev@...ts.infradead.org, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org, security@...nel.org,
Nico Golde <nico@...lde.de>, Fabian Yamaguchi <fabs@...sec.de>
Subject: [patch] libertas: potential oops in debugfs
If we do a zero size write then it will oops. This can only be
triggered by root.
Reported-by: Nico Golde <nico@...lde.de>
Reported-by: Fabian Yamaguchi <fabs@...sec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists