Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1839688pxb; Mon, 13 Sep 2021 06:41:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNkOKj6yoT39gbRPX1aeVfP+76VZfJNyetBXQEaeu9Ma/2g07Uwlb5m2KSgc9tQMax9N7T X-Received: by 2002:a05:6638:dc8:: with SMTP id m8mr404801jaj.21.1631540504491; Mon, 13 Sep 2021 06:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540504; cv=none; d=google.com; s=arc-20160816; b=AHf0ZhnIWjMJtcynw9mjQGLndYPz2rTwzUV+BitG96K49WsK68+O+UhzuM/lMSpS4E EtCQ/ZzgaRwluOipFLYhBvVLQRSd6jn3TZwt+e9/0g9aLVCsSFgg9lGxvtO9y1RX60yJ 8hgAGXVEL/OAZlCw7Gw1u4/1mRSXKAsH1ZO2BtWoTGf2D8ltrY0Mr8vCoNaVNP33ZLKq fILy5F0OVVh+tODHb1cjpo7EH9OD/FsQbLxqu6OjBH2VH7U7JEUTNHITyDG9YNceYnER WQ9bPJtekSt2zCrzilz3rRjhtvu+P7MpBB7SfPqdnH8+ZbpzwX1VljAHj8XV9NbSJMiG 1zIQ== 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=bvEpGBdFwE9f39zVRcUAWWVwuR5v1MBo1yFWit1ZxP0=; b=M/nIZcvBZPQSPT3SGKCEYPIbeIv/yXp7K6AFxMZSjPl6JmTeI/poKOBYFAQAMWilGM UvibaKNKig7BVocTZqX9yQQiETe8QyyRxZqTtIhO3Dc1BMTlzz2rFwm3Y29GvRKPu2we 9bxI8/0eOCYW3RJzQqnLyIih8l2xT7fMvSFEhoDUQ3MPc2WUjE6qqOb3mM446V3dOnvy F5nK5rv8+rhzAsZE3KF/t1cFmbgS+7rC6h9lTDgM4FWqGPWj5vUyIJ3a31sFpBnD8sVE zk+jaLRTeMyMiGcXDyLXK9nYDwKdYfLlEz3jlYa/TTULO7yPAljL5Q/rvo0i2MfZwyMe 6kLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZiZsfG/O"; 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 v17si6614957ilm.40.2021.09.13.06.41.32; Mon, 13 Sep 2021 06:41:44 -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="ZiZsfG/O"; 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 S243651AbhIMNjs (ORCPT + 99 others); Mon, 13 Sep 2021 09:39:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:35540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243008AbhIMNeq (ORCPT ); Mon, 13 Sep 2021 09:34:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 74C9461159; Mon, 13 Sep 2021 13:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539615; bh=hjQhBHugbas3U+Bwmf2ThCON0nO041MwaWie5WG/8b8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZiZsfG/O+Ht+buOIddJry1S4rFuBwbEVssoamogT/FRfR2IS+Sam19f5h4xN71+jQ E2xgw3vK0j9+lIJXosy9VqZy0zmFo8NsLA1aAw7i3y7iXMVGW8l7qdrTZCpnNyHkNG DS2SpVPR2g3fSPEk4q64uaHto9Quw4LIemcGPch8= 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 5.10 091/236] media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init Date: Mon, 13 Sep 2021 15:13:16 +0200 Message-Id: <20210913131103.450371211@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 e7b290552b66..9c0eb0d40822 100644 --- a/drivers/media/usb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/usb/dvb-usb/nova-t-usb2.c @@ -130,7 +130,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; @@ -139,7 +139,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