Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp604458pxb; Thu, 12 Nov 2020 11:28:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBaGKBgbi4Ho8damYd2gFK67HNMzz+I2L4dtahU/MuIXSaXOtYRm/mvbPaHkzOxmO/38Xo X-Received: by 2002:a17:906:1614:: with SMTP id m20mr873222ejd.258.1605209291858; Thu, 12 Nov 2020 11:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605209291; cv=none; d=google.com; s=arc-20160816; b=gDN7Ebr2aepuVFpYs7JHbPUHJLUzJvZP9vl5vG/6NQl+wb++QayfgEqDSlQc1I4wgP k60EfwPUoBIdgmp2c8cfCtffRq7O38+Z7sAUtziNYlkDdIuW0sI+/dzkewwyzThRTQwt gtxqjqBrjnQGhRfzbNsWtklNdT7ndLYzKF4Yd298rCwFFcMeW1g1pznhfAQNmDekjCR/ sDUvjokc1yVbtQULmsq4BLxd3hnzUGFdSMYnhBdtGj40pmo/QZ75XhmmF7HfY7muEv0Z wFDki/aIIYMctWwzJRM62XZWiywdAcW8FXsL2Vv9NAVULzUFbPv5TWqz8Pgz2GgD070U CKJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=z5YdKhCGO4zz1KLK1GK0wj3lb+j3+cXm4IWq49VPVjo=; b=zm3uuBiYZ4uKtnAF3A+xVyFZ6bNSxYUgfWym8mG1kfyIQnW4fN+O44tH//CIWrZLTl e8YmiWZVP3JEGP4X9VOycfEcngOfkBKo3N0qBV4IYkTGT8T/mwB+kz/zZfVjz2DP09kR MFKJZhz5xUvuM39HC52p3TvQDl2kpB77k1wnSgaAGYoLOkkkXcbdMcrGXafxQ83zyyI4 8RswxVnCNpOg9QSnJJ9YKS6FaizgQtZlKiRdjx3iqP+8vmL4z/S4bZnr+4ZPLbPI0+v2 SCCEYS+y/7QOi0P83wMJHMZ9JMybHSMGWs2nVqIM075U7GnIgwI3UYDaXoDDsAVOOHNa C5Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o3si4270356ejn.637.2020.11.12.11.27.49; Thu, 12 Nov 2020 11:28:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726812AbgKLTZ0 (ORCPT + 99 others); Thu, 12 Nov 2020 14:25:26 -0500 Received: from netrider.rowland.org ([192.131.102.5]:46225 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727022AbgKLTZZ (ORCPT ); Thu, 12 Nov 2020 14:25:25 -0500 Received: (qmail 288074 invoked by uid 1000); 12 Nov 2020 14:25:24 -0500 Date: Thu, 12 Nov 2020 14:25:24 -0500 From: Alan Stern To: John Boero Cc: Greg Kroah-Hartman , Felipe Balbi , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: core: Null deref in kernel with USB webcams. Message-ID: <20201112192524.GB287229@rowland.harvard.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 06:15:08PM +0000, John Boero wrote: > Then why does line 278 right below it check for NULL? Are you asking about line 278 in drivers/usb/core/usb.c? The statement which says: if (!config) return NULL; This is because it is perfectly valid for config to be NULL at this point. But it is not valid for dev to be NULL. If dev is NULL then there is a bug in the caller. Alan Stern