Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2567342lkm; Mon, 20 Sep 2021 18:54:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTLhN/121cZ2lj8AfvaNbwY8j7xrPbbPdtMVuLOAP/7YOaBpkCqNvfZxb+4TTIAzN7o9MS X-Received: by 2002:a5d:9d59:: with SMTP id k25mr8429595iok.70.1632188942352; Mon, 20 Sep 2021 18:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188942; cv=none; d=google.com; s=arc-20160816; b=LdGs/aftxKR9Mco0NWV8+dMouj+oq5WI1z5RwpGdglH/rvufRTWBaElvfUWpN8DMjC peHoZFwNA7cCZ+s800Z2hn9lw9d9BOkmjqirD4j3hSz40Mbv2UhZfhrdzJDD26BFWkir TvviQWngEZAvNlHUlr8TpvwnyHXjdQKu2d2deQnQRR/Xk2Na2vaLgBOsz91HJcI47oLU x+CuwFVBPQTExmXWPWsHSGtcW3r9CfLnxw3Pr2IbAiGtka8oW4LFvF9QJCrgcg6tRf8Y Ihv/UmgDriUR4TdBi9RjX/8mUcoD1appQfB3/vPQ2tF0gXMnPIAkIBPlhI5nELwT0bEv Dyzg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=wE6da5kg6AC3Q9br+i3J+ZHFrvO+fFe7uCzXIPU3o3U=; b=AmpjVub5q7/ZBevaFXXl5+RbsAS5r9Lo63pidIqEH+14AvD+Xk/6zhKD41LJSFvN4E vHFK3iRZxYP0cfsugZWO8DYoHk5ng6wYFKLAYNqJfCf+z0Qbk9wePSs/TekbIDwJuD/V fXrUlujx/B34PiB1oeHPsM7dhPmlnvb/emYZXo8gc1MjIf+cocuJesCjdJnS8EDlBS8a /OSpjKfoP14eQIge1FL34Fv97dlCf3PKvxnk16/ZFaItVvsdrOXZylEXTdWLMY6pOqZk CQb6IlXFTKZruKQpgbVSAUo0cHu3bCtoUZOYyf8loAJ+RqM7No+FAkDoJsSFQ7akV3oU KDVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xpz3fT4V; 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=pass (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 c6si12177547iln.121.2021.09.20.18.48.46; Mon, 20 Sep 2021 18:49:02 -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=@linuxfoundation.org header.s=korg header.b=Xpz3fT4V; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348376AbhITRi5 (ORCPT + 99 others); Mon, 20 Sep 2021 13:38:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345083AbhITRgt (ORCPT ); Mon, 20 Sep 2021 13:36:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CE1161B29; Mon, 20 Sep 2021 17:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157600; bh=war2w7rgM7oAcaLbc1DzlYdz/A2sVd0l8Tv64Q3aLmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xpz3fT4V2ljW//bmOokTWtfngJCTuv694htZHDSJrVnG7rwuiW+xJeTa3ibp7nnYJ qvATOf2T0VlARjNuC/DHaJamn/Dl0RH0MX4Zl1102vQPAa99Lq4xKlI4w6g87KeTYt npglqBTFAD1BLfbuUixWx0u/xFNuRLP2r+GMffuo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com, Dongliang Mu , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 064/293] media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init Date: Mon, 20 Sep 2021 18:40:26 +0200 Message-Id: <20210920163935.445322307@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongliang Mu [ Upstream commit c5453769f77ce19a5b03f1f49946fd3f8a374009 ] If dibusb_read_eeprom_byte fails, the mac address is not initialized. And nova_t_read_mac_address does not handle this failure, which leads to the uninit-value in dvb_usb_adapter_dvb_init. Fix this by handling the failure of dibusb_read_eeprom_byte. Reported-by: syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com Fixes: 786baecfe78f ("[media] dvb-usb: move it to drivers/media/usb/dvb-usb") Signed-off-by: Dongliang Mu Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/dvb-usb/nova-t-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb/nova-t-usb2.c b/drivers/media/usb/dvb-usb/nova-t-usb2.c index 43e0e0fd715b..705c2901a89e 100644 --- a/drivers/media/usb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/usb/dvb-usb/nova-t-usb2.c @@ -133,7 +133,7 @@ ret: static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6]) { - int i; + int i, ret; u8 b; mac[0] = 0x00; @@ -142,7 +142,9 @@ static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6]) /* this is a complete guess, but works for my box */ for (i = 136; i < 139; i++) { - dibusb_read_eeprom_byte(d,i, &b); + ret = dibusb_read_eeprom_byte(d, i, &b); + if (ret) + return ret; mac[5 - (i - 136)] = b; } -- 2.30.2