Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1596103ybi; Sat, 27 Jul 2019 13:30:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ+cK6VUF9kdykr9kChFoMqZDxfxqDLMubLgju7jp1Lm1bSizFYUYmOjYpq5GOQuXGPPtc X-Received: by 2002:a17:90a:30cf:: with SMTP id h73mr106141110pjb.42.1564259459570; Sat, 27 Jul 2019 13:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564259459; cv=none; d=google.com; s=arc-20160816; b=D9+4566Zms1xzP1jNZgmcBdcB5qs3CE+Bf/MIf6ywQD+5igu6rRgP2t+C8Ifcf4jEU zT/r3DhFt8eOo+QFy1+Evk9b0YP1nYdolwLck/YVOH6gZwwmRdAJHIL1EDcr3hzJn7zZ ZMWChCmF+vv+n4EGcn8A3a0WbvldMQNULwbVQ87mC7kxotEkbZj+p/121qNE4Xqto80G CPtLshXCeKxnUfvFKg2CBQEMkqBgraIusC33gpaLf4Wh1ET/ojqiycOkiR+scj8sdkzy cRZl9wWCL8xUTXnVTTcygzo8iugnt7fq8+yZp1PoTHeYcy5aiZ9PgxBrpnx67uwtW1E9 3Cfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=MN0HtgZNwThPofgLk3zOueMbDz85rsLoJdZIaMAsXHI=; b=UnyO8jH3tydfDYp3zOQOArq0yQ36R0uAvoCSZzryRsoqATY7mYDSF23HNJa+V11bp3 NFYvZmMkP3GDuhCGcIFO1kZq646ayouSXymq7u/aeHmvfmSzNwpi6eh9qVLDGyRtSB9k tPYtkLCmtejUaaVxFnjba2Q9YvqPuvdl9pBrL9nmtqUy+Fn9PGMhP0LfR+nTfBhmW5S7 S9EHCLXCM83S0rnvWjPCfG4tnsL9HDqYzvgQeh2k4GuLd45Ox4zYUYzgZhm+tHA/lXLo 9C5Ahei491keZPltaSFulBXXGCOpmS1q/zZR4byaymkxhHekHBe82CHwYqBK+Vlba5rU GQ/g== 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 n187si23056516pgn.362.2019.07.27.13.30.44; Sat, 27 Jul 2019 13:30:59 -0700 (PDT) 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 S2388391AbfG0UaA (ORCPT + 99 others); Sat, 27 Jul 2019 16:30:00 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:39862 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388192AbfG0UaA (ORCPT ); Sat, 27 Jul 2019 16:30:00 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 63060153409C7; Sat, 27 Jul 2019 13:29:59 -0700 (PDT) Date: Sat, 27 Jul 2019 13:29:59 -0700 (PDT) Message-Id: <20190727.132959.360971552451713269.davem@davemloft.net> To: baijiaju1990@gmail.com Cc: isdn@linux-pingi.de, pakki001@umn.edu, tranmanphong@gmail.com, gregkh@linuxfoundation.org, rfontana@redhat.com, gustavo@embeddedor.com, tglx@linutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] isdn: mISDN: hfcsusb: Fix possible null-pointer dereferences in start_isoc_chain() From: David Miller In-Reply-To: <20190726082736.8195-1-baijiaju1990@gmail.com> References: <20190726082736.8195-1-baijiaju1990@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 27 Jul 2019 13:29:59 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai Date: Fri, 26 Jul 2019 16:27:36 +0800 > In start_isoc_chain(), usb_alloc_urb() on line 1392 may fail > and return NULL. At this time, fifo->iso[i].urb is assigned to NULL. > > Then, fifo->iso[i].urb is used at some places, such as: > LINE 1405: fill_isoc_urb(fifo->iso[i].urb, ...) > urb->number_of_packets = num_packets; > urb->transfer_flags = URB_ISO_ASAP; > urb->actual_length = 0; > urb->interval = interval; > LINE 1416: fifo->iso[i].urb->... > LINE 1419: fifo->iso[i].urb->... > > Thus, possible null-pointer dereferences may occur. > > To fix these bugs, "continue" is added to avoid using fifo->iso[i].urb > when it is NULL. > > These bugs are found by a static analysis tool STCheck written by us. > > Signed-off-by: Jia-Ju Bai Applied.