Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2724476pxj; Mon, 31 May 2021 09:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTBQW0PBhVVZ4MHptlSjZkeQPlvESg9puNVzHeUFG+cX6G17Hze9doeXX/xvbhJwKY2QIq X-Received: by 2002:a5e:8c11:: with SMTP id n17mr17332273ioj.53.1622477360332; Mon, 31 May 2021 09:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622477360; cv=none; d=google.com; s=arc-20160816; b=k4uoC0RL3GXF62meqZQG67VwwoRSUi08V1/vbg9c7m0r3ldpcUcZeBzLFwaK+LAJ1K xGDh+xHX8iVdwseZASSa8hozjvJb+yM07/a+vKhzWmDYVUIo2qmsdPaonRNMaJqh2RIt qF3dGSeZMp0uTOLCjv3B4Yg/ADDnUqzD6cnRfGxXt/aVDldipbBcVArlGpQq0MrztkmO amGywHWEwagzPGLSCDFvYoCM1/gI5A0kBlDdwxRtRP3RtKTpQn59+4vGShdVbfKdSi1r UNX0K2S9DhDWeWuzX7NvBwIKwtMxlHlwHz8cMmd78c2CAxPdC+T3Vvng/0cvcUozxNZ0 pGOQ== 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=g7KkZvaNfsayHsSh2BCdsWGrfvAYPIFYB4MlNTwIiSQ=; b=WR5hKF/LvqdvoUrFjRsN/r5zS3uXLR1awSaxcp3VXrbObXrLQQJJaq8TqUXdGc7IVc VkPXc8bneO4gXcPLQ4A5O/WanXSDIB133dfbV1wDFdC1CjjEQSx5QAfnKTEsy2uIixM1 dZ5XJ7TYX3ps5MtGc+CC5lppn1WW+gxRtBRNnGfRhO3Cu356osfmJGS647usM+b9AnOK n+vej7Jruh2MUxG2XV/aizk4L88fww+qE4uoC6pDt4dQS5jCJzDv7RsUP8V9k+3V/pBg n2xeKYMRu2xILJC2q+yGGgFUL6Jkya7JrxgezlSJyZrInsXCxEl3312qMPqqgkF5Bdrt 8/vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0aoJGUMX; 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 k10si14070988iow.62.2021.05.31.09.09.06; Mon, 31 May 2021 09:09:20 -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=0aoJGUMX; 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 S234023AbhEaQJe (ORCPT + 99 others); Mon, 31 May 2021 12:09:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:60912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233412AbhEaOhT (ORCPT ); Mon, 31 May 2021 10:37:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7CDED616EA; Mon, 31 May 2021 13:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469092; bh=SLvqaojeofwp8GZw65DhfTi37SwMU3e5Yhve4mFHEco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0aoJGUMXskw/SpsnVslbphjHBwqf+41u+ytoowVNKs0rCbqLkQxg3o19ZL3sJnuP5 lo9zU+bG1GhZyy8OE4kL+gJ3Gq2giKGj9zukNcAvDirNy7OrbXgjAoswNu0IxGnPYH 2XzakU95zL1JsnyWGFPYLmwlMQwkUdWij4ld1PFE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+636c58f40a86b4a879e7@syzkaller.appspotmail.com, Dongliang Mu Subject: [PATCH 5.12 067/296] misc/uss720: fix memory leak in uss720_probe Date: Mon, 31 May 2021 15:12:02 +0200 Message-Id: <20210531130706.097305789@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 commit dcb4b8ad6a448532d8b681b5d1a7036210b622de upstream. uss720_probe forgets to decrease the refcount of usbdev in uss720_probe. Fix this by decreasing the refcount of usbdev by usb_put_dev. BUG: memory leak unreferenced object 0xffff888101113800 (size 2048): comm "kworker/0:1", pid 7, jiffies 4294956777 (age 28.870s) hex dump (first 32 bytes): ff ff ff ff 31 00 00 00 00 00 00 00 00 00 00 00 ....1........... 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 ................ backtrace: [] kmalloc include/linux/slab.h:554 [inline] [] kzalloc include/linux/slab.h:684 [inline] [] usb_alloc_dev+0x32/0x450 drivers/usb/core/usb.c:582 [] hub_port_connect drivers/usb/core/hub.c:5129 [inline] [] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] [] port_event drivers/usb/core/hub.c:5509 [inline] [] hub_event+0x1171/0x20c0 drivers/usb/core/hub.c:5591 [] process_one_work+0x2c9/0x600 kernel/workqueue.c:2275 [] worker_thread+0x59/0x5d0 kernel/workqueue.c:2421 [] kthread+0x178/0x1b0 kernel/kthread.c:292 [] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Fixes: 0f36163d3abe ("[PATCH] usb: fix uss720 schedule with interrupts off") Cc: stable Reported-by: syzbot+636c58f40a86b4a879e7@syzkaller.appspotmail.com Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20210514124348.6587-1-mudongliangabcd@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/uss720.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -736,6 +736,7 @@ static int uss720_probe(struct usb_inter parport_announce_port(pp); usb_set_intfdata(intf, pp); + usb_put_dev(usbdev); return 0; probe_abort: