From patchwork Wed Dec 2 14:59:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 551400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id E2E4E140313; Thu, 3 Dec 2015 02:00:21 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1a48tH-00015O-O0; Wed, 02 Dec 2015 15:00:19 +0000 Received: from mail-wm0-f53.google.com ([74.125.82.53]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1a48so-0000t2-K4 for kernel-team@lists.ubuntu.com; Wed, 02 Dec 2015 14:59:50 +0000 Received: by wmuu63 with SMTP id u63so218457480wmu.0 for ; Wed, 02 Dec 2015 06:59:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fc+KCaauKI/8UBtHIow4KwHB2F3TJKxG7JNk0jhJIKo=; b=AUW0rUIMwHj/azGzq/KIX+Db6tfLH5L7NwU7cyB4tlv1i9pLbf9cSc8p+5jytA/5SR YXQxw1R5Tzd7muTOg4UsJmtRc+e4fENyDhPn3GykdYbkeOnd5AJ0uyBu5m3XP09Kswy6 +bXkEDp10ZcqwJ26G6dyLCx92FywP9Vp75ei5l6vyYS7BtWTBqIWYLn3ri6lTlAQNnf4 vmqKdIORYZ68uua8ng3U5NXSku9FE/kpwI1tnqz6qnx3i3Z/+kuEMzMJkIsBrxANClBk sHGJs+IdlPbWzLg4PisJP91SDSmYplEY2qG23Jx2QD7Bn+ieDh/g/vclOKZJzhYmz66y TZaw== X-Gm-Message-State: ALoCoQkdLlUjzrsGdwhdhCnZjDia5ZJ/pE4entJAZMGnsQ26yRZOes2anwhj8mSgkQPrF8KtBHI/ X-Received: by 10.194.2.33 with SMTP id 1mr5972345wjr.150.1449068390449; Wed, 02 Dec 2015 06:59:50 -0800 (PST) Received: from localhost ([2001:470:6973:2:55ab:1437:1293:1d55]) by smtp.gmail.com with ESMTPSA id jm4sm3157055wjb.7.2015.12.02.06.59.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Dec 2015 06:59:49 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [wily/master-next 6/7] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() Date: Wed, 2 Dec 2015 14:59:36 +0000 Message-Id: <1449068377-21867-7-git-send-email-apw@canonical.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1449068377-21867-1-git-send-email-apw@canonical.com> References: <1449068377-21867-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Ben Hutchings Compile-tested only. Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller (cherry picked from commit 0baa57d8dc32db78369d8b5176ef56c5e2e18ab3) CVE-2015-7799 BugLink: http://bugs.launchpad.net/bugs/1508329 Signed-off-by: Andy Whitcroft --- drivers/isdn/i4l/isdn_ppp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index c4198fa..86f9abe 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c @@ -301,6 +301,8 @@ isdn_ppp_open(int min, struct file *file) is->compflags = 0; is->reset = isdn_ppp_ccp_reset_alloc(is); + if (!is->reset) + return -ENOMEM; is->lp = NULL; is->mp_seqno = 0; /* MP sequence number */ @@ -320,6 +322,10 @@ isdn_ppp_open(int min, struct file *file) * VJ header compression init */ is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */ + if (!is->slcomp) { + isdn_ppp_ccp_reset_free(is); + return -ENOMEM; + } #endif #ifdef CONFIG_IPPP_FILTER is->pass_filter = NULL;