Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp310285ybe; Tue, 3 Sep 2019 23:25:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxX8jdNWAwwkOkKuH5jC32SJnNxJ7gjUYoi/uTGXepmgIgbdpb6JHaJ0SdvuTD0WeJ3edmp X-Received: by 2002:a65:6546:: with SMTP id a6mr34973611pgw.220.1567578302799; Tue, 03 Sep 2019 23:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567578302; cv=none; d=google.com; s=arc-20160816; b=BfZypn4nX1QgxPoktGGFnU0QbPNEUUumiqDsXJ37T4HtIqEXO602v96Oda4aBXHZUq 4kN02UUhFBSSFPOimdwLFqyaP8+HBdAW4hpHJXLNgc2p3Qq4R4sVzqx9kaauhFQKbHpd 486gzEyKVi/rAT1VWLAABt4t8DmsHo2fvdY1uyA9qRMF/qZiNrzDJyIklX53IgcLKRfZ y+mJUBSJDozW0E2869WDa8Kd9eFRqTxwODNpBAuPAuGUY0gRP3eK/43FTmM02r2brW+T qw8g4c0mEWtPIuEAb1b0+ksjNU+AinDzqSsv3LoSKfK6ehLWHdxZIPaQzbkNcbkeG2iN iPwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:user-agent:cc:to :references:in-reply-to:from:subject:content-transfer-encoding :mime-version:dmarc-filter:dkim-signature:dkim-signature; bh=S0HNy01KXfHPdgvbxI/fAC6hFNr0YqZNvVAL9MKPfNc=; b=ouCkQu6aXIfFjLGL/sWpzSzWSA+lYwL0If3GbiNvF57N5WXk6JBqdO3HGzFk/UF4kE qmkPSVL0rJX0IHmG5fERQkjByPCzquFls2B+pwgvPVousKSvo9euoh3x90WbN5xBbirQ x157uS6tmlm4rSBbYx6xEfMmz4XX44Od8Cra9n6KfZGPhn1JzFpaScke4vBFULwq0uIk XypK4EiazxjlvXHiSTyKARYKZX0mQRyUhMJ3UHGmJeFUQsINFMAZkqBCrxgZG2tuuhbG /oj70aI4137AMsFfCTlnzxTjkrb3LUo8i3FmN/6rtdzMo2KepQ8pVsVKy/kNebgu/OaT 3nsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SLll4VeA; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZQfyRXsC; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 y8si17354273pgr.89.2019.09.03.23.24.49; Tue, 03 Sep 2019 23:25:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SLll4VeA; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZQfyRXsC; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728595AbfIDGYC (ORCPT + 99 others); Wed, 4 Sep 2019 02:24:02 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40250 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfIDGYC (ORCPT ); Wed, 4 Sep 2019 02:24:02 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 80882614BF; Wed, 4 Sep 2019 06:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1567578240; bh=9TsUPRGNa8j66RTOeV8Du+4Nt7klePDihA/uWZTIa9I=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=SLll4VeAQ0QU17zi0e7HP8Mki2FWhPaVGpzWDI6S0NKYis5LtZW1G/vpb6qWjiL54 nvYFyHV+ddz0pwWN5dsxNtQZ58Vh/PmYHBFDYMAHtIaKlhK120IGziUnFjbtINkH5V 7CioEVz2rtFfHmL9DT83fPwx2KkF48uE17lYlMFU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MISSING_DATE,MISSING_MID,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 286D561516; Wed, 4 Sep 2019 06:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1567578235; bh=9TsUPRGNa8j66RTOeV8Du+4Nt7klePDihA/uWZTIa9I=; h=Subject:From:In-Reply-To:References:To:Cc:From; b=ZQfyRXsCCsnPjZwCMqxdB3E9XvA9mVHunzff7Wpg8fqaa057rSGq8/ehziQl+KnHr eWb4sCCE43Sh0DIMouQPhkjdCmlQKO0d4Li+wlRaMqtnFZCXAadLvX9YJY84FkMbBN EW0orLCFvsmvQYIn0B5KzzlkmSK14aJCFsy7cho4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 286D561516 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH 1/2] Fix a NULL-ptr-deref bug in ath6kl_usb_alloc_urb_from_pipe From: Kalle Valo In-Reply-To: <20190804002905.11292-1-benquike@gmail.com> References: <20190804002905.11292-1-benquike@gmail.com> To: Hui Peng Cc: davem@davemloft.net, Hui Peng , Mathias Payer , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-Id: <20190904062400.80882614BF@smtp.codeaurora.org> Date: Wed, 4 Sep 2019 06:23:55 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hui Peng wrote: > The `ar_usb` field of `ath6kl_usb_pipe_usb_pipe` objects > are initialized to point to the containing `ath6kl_usb` object > according to endpoint descriptors read from the device side, as shown > below in `ath6kl_usb_setup_pipe_resources`: > > for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { > endpoint = &iface_desc->endpoint[i].desc; > > // get the address from endpoint descriptor > pipe_num = ath6kl_usb_get_logical_pipe_num(ar_usb, > endpoint->bEndpointAddress, > &urbcount); > ...... > // select the pipe object > pipe = &ar_usb->pipes[pipe_num]; > > // initialize the ar_usb field > pipe->ar_usb = ar_usb; > } > > The driver assumes that the addresses reported in endpoint > descriptors from device side to be complete. If a device is > malicious and does not report complete addresses, it may trigger > NULL-ptr-deref `ath6kl_usb_alloc_urb_from_pipe` and > `ath6kl_usb_free_urb_to_pipe`. > > This patch fixes the bug by preventing potential NULL-ptr-deref > (CVE-2019-15098). > > Signed-off-by: Hui Peng > Reported-by: Hui Peng > Reported-by: Mathias Payer > Reviewed-by: Greg Kroah-Hartman > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 39d170b3cb62 ath6kl: fix a NULL-ptr-deref bug in ath6kl_usb_alloc_urb_from_pipe() -- https://patchwork.kernel.org/patch/11074655/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches