Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp657910ybx; Tue, 5 Nov 2019 03:33:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyt/AlRFzgxOR5qewAZGFEWBFrA2cFoDQokZx6p8GgCbFZ3MgdMx7SaPKD36GtTPrCRaooT X-Received: by 2002:a17:906:f191:: with SMTP id gs17mr17172682ejb.207.1572953611840; Tue, 05 Nov 2019 03:33:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572953611; cv=none; d=google.com; s=arc-20160816; b=PQd1nlD+GwyZ+aD0NTH0im4AyzxwHQVPZHBXXvdkhnhgbUxKaLrneVWHc9pzotKbg8 cFAmENXcrGHRdzNchcFs2ajLRI3hl69eqwjy/eYHXctSPukvzjcHLwEr7xXn2ds7ivMf dWLEBwcfKN2ko3HC9qtXwXKe/HtAFc7rY8P4crtid2pACp1Z2Ej1NrDSbyLnm2WOu520 2LgJoawTK9ZavmfMm01OHrUHAcyUGGyRepaZMiZBegeL3aKExupAPNdnvEmhSbcsYASl zleDL5BjYWCIwPdoICyqgVd1TmO7P1eUSkLoRdY4NjOEGnwz4uJUgoB1qnW1nRSvmgsC Ps/Q== 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:date:cc:to:from:subject:message-id; bh=vMnjbuhuHQ51IxTHxmqh5e9sQTAP25EzrtX5/01lZx4=; b=vYxQsk+bMDV8DfgWrhWadWoMCsL0ndjhLe8IZAqfUq0KoQpV8hHhGyP+C3Gysb8nbL pFh2mo7wRo9Wey5cBy6Bkcbz3fsgMgw2iLFMVtc4PDVhcSAgXA+W8aBf8X5/sQfmpT/X lMYVn+W7AQwdJmMTdfBXw/43qBJF8QCsPnikL4KQUuuPuZKAc84X8RA9PuOf3X5JOoVO iPcKyqndRTkkXa/wCFEQYOz4adal3h20mbGbpT9WsEWSaEk/utksob/sjBhuedE5N7oO Sc8CsfBO6T9nEqfpowswdMBYoucnobfMc1vWF0JbyPX8JivWw84IUJ/9YrmGiCvmofN6 vQWg== 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 g7si8964065edg.66.2019.11.05.03.33.07; Tue, 05 Nov 2019 03:33:31 -0800 (PST) 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 S1730909AbfKELbT (ORCPT + 99 others); Tue, 5 Nov 2019 06:31:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:36390 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730645AbfKELbS (ORCPT ); Tue, 5 Nov 2019 06:31:18 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7519BB249; Tue, 5 Nov 2019 11:31:16 +0000 (UTC) Message-ID: <1572952516.2921.6.camel@suse.com> Subject: Re: KMSAN: uninit-value in cdc_ncm_set_dgram_size From: Oliver Neukum To: =?ISO-8859-1?Q?Bj=F8rn?= Mork , syzbot Cc: davem@davemloft.net, glider@google.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com Date: Tue, 05 Nov 2019 12:15:16 +0100 In-Reply-To: <87ftj32v6y.fsf@miraculix.mork.no> References: <00000000000013c4c1059625a655@google.com> <87ftj32v6y.fsf@miraculix.mork.no> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Montag, den 04.11.2019, 22:22 +0100 schrieb Bjørn Mork: > This looks like a false positive to me. max_datagram_size is two bytes > declared as > > __le16 max_datagram_size; > > and the code leading up to the access on drivers/net/usb/cdc_ncm.c:587 > is: > > /* read current mtu value from device */ > err = usbnet_read_cmd(dev, USB_CDC_GET_MAX_DATAGRAM_SIZE, > USB_TYPE_CLASS | USB_DIR_IN | USB_RECIP_INTERFACE, > 0, iface_no, &max_datagram_size, 2); At this point err can be 1. > if (err < 0) { > dev_dbg(&dev->intf->dev, "GET_MAX_DATAGRAM_SIZE failed\n"); > goto out; > } > > if (le16_to_cpu(max_datagram_size) == ctx->max_datagram_size) > > > > AFAICS, there is no way max_datagram_size can be uninitialized here. > usbnet_read_cmd() either read 2 bytes into it or returned an error, No. usbnet_read_cmd() will return the number of bytes transfered up to the number requested or an error. > causing the access to be skipped. Or am I missing something? Yes. You can get half the MTU. We have a similar class of bugs with MAC addresses. Regards Oliver