Thread (26 messages) 26 messages, 5 authors, 2012-05-09

[PATCH 04/14 v3] Input: atmel_mxt_ts - verify object size in mxt_write_object

From: Daniel Kurtz <hidden>
Date: 2012-04-18 13:22:10
Also in: lkml
Subsystem: atmel maxtouch driver, input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Nick Dyer, Dmitry Torokhov, Linus Torvalds

Don't allow writing past the length of an object.

Signed-off-by: Daniel Kurtz <redacted>
---
 drivers/input/touchscreen/atmel_mxt_ts.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 517bb96..1d0639d 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -516,7 +516,7 @@ static int mxt_write_object(struct mxt_data *data,
 	u16 reg;
 
 	object = mxt_get_object(data, type);
-	if (!object)
+	if (!object || offset >= object->size + 1)
 		return -EINVAL;
 
 	reg = object->start_address;
-- 
1.7.7.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help