Sudeep Dutt ea751ea7a0 misc: mic: fix possible signed underflow (undefined behavior) in userspace API
commit 3b1cc9b9622a022208ec95b1259b05bbdf712eb7 upstream.

iovcnt is declared as a signed integer in both the userspace API and
as a local variable in mic_virtio.c. The while() loop in mic_virtio.c
iterates until the local variable iovcnt reaches the value 0. If
userspace passes e.g. INT_MIN as iovcnt field, this loop then appears
to depend on an undefined behavior (signed underflow) to complete.
The fix is to use unsigned integers in both the userspace API and
the local variable.

This issue was reported @ https://lkml.org/lkml/2014/1/10/10

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-22 13:34:57 -08:00
..
2014-02-22 13:34:53 -08:00
2012-11-21 12:51:53 -08:00
2012-11-21 12:51:53 -08:00
2013-05-28 12:02:13 +02:00
2013-04-11 12:39:02 -07:00
2013-08-27 08:28:01 -07:00
2012-11-21 12:53:32 -08:00
2013-11-16 12:21:40 -08:00
2013-03-02 08:52:17 -06:00
2013-11-16 12:21:40 -08:00