Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2952640pxa; Tue, 25 Aug 2020 07:45:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIGnurKyr1SHjCebLkoKZGMl53Ugu1aA852h2ph7M881isd//7uQi9dSyawBIdc3QvqVX4 X-Received: by 2002:a17:907:20ae:: with SMTP id pw14mr10657302ejb.153.1598366734105; Tue, 25 Aug 2020 07:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598366734; cv=none; d=google.com; s=arc-20160816; b=yXAKa5/iNulMQiL282vJy40niz4eY+pKQd+tHBslQoAgRd485oNLB+cf9Q4zkZZyLA u/UIcUz3fFd7lEYvl7sRvu7JmWVMATILbLdMpORR7PWSq607FP6qqXG3BgHdyfol4wz8 Z2phaVv4bTaKyruo1YRUD0pPR82Cgu4rTDtodgXETx4+I+FKRHESFXS71aRGZOrmX8CW Sjin35/pGJhWHzpcHVfOP1wbE8L2NZPO+K+ioYc19TRYEYLsMp8Y7PpP1Aq8pkAd5lwP ZIANyzAMKdHm2+9FasHF2xT8FvfMCjaycWK7YTusIglS1JHSQIgbpOV+IFqPm14KIESZ xv8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZgO/Irt50Chw+83ZpHAr6hZekw45dgFbNn7ThYRsVOw=; b=p+ZD5MZB6vv4icvy3TOTNbojwjZzHIIxzHKi4WwPXUZt5+0bamPhS8BQlr+tltO54u HOpu/FA3H0D7YFoZgsC3+JJpIxtIIIUjeMeuMSxn0vAvpsWm6CXdE39okUJWp8j5mKOU FCF/S6vRdtte8ntr5XzHLgSTtkMLcEtO/bfj5cyE+KC81Oi2SGndqzXqP+r4JxoGpFP4 2TsIYhSMT2I0gjoaubFkJSSLjobGIPmVqKgb5YPHfqx3N/r52GItHDS9eDMlvy4Q+B1j 2dr+JHqY78lRin7XhaMxpJOxTXZNUdppd1OqeoEd4zkPYCUMF4FurZnKSSx2NcmG9BgM efyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MVfNwM2x; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mv6si2754175ejb.698.2020.08.25.07.45.11; Tue, 25 Aug 2020 07:45:34 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=MVfNwM2x; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbgHYOoX (ORCPT + 99 others); Tue, 25 Aug 2020 10:44:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:55986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgHYOoW (ORCPT ); Tue, 25 Aug 2020 10:44:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4264820578; Tue, 25 Aug 2020 14:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598366661; bh=H4ZjIEM1FoCEKtZPFYTxt0y4DJtVqeusqC+bdNjG5Gw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MVfNwM2xGfolB0ytEUD3umzKOJXUzM3sBZS523JV7zuqDlg0+rDnIVKRh3e5nGhnU R/lDxscVLLMMygvwAO8Tf1+7GcZ+zL3BpmiU4hlppToOx0q22P79AzMZjRe8cqNtB2 D/IoM4cZLKEnUQIOYHIoBuw2b5VEISrn6Y35sEYg= Date: Tue, 25 Aug 2020 16:44:37 +0200 From: Greg Kroah-Hartman To: Alan Stern Cc: Dmitry Vyukov , Himadri Pandya , David Miller , Jakub Kicinski , linux-kernel-mentees@lists.linuxfoundation.org, USB list , netdev , LKML , syzkaller-bugs Subject: Re: [PATCH] net: usb: Fix uninit-was-stored issue in asix_read_cmd() Message-ID: <20200825144437.GA1484901@kroah.com> References: <20200823082042.20816-1-himadrispandya@gmail.com> <20200823101924.GA3078429@kroah.com> <20200823105808.GB87391@kroah.com> <20200825065135.GA1316856@kroah.com> <20200825143946.GA365901@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825143946.GA365901@rowland.harvard.edu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 10:39:46AM -0400, Alan Stern wrote: > On Tue, Aug 25, 2020 at 08:51:35AM +0200, Greg Kroah-Hartman wrote: > > At first glance, I think this can all be cleaned up, but it will take a > > bit of tree-wide work. I agree, we need a "read this message and error > > if the whole thing is not there", as well as a "send this message and > > error if the whole thing was not sent", and also a way to handle > > stack-provided data, which seems to be the primary reason subsystems > > wrap this call (they want to make it easier on their drivers to use it.) > > > > Let me think about this in more detail, but maybe something like: > > usb_control_msg_read() > > usb_control_msg_send() > > is a good first step (as the caller knows this) and stack provided data > > would be allowed, and it would return an error if the whole message was > > not read/sent properly. That way we can start converting everything > > over to a sane, and checkable, api and remove a bunch of wrapper > > functions as well. > > Suggestion: _read and _send are not a natural pair. Consider instead > _read and _write. _recv and _send don't feel right either, because it > both cases the host sends the control message -- the difference lies > in who sends the data. Yes, naming is hard :) usb_control_read_msg() usb_control_write_msg() feels good to me, let me try this out and see if it actually makes sense to do this on a few in-usb-core files and various drivers... thanks, greg k-h