Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9929286ybi; Wed, 24 Jul 2019 12:30:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOrwzxhMFn0BjpLoE8WHWzHBF/z9ysO6xfGo6bOHJKUcy0QFI09o5dljNAwucuc0XWRoGF X-Received: by 2002:a17:90a:bf03:: with SMTP id c3mr3342920pjs.112.1563996648634; Wed, 24 Jul 2019 12:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996648; cv=none; d=google.com; s=arc-20160816; b=RVa935IrjrxUHyl5/o0g3pL1tx3G5kHR97AwJVL1nwXjWjFWtTRFM7j4STX+mOZaei qhOlsfCqy6V7bxbwCPALTZoTTFmShAKRLvHUy7jCcSnZG05YkOhVyQ0Xo+7ALEPNnw2D b2MPzN7A5hhmRcBJdDN/78rYziZmKZZ1vM0HIzj+O2ykPMuf6l3/XdkXNFYo+2gBASws 4S2jN/3vECsT11KPBm3Sd8oriVQtcEIDq/R5+WFBgJYorm+BSrpKt6wmbI6Jr9Y7X/c4 epMZb2jInDscM1I8cJQS9MUpSiwCHhMwPB6j9/ku/8yTYnhd3K+CX193dxNq6bRPivKD MW6g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g8szJm8MqC4Er+AQo1nJOUr5TO8BMystLIv+uPxFGtI=; b=Pw9rjJATx2IJqE3hHPULTnwd5ztCF299zpFnrs7Qz83R6GY4UFaGp4FkGo7VXpk27S /YC81tpQRQL1WIcZLrsvVvzj17CfTUqpQZe2w9cCZ3fEBKSEYYoG9eL84y0b8y5z1eJb xC8nxj/I9D7Es01qphxAH85VBmcdUN6RyyrG4SkdqpC2vOaSv7YmRagzDAHYd9FsYXv3 Nynm9iX59vD6xARbnSK86dU/ItzCPI9bQYTio2fCFnWNHEYAJGi1Cm/9KzTiUmgs9zn0 AEWJ5JODP/lHEgD2W7h7z60tSP9wySorsF3FUwPE5ulxiOb0xD+RDZWxPz4TI8kStXHZ Gm9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M3j5SkP0; 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 x14si14678154pfn.61.2019.07.24.12.30.33; Wed, 24 Jul 2019 12:30:48 -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=M3j5SkP0; 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 S1728289AbfGXT2n (ORCPT + 99 others); Wed, 24 Jul 2019 15:28:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:47118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728886AbfGXT2k (ORCPT ); Wed, 24 Jul 2019 15:28:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C109218EA; Wed, 24 Jul 2019 19:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996519; bh=AK88lnAWtiOF8BVEKikipS86b/I1pCkr0V2WQxkNltI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3j5SkP0CiowF0KA9GmzRmIGKf/CN5u+h85Nyq4XajUmxWex7FwhU1UrPRjvISCKA AsUvK9JM0thwBVYNUj2N37oQu/4L1z5ghU+XdNp2rK2bcVb5H8xLJl0ZG5DIq34DxA SY9xEyXNGCMpCyt9licxUpzhBBqc7UilIlvNkZjI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , syzbot+2e1ef9188251d9cc7944@syzkaller.appspotmail.com, Laurent Pinchart , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.2 084/413] media: uvcvideo: Fix access to uninitialized fields on probe error Date: Wed, 24 Jul 2019 21:16:15 +0200 Message-Id: <20190724191741.127170543@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 11a087f484bf15ff65f0a9f277aa5a61fd07ed2a ] We need to check whether this work we are canceling actually is initialized. Signed-off-by: Oliver Neukum Reported-by: syzbot+2e1ef9188251d9cc7944@syzkaller.appspotmail.com Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/uvc/uvc_ctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 26163a5bde7d..e399b9fad757 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -2345,7 +2345,9 @@ void uvc_ctrl_cleanup_device(struct uvc_device *dev) struct uvc_entity *entity; unsigned int i; - cancel_work_sync(&dev->async_ctrl.work); + /* Can be uninitialized if we are aborting on probe error. */ + if (dev->async_ctrl.work.func) + cancel_work_sync(&dev->async_ctrl.work); /* Free controls and control mappings for all entities. */ list_for_each_entry(entity, &dev->entities, list) { -- 2.20.1