[3.11.y.z extended stable] Patch "isdnloop: Validate NUL-terminated strings from user." has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Fri Apr 11 12:24:56 UTC 2014
Luis Henriques <luis.henriques at canonical.com> writes:
> This is a note to let you know that I have just added a patch titled
>
> isdnloop: Validate NUL-terminated strings from user.
>
> to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree
> which can be found at:
>
> http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue
>
> If you, or anyone else, feels it should not be added to this tree, please
> reply to this email.
>
> For more information about the 3.11.y.z tree, see
> https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
>
> Thanks.
> -Luis
>
> ------
Ups, looks like I've a bug in my scripts and the actual patch wasn't
appended. The patch that has been queued for the 3.11 kernel is the
one below.
Cheers,
--
Luis
>From 408bbfead730a518f83c017e3fe69b81d6fc5a26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?YOSHIFUJI=20Hideaki=20/=20=E5=90=89=E8=97=A4=E8=8B=B1?=
=?UTF-8?q?=E6=98=8E?= <yoshfuji at linux-ipv6.org>
Date: Wed, 2 Apr 2014 12:48:42 +0900
Subject: isdnloop: Validate NUL-terminated strings from user.
commit 77bc6bed7121936bb2e019a8c336075f4c8eef62 upstream.
Return -EINVAL unless all of user-given strings are correctly
NUL-terminated.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji at linux-ipv6.org>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/isdn/isdnloop/isdnloop.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index 02125e6..e1f8748 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:
--
1.9.1
More information about the kernel-team
mailing list