Commit 550fef0d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix sign handling bugs in tun

From: Ravikiran G Thirumalai <kiran@in.ibm.com>

Fix a check for underflow.
parent be3286f5
......@@ -179,7 +179,7 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
size_t len = count;
if (!(tun->flags & TUN_NO_PI)) {
if ((len -= sizeof(pi)) < 0)
if ((len -= sizeof(pi)) > len)
return -EINVAL;
memcpy_fromiovec((void *)&pi, iv, sizeof(pi));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment