Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1534640ybl; Thu, 22 Aug 2019 16:36:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk90r3hpZn4JrYDXaIvmXR63LrUlafXEaOiDAgrGWyBmjQPPixOGbUvqCnTIUIgpSLsYAo X-Received: by 2002:a17:90a:5887:: with SMTP id j7mr2233003pji.136.1566517016376; Thu, 22 Aug 2019 16:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566517016; cv=none; d=google.com; s=arc-20160816; b=O4yPjGEkF8+57ZRHmJs8q/GYtthFOqxeZcyJmU5g5ygpwk2M9g94nv3QIRya3YnWkt ZPMYg+8J2U34skcsxOELUJMn8HdFQX4pQBztgogBSppKkmjYF48Pkz5CYJbR4KrPvWVV mlHeqmtKmX7fT+JaHA0phvAaDHwsmUV+dyP25JTkaabYRrHMXHAJIwQsVZLyLs+OtKIl s+h4xw4B/E6S/vQtZ/fsxANoHJ44Xm6tbEnYeb+ZtZSRPmmPfjaw4nm/zfRrqd1bimLq gaHLz5zuvFUU3I3VUn+/2aQgu8ddzAij3bQaCQblINIUE/8IGythNk1RfQTNrckZThRT lBFw== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=Qz0KSVyNyJnj+G8GuW2kIZKx9cgzbXwRXZ4XyF75reQ=; b=MyjGHiBuHqvE3DbxwepMTF6K0LiBXzJtk99MHxd/nX+PGjkQ2LBFC2HdVmhqibXcaf 9xgForrefZ50TjoSLCXtmhcLgTN54Qixt945ZlX9Ud7xo7ZZwrjWFG8WwYtQ5w2t0bQz rgJ3YuoXqE/ez/HUnwusdoAupKyZt1Omqe+H7KC3hlOjFytRot3HAC0X7yh/BNoMzGSJ 1z4C1Z67ogU+B3LI6A8CoqP3pKvH6O0Gf7OCNq3SQWftHz7jfc7ycLGCy2e7nWKz7mSd /eVvQuX7LRUOPsum/NCFDcaiZFF8Y58N9bNiY4IleglHsgc8aIiDvOAAK25MokM2VZIH rTuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tLGwZooT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u11si764853plr.431.2019.08.22.16.36.35; Thu, 22 Aug 2019 16:36:56 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=tLGwZooT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391262AbfHVRRE (ORCPT + 99 others); Thu, 22 Aug 2019 13:17:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390361AbfHVRIb (ORCPT ); Thu, 22 Aug 2019 13:08:31 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF112233FC; Thu, 22 Aug 2019 17:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493710; bh=QK85sgzqt77uYmmnnf7QigCZMyphAJAAnG+jNPOGMkc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tLGwZooTSQlgq0/7idiw3RmLNppNVuORuRjyD692JACW9lrUs5A0KpltkZ3iM2Q3b hnVsCyC8DvQGM5rP0v15hktCTc0F+IFPXo4zmW0SYvTw34AMNyEBaTc3h/au7DPPgR oZbYhoY7F5QrO3zN/NUAINEkwOezi742zpf06GUU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Denis Kirjanov , syzbot+3499a83b2d062ae409d4@syzkaller.appspotmail.com, "David S . Miller" , Greg Kroah-Hartman Subject: [PATCH 5.2 029/135] net: usb: pegasus: fix improper read if get_registers() fail Date: Thu, 22 Aug 2019 13:06:25 -0400 Message-Id: <20190822170811.13303-30-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Denis Kirjanov commit 224c04973db1125fcebefffd86115f99f50f8277 upstream. get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae409d4@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/pegasus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 6d25dea5ad4b2..f7d117d80cfbb 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -282,7 +282,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int val) static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata) { int i; - __u8 tmp; + __u8 tmp = 0; __le16 retdatai; int ret; -- 2.20.1