[PATCH] ISDN: check for userspace copy faults
Most of the ISDN ->readstat() implementations needed to check copy_to_user() and put_user() return values. Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
04518bfe8e
commit
7786ce192f
@ -446,7 +446,8 @@ isdnloop_readstatus(u_char __user *buf, int len, isdnloop_card * card)
|
||||
for (p = buf, count = 0; count < len; p++, count++) {
|
||||
if (card->msg_buf_read == card->msg_buf_write)
|
||||
return count;
|
||||
put_user(*card->msg_buf_read++, p);
|
||||
if (put_user(*card->msg_buf_read++, p))
|
||||
return -EFAULT;
|
||||
if (card->msg_buf_read > card->msg_buf_end)
|
||||
card->msg_buf_read = card->msg_buf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user