[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1496418222-23483-2-git-send-email-pali.rohar@gmail.com>
Date: Fri, 2 Jun 2017 17:43:38 +0200
From: Pali Rohár <pali.rohar@...il.com>
To: Joern Engel <joern@...ybastard.org>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Marek Vasut <marek.vasut@...il.com>,
Richard Weinberger <richard@....at>,
Cyrille Pitchen <cyrille.pitchen@...el.com>,
Artem Bityutskiy <dedekind1@...il.com>
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
Pali Rohár <pali.rohar@...il.com>
Subject: [PATCH 1/5] mtd: block2mtd: Check for valid user supplied erase size
Erase size is limited to 32bit unsigned integer, but value parsed from user
is limited up to size_t C type.
Signed-off-by: Pali Rohár <pali.rohar@...il.com>
---
drivers/mtd/devices/block2mtd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 7c887f1..ee47cdd 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -419,7 +419,7 @@ static int block2mtd_setup2(const char *val)
if (token[1]) {
ret = parse_num(&erase_size, token[1]);
- if (ret) {
+ if (ret || erase_size > U32_MAX) {
pr_err("illegal erase size\n");
return 0;
}
--
1.7.9.5
Powered by blists - more mailing lists