isdnloop: Validate NUL-terminated strings from user.
[ Upstream commit 77bc6bed71 ]
Return -EINVAL unless all of user-given strings are correctly
NUL-terminated.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
dbd3f730cf
commit
4a7a92aa5f
1 changed files with 6 additions and 0 deletions
|
|
@ -1070,6 +1070,12 @@ isdnloop_start(isdnloop_card *card, isdnloop_sdef *sdefp)
|
|||
return -EBUSY;
|
||||
if (copy_from_user((char *) &sdef, (char *) sdefp, sizeof(sdef)))
|
||||
return -EFAULT;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (!memchr(sdef.num[i], 0, sizeof(sdef.num[i])))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&card->isdnloop_lock, flags);
|
||||
switch (sdef.ptype) {
|
||||
case ISDN_PTYPE_EURO:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue