Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2318838pxb; Mon, 20 Sep 2021 18:41:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGwz9sbC7Wo72HkQvaJjEHvxH/qQ9yRaX87nGqxj7Blo7m6bCTc0W7tFFKBeL5UleRiSj9 X-Received: by 2002:a05:6638:2726:: with SMTP id m38mr13651693jav.6.1632188482150; Mon, 20 Sep 2021 18:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188482; cv=none; d=google.com; s=arc-20160816; b=RDFUW0OO4J62vxykhAfnTCl9m0KuEhsInrOMQeaFS5Tnlf6ZLbCHA4SPrjA2XcxPHn iwqzF96p68b/uM7xahSVGD5B12HzIj71l+RIIrQMhapCJLc1IvbJ7KRv9i0ui0RGT2Vn AHvHyjatdegZVVZygvWaC+yum0qeghzuyiBwUd6NZNpU19C9kRwM1HMjWCvArq4OlraC PyVfGaN+TtuvrGhudlJKu/olVjdxP8elKHiJrZdXzqGyywH1cpKUN6hph8qdUBBEkVI+ d4jKbloAdlcuEmLaiLYJjppkXOVIp0Y8x54pHLiF1WX4L/nj0CgLB7XLmUynfRy/RHsL Bqrg== 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=u26U8JZzIBPdz4vomErkt7oArkf1sAhS+DHI9kqJ/Lk=; b=vkMMqUJOiviP7QtkR4Ku1Cina0ZQhPNFp7HN2wB+XrX/LqrqIa+98Zwm+jwd546Xli t0HISkWWmNRnkybdK4vyl3SJldxsHWAbUBEJC5uxKVBdAM/dQb5yfI+tfFXXAg3PJTiQ iZricMoWm7OiBsw7IA2WCoezArfp2EB+7fHKXtyX+tnU/0XWW2uH/Njvw4/AX4DXRnz2 PLRHrTawcDdg5lJp0kXQ1tg0jbE7w4U/V4svi+fZTN6ryPQh59pVGFO7SHkYsSRCA1Sy pX0rwRmmPY4hnz6Jj6/CbjeFbeWaVodPi0Nwcjoq3hu9Cc7FXtn9c+xcv7Ld7AVbrcJ6 13Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K9O6pbkd; 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 b97si14760832jai.49.2021.09.20.18.41.11; Mon, 20 Sep 2021 18:41:22 -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=K9O6pbkd; 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 S243453AbhITQsj (ORCPT + 99 others); Mon, 20 Sep 2021 12:48:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:36476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243500AbhITQr6 (ORCPT ); Mon, 20 Sep 2021 12:47:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB5E261213; Mon, 20 Sep 2021 16:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156391; bh=FRJN1kVuMA+DU2b6XUb3iI4PPD27xsc9yWkNzhhfxjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K9O6pbkdYk+9vuzZPtC5ZGvS/ARlPwnaU0i9q1X9nMIIHjE5ByWfrtDvR+BODlteE nqRUObk3IOW9JgRXBRUNuaMBpnEky4y/IruAKe+qONu+ANHKXGe9cHXwP6888g9gvT tM7puwMCY7+nK9T3hM/LxAhmEHlrOQ9zniOu6XoY= 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.4 038/133] media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init Date: Mon, 20 Sep 2021 18:41:56 +0200 Message-Id: <20210920163913.887114722@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 6c55384e2fca..c570c4af64f3 100644 --- a/drivers/media/usb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/usb/dvb-usb/nova-t-usb2.c @@ -122,7 +122,7 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 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; @@ -131,7 +131,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