From patchwork Tue Mar 29 17:23:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 603088 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 3qZHg41s9pz9sBf; Wed, 30 Mar 2016 04:23:28 +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 1akxMT-0004Pi-P9; Tue, 29 Mar 2016 17:23:25 +0000 Received: from mail-pf0-f194.google.com ([209.85.192.194]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.76) (envelope-from ) id 1akxMD-0004Hr-Ul for kernel-team@lists.ubuntu.com; Tue, 29 Mar 2016 17:23:10 +0000 Received: by mail-pf0-f194.google.com with SMTP id q129so3538806pfb.3 for ; Tue, 29 Mar 2016 10:23:09 -0700 (PDT) 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; bh=a7PGtfxTgb1YVebZcadyRwbE2NROprbGSmzOmoFr04M=; b=gDdizwvAvtEm1BBdgXtdpTeKuE1yqCuFHjcZdaxqZnuQnens/TIau7LtJBZsNTwQ4x DgN0flvvEkiiC8UxK8o7ccGf1zTvGmQ6DwP6Cyabj8RMEn1Ju97HQ0OEIJGacpByCrHk 1p4p2QLVJuJ1Sg4W8lFL6L4auaKWMX3zciQ8ym3cl3Ta+v4eXKDtKaGRkgR62UNMTit5 rs2O8rHWrkhq68gRugOmW65sypTdHOBcBx+iY9tKmODNyMmu5HRf2KCpmFR+kWklE41H oIjjEH3U/+RBHNKmz2huwuuF9CUpfG3d2qTqbw7yX72t9nxZXInFKyyBTRep2ir3LWyy q4ng== X-Gm-Message-State: AD7BkJJeKyjJ9D0weeoHOxhgJ+XMlbBJlBUo1DRSKM//1vdJG6yyMDYorg38oG8z7+pG6A== X-Received: by 10.98.71.70 with SMTP id u67mr5304184pfa.85.1459272188634; Tue, 29 Mar 2016 10:23:08 -0700 (PDT) Received: from fourier (c-76-126-59-13.hsd1.ca.comcast.net. [76.126.59.13]) by smtp.gmail.com with ESMTPSA id v74sm44625127pfa.7.2016.03.29.10.23.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Mar 2016 10:23:08 -0700 (PDT) Received: from kamal by fourier with local (Exim 4.86_2) (envelope-from ) id 1akxMA-0000A2-IZ; Tue, 29 Mar 2016 10:23:06 -0700 From: Kamal Mostafa To: Oliver Neukum Subject: [3.19.y-ckt stable] Patch "USB: cdc-acm: more sanity checking" has been added to the 3.19.y-ckt tree Date: Tue, 29 Mar 2016 10:23:05 -0700 Message-Id: <1459272185-583-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.4 X-Extended-Stable: 3.19 Cc: Greg Kroah-Hartman , Kamal Mostafa , Oliver Neukum , kernel-team@lists.ubuntu.com 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 This is a note to let you know that I have just added a patch titled USB: cdc-acm: more sanity checking to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue This patch is scheduled to be released in version 3.18.8-ckt18. 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.19.y-ckt tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ---8<------------------------------------------------------------ From 1327ec5901870770abbfc1b511a8d79b56c75bb2 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Tue, 15 Mar 2016 10:14:04 +0100 Subject: USB: cdc-acm: more sanity checking commit 8835ba4a39cf53f705417b3b3a94eb067673f2c9 upstream. An attack has become available which pretends to be a quirky device circumventing normal sanity checks and crashes the kernel by an insufficient number of interfaces. This patch adds a check to the code path for quirky devices. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman Signed-off-by: Kamal Mostafa --- drivers/usb/class/cdc-acm.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 672005d..9fa7296 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1109,6 +1109,9 @@ static int acm_probe(struct usb_interface *intf, if (quirks == NO_UNION_NORMAL) { data_interface = usb_ifnum_to_if(usb_dev, 1); control_interface = usb_ifnum_to_if(usb_dev, 0); + /* we would crash */ + if (!data_interface || !control_interface) + return -ENODEV; goto skip_normal_probe; }