Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2949807pxa; Tue, 25 Aug 2020 07:41:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiEPIY2Tl55coI7ffzk5Fy1XHrMsk1hDCLcrTt8F4WsQ0/z7GkaHYzsyTdI9g7XrvxZ5KP X-Received: by 2002:a17:906:2cc2:: with SMTP id r2mr10742610ejr.482.1598366475920; Tue, 25 Aug 2020 07:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598366475; cv=none; d=google.com; s=arc-20160816; b=ERnuSS5qy4kizG2EdYGTpokISSHpDSaV3fmpw8xpZSqTaGiKuFZqHHSbU9yNd8phao qyB1cT/kdNZxBHY8IZ2pUChPuFBI736PnC1QtusYrZjWbrKp26gN874XMZbNlOnfmUIY bjGFqfY+UkKLCCOS+uLcv4IglC+luRoE7Q4JCddLo2zTWGdR2tJ/WWlzud1XrzfuqW2U 3pAzJt01qxid+mNCj1WhP3wSzoPZ3Y4Vk3loAFVhYtvhb1CtuFxFLA+LAGVjwOdwq/fh nwt/2VheTByrogYo23PoBYHMUI+xEyZmwbucCtcAlxt7NpBXfMPJevQ5wMYze2w4nESg Xplg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Jub16Ku/cchvMtFlQS31KMpzXA5kqxsuU9+uXAaO4EM=; b=GTyBVB+4C7FhkBfX9uTf41hPne8dvZZmv/1TeEXGm6LSEm9B9iM0RhdB4/WG7/iD4y p6ZOqIKLaPaSEYjJXjsInyc4/efuFgszt0/zK3GfIp6SBZt0lfno2UM3a1Y3H4ujiyEf dhy3DxcL/pdlcjI3b+Ha77Gaf6z6u1BCbYVH0S02h6SPTKJGpKpBj9O4vChsnN/BY/Bt aq+/QaoBLDbyWebxV7xiiWfop+Iw/ZrL1aCXxfIJffQmuonm2eV57a2Eg1sjtbbsMl4q BVHUi1ePdStM0kdCIo2hN39JipR/HBCEEqRX4qdZ+xv9E8H7V5jQIOGPqfvjF3IN87PZ rooQ== 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 qc14si9495216ejb.714.2020.08.25.07.40.52; Tue, 25 Aug 2020 07:41:15 -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; 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 S1726513AbgHYOju (ORCPT + 99 others); Tue, 25 Aug 2020 10:39:50 -0400 Received: from netrider.rowland.org ([192.131.102.5]:52555 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726186AbgHYOjr (ORCPT ); Tue, 25 Aug 2020 10:39:47 -0400 Received: (qmail 367187 invoked by uid 1000); 25 Aug 2020 10:39:46 -0400 Date: Tue, 25 Aug 2020 10:39:46 -0400 From: Alan Stern To: Greg Kroah-Hartman 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: <20200825143946.GA365901@rowland.harvard.edu> References: <20200823082042.20816-1-himadrispandya@gmail.com> <20200823101924.GA3078429@kroah.com> <20200823105808.GB87391@kroah.com> <20200825065135.GA1316856@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825065135.GA1316856@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 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. Alan Stern