summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2014-04-02 12:48:42 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-14 06:42:18 -0700
commit4a7a92aa5fa857a92b63507d3ef8ff0f668fbb21 (patch)
tree724c91ecac4dacec0f7c6523da1cd96e06cb8f6f /drivers
parentdbd3f730cf94e5ff51c196f6765a87e9e113ee64 (diff)
downloadlinux-3.10-4a7a92aa5fa857a92b63507d3ef8ff0f668fbb21.tar.gz
linux-3.10-4a7a92aa5fa857a92b63507d3ef8ff0f668fbb21.tar.bz2
linux-3.10-4a7a92aa5fa857a92b63507d3ef8ff0f668fbb21.zip
isdnloop: Validate NUL-terminated strings from user.
[ Upstream commit 77bc6bed7121936bb2e019a8c336075f4c8eef62 ] 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/isdnloop/isdnloop.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index 02125e6a910..e1f8748ff25 100644
--- a/drivers/isdn/isdnloop/isdnloop.c
+++ b/drivers/isdn/isdnloop/isdnloop.c
@@ -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: