Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp756831pxb; Fri, 22 Apr 2022 10:29:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybrGykPhJzuA50QjCWzRis5CT5L/WVusPrLgCAVyU42INtxa58GCGcYbENnmwWxx3GzeqZ X-Received: by 2002:a05:6a02:18b:b0:399:365e:f09c with SMTP id bj11-20020a056a02018b00b00399365ef09cmr4900031pgb.238.1650648567313; Fri, 22 Apr 2022 10:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650648567; cv=none; d=google.com; s=arc-20160816; b=gGj5h7uPHU/h3lo+BixT48CqfUW5ojD2RFUzKp2lKSiVD00DoQwyANCI5rFmZ6+aOk QUg3/mIjxZAfNocupaLr+n0kHtmV+qcufd0lUSAMo/NCkzFOz8iiY7ymzDhegLlAaSQp 9y0xSRhFuqh8LWE2fVXki5OdVHnAe0sgQl+wFQnwjsD6rBZl+VGrDdkROItfNFfAPjyG 9lqLWAnY4Mjl+5n8HfZLpZY58QUCOx9gp9WJjXMTTgLraKNq3M1UzQSFtwEok08c/zfn 0JB2A457FRvvE1xO0eUXZ1frF7MdGK3HikSuOw7manW5g37c1JnLyrKMUVOyMDKE8a/l YVVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=4adwg8hqyIITyJy5pTSFAx9A6BPYS26atLWx7A9LjPk=; b=ACi15iA8957XSm95j/Z3Jy2DPVY0m3XmU5sgj31FzBCnYzJeceHnAJ9aqqx5nimm9l EgDXOD4ByZVgJSfxHIqmaQf1H47uxHXA7KvT8xCQIK/ILNl4wovb7ZZp8JbnNKvGLbRK XIICJb4cY5FbuLoRcYijE0xFkYUWMcTir+K1ZTZrgIyHlcXl308iD0uF0nixcVYfXprX +WbcVQ+R/mOrF+MG9NUHEu/gNyMwt6jLlsniUJujVuPapyPEwBZNNkNEZ386RmCB+ToU Y6KyyyOyr9/BZidXNKM1JfGmCGUoMdHVIcCApbnawQNM7k9TlFPgyzxuw5iB6PEn59K/ M6rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HAfNlYPB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 84-20020a630257000000b003aa3f26f49csi8932364pgc.794.2022.04.22.10.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:29:27 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HAfNlYPB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A86B1C9B55; Fri, 22 Apr 2022 10:22:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352799AbiDSNtJ (ORCPT + 99 others); Tue, 19 Apr 2022 09:49:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352818AbiDSNrJ (ORCPT ); Tue, 19 Apr 2022 09:47:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E251C393F8 for ; Tue, 19 Apr 2022 06:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650375712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4adwg8hqyIITyJy5pTSFAx9A6BPYS26atLWx7A9LjPk=; b=HAfNlYPBJVU1n11d39HCAlDOdOwoQY2cFUuTOPPHjrBONyn2++PVLrGizvV4CL7yeBUcYM 2LPcWyirKwnY3VnqVO4rfgz3YamsXJ3UTGyCCWbiEwqYnL5AvqEcVYA58KyRR+2gGRTs19 5+ry1N/5B7KsYePsWizphCWJB1vdlpY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-flcKIT3CPwmra1Qpkovq4g-1; Tue, 19 Apr 2022 09:41:51 -0400 X-MC-Unique: flcKIT3CPwmra1Qpkovq4g-1 Received: by mail-wm1-f69.google.com with SMTP id bh11-20020a05600c3d0b00b003928fe7ba07so1241851wmb.6 for ; Tue, 19 Apr 2022 06:41:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=4adwg8hqyIITyJy5pTSFAx9A6BPYS26atLWx7A9LjPk=; b=4glhh5R21YPxxQR3PoR04QfBhHG/EONXJwLDWnHVsUaCmWxkjboRLnLHlDsWDqHpRD sK5lNPw25BHg/f92wrgZEhULL9bBTi3+JBah7s+55iIUV4FTmeo+WnCm/WqAWzrsV16b bMV5AsdGwaF5O4xYMjQC8y3gcSRK2DGM6lE2BuLgh+de1ehCxBZ+qs/0wP32GyD+Rg+V N4wc7ZxBro3bum/96O15WgipIkWvnSoE14lKkTu0snI51cIU+h2szNoI8rQodJdIQBbV lgpiolRNZl2FBoxCQX/DxO9xdaTStbiyag0IvUWFI08UXVv1ro68bxI4kYHtgHrzK/PP Rp5g== X-Gm-Message-State: AOAM530AY6ZQaU7LNnspz8O34hG29W8wCGYGzB4KawAQWj60qTrwYcOK 0AY0rZ76HG3hl71ZpnC5qniPNAe6xCIQ2RScrN8DV8rddDX6I8aTunljCGsetJOOU+V3lj1qXjV OJcTXbTFLjyR07rx510uoLRo0 X-Received: by 2002:a05:600c:1c1f:b0:38e:c425:5b1a with SMTP id j31-20020a05600c1c1f00b0038ec4255b1amr16136726wms.69.1650375706941; Tue, 19 Apr 2022 06:41:46 -0700 (PDT) X-Received: by 2002:a05:600c:1c1f:b0:38e:c425:5b1a with SMTP id j31-20020a05600c1c1f00b0038ec4255b1amr16136712wms.69.1650375706746; Tue, 19 Apr 2022 06:41:46 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-96-237.dyn.eolo.it. [146.241.96.237]) by smtp.gmail.com with ESMTPSA id i27-20020a1c541b000000b003928e866d32sm9069716wmb.37.2022.04.19.06.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 06:41:46 -0700 (PDT) Message-ID: Subject: Re: [PATCH] net: ax88179: add proper error handling of usb read errors From: Paolo Abeni To: David Kahurani , netdev@vger.kernel.org Cc: syzbot+d3dbdf31fbe9d8f5f311@syzkaller.appspotmail.com, davem@davemloft.net, jgg@ziepe.ca, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, phil@philpotter.co.uk, syzkaller-bugs@googlegroups.com, arnd@arndb.de, dan.carpenter@oracle.com Date: Tue, 19 Apr 2022 15:41:45 +0200 In-Reply-To: <20220416074817.571160-1-k.kahurani@gmail.com> References: <20220416074817.571160-1-k.kahurani@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2022-04-16 at 10:48 +0300, David Kahurani wrote: > Reads that are lesser than the requested size lead to uninit-value bugs. > In this particular case a variable which was supposed to be initialized > after a read is left uninitialized after a partial read. > > Qualify such reads as errors and handle them correctly and while at it > convert the reader functions to return zero on success for easier error > handling. > > Fixes: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to > gigabit ethernet adapter driver") In the next version, please additionally fix the above tag: it must use a single line, even if that means exceeding the 72 chars length limit. Thanks! Paolo