Received: by 10.223.185.116 with SMTP id b49csp3966808wrg; Tue, 13 Feb 2018 10:30:18 -0800 (PST) X-Google-Smtp-Source: AH8x224ZAH2EEyu4JOHiy9aF7hjGKE3IhNexfXY9uM9V7p/okt4ttfKo5jElySrByfHG3rsfr3AK X-Received: by 10.101.72.136 with SMTP id n8mr1699967pgs.201.1518546618847; Tue, 13 Feb 2018 10:30:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518546618; cv=none; d=google.com; s=arc-20160816; b=Dk6zmvVV1ytVQcLGLxnQ6D5vI8NAeAZGM7Nrs5ucKrPRPEF02VzQbzRaJxwxrHIHpb 589NFoqm0f5r8dEVtjJ+cEJyG4R0wjMTc2HQAku/7mYETxrGcYs1TcoUp/uCmRo1gM/P ISlgl47FICPv+Hj3N4yDCDfi66ZarE1tY1mpqSk/ph7BWzbmJ4tBeglscf547o8T5v6n gOmx6snzCtRnjaFtGIHxTn2Cv4f+T+N+AwfpwXdSMyM0AhrWz+mKJlctq63qIG6QuWz3 BPRCNzkba92Qe97acGqAD2w4UTB6WYcBhNEQ12iRPYOYJ3ZixnQXIBsPz6ZFbWb6sS18 Fu8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:arc-authentication-results; bh=YF8zWjUUFXwrQ5ae54uyPp9GQry2wVEkmwRZFQa+2X0=; b=UemXgejxpE3pWN1hBjuIdBwmsBDNtw7UyBPpop6dTrPlFNXHxVDIreBh1vudNrY32K N5MybYMZjQ9aJjkDhEI/PH5KKHTzF/r11lc2CB9j3fbXbdUaAVajNDeqCQ9dM9dYmF7I 8jpcyX/EWOh11GNykZOoUY9lUT8BCb+tb4os3ztTQ7AQ0zmX50BtYlrcPdi+KLOfya4A Zpa9Kzy2iw3lC0ykbOV8aunX7cNO+uAEMMLedUcnVQqsKApdNM9Ji8Lx97lSTQ1Q2wno AQ6SRn2NqhImoANA0Rf7Vjc5ykiM98UkkgfN8P21YyXId3C8assJ+yUsAMxveJJ8VutM NZ5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4-v6si1594141plt.469.2018.02.13.10.30.03; Tue, 13 Feb 2018 10:30:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965442AbeBMS3T (ORCPT + 99 others); Tue, 13 Feb 2018 13:29:19 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:60233 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965344AbeBMS3S (ORCPT ); Tue, 13 Feb 2018 13:29:18 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elfKN-0004oU-Ie; Tue, 13 Feb 2018 18:29:15 +0000 Received: from ben by deadeye with local (Exim 4.90) (envelope-from ) id 1elfKI-0002V9-BP; Tue, 13 Feb 2018 18:29:10 +0000 Message-ID: <1518546535.2617.47.camel@decadent.org.uk> Subject: Re: [PATCH 3.2 57/79] ALSA: usb-audio: Fix potential zero-division at parsing FU From: Ben Hutchings To: Takashi Iwai Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org Date: Tue, 13 Feb 2018 18:28:55 +0000 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-ml8q+OIeh+zg/Un6wEjH" X-Mailer: Evolution 3.26.3-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-ml8q+OIeh+zg/Un6wEjH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2018-02-12 at 07:59 +0100, Takashi Iwai wrote: > On Sun, 11 Feb 2018 05:20:06 +0100, > Ben Hutchings wrote: > >=20 > > 3.2.99-rc1 review patch. If anyone has any objections, please let me k= now. > >=20 > > ------------------ > >=20 > > From: Takashi Iwai > >=20 > > commit 8428a8ebde2db1e988e41a58497a28beb7ce1705 upstream. >=20 > Please drop this. This patch is broken, and was reverted in the later > commit 3c02a6d94665. Thanks, I've dropped this from 3.2 and 3.16 patch queues. Ben. > thanks, >=20 > Takashi >=20 >=20 > >=20 > > parse_audio_feature_unit() contains a code dividing potentially with > > zero when a malformed FU descriptor is passed. Although there is > > already a sanity check, it checks only the value zero, hence it can > > still lead to a zero-division when a value 1 is passed there. > >=20 > > Fix it by correcting the sanity check (and the error message > > thereof). > >=20 > > Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0= ") > > Signed-off-by: Takashi Iwai > > [bwh: Backported to 3.2: adjust context] > > Signed-off-by: Ben Hutchings > > --- > > sound/usb/mixer.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > --- a/sound/usb/mixer.c > > +++ b/sound/usb/mixer.c > > @@ -1262,9 +1262,9 @@ static int parse_audio_feature_unit(stru > > return -EINVAL; > > } > > csize =3D hdr->bControlSize; > > - if (!csize) { > > + if (csize <=3D 1) { > > snd_printdd(KERN_ERR "usbaudio: unit %u: " > > - "invalid bControlSize =3D=3D 0\n", unitid); > > + "invalid bControlSize <=3D 1\n", unitid); > > return -EINVAL; > > } > > channels =3D (hdr->bLength - 7) / csize - 1; > >=20 --=20 Ben Hutchings friends: People who know you well, but like you anyway. --=-ml8q+OIeh+zg/Un6wEjH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAlqDLmcACgkQ57/I7JWG EQn/vg/8Ddyk2bchhVumhEc0Qvqj7Q3K34FOnhKMmGUN7TTsoNUKk4exoZk5nZXi d9Y70IuU3yVy43ibCtbBiNhUAvPaAb2OCjxPRsLZ7+rj8jHgGhEWUMtbjuNlCUdI 7a/KBd073IZjzarvhrNeKhazvBZA7JTAgD+YlvigXuqO103SduOYaGgEmo5Dc+L4 sqsKxXopFlwc7SJbdnvaZQt4ZQ2qNxLgOqtgmGzgTODn/Wcw6W8wOlUCv1bgVlQz tISnAsZKZxCVYNAP0+AhlctDw7Lsq6eZboStPfGbdcGFpgw33KG9YrRS8OdsIdSx i1ccAIN4w/4pGlOqI/Tka1pCaSlcNnxZo5EKsBC3Hnj/JWlPDycnCNhV5eRiPQ4R Cct1m4C61siLqo22fSgDDpHjhIqfdhgktti+IN2gU8/p6+rng3GPn3zlMZ9ueOiz klKRH7r2N/3mmxIGm1U3uCIhSZgwg1QN0p56eG0KZyCIu3JPsyxl7vMCnkVMxLx5 gylSF3U7A01XCEJGFM7SedOc6n3WuZ/JuWDXIpJ6MH+ZAxFoGRkbb1ZGIrxIPwu5 7O7UPPSNtzbjTuU5WPsdUY5y2zJKPsUpuHcVMBYhFVtVbjAT8R30cpfKEzz77y79 Zp3PtZMBl6zw4+MVHhWfSnHUv+sf2Z7AxaKw/hNNe9vnXZDVpXU= =L0l0 -----END PGP SIGNATURE----- --=-ml8q+OIeh+zg/Un6wEjH--