Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp53978pxy; Wed, 21 Apr 2021 18:17:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHyhBZ3gIwM/jML60GqzVjbAAiMo2GlATHOF0a/YkShVmESGNU/ZKQQOekjACbRUilu4Oa X-Received: by 2002:a63:d153:: with SMTP id c19mr915879pgj.311.1619054254471; Wed, 21 Apr 2021 18:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619054254; cv=none; d=google.com; s=arc-20160816; b=CRSsFG4bLR2GcH9huSbASTbIQG2b9DOGBqxsWnW7EaYLVTPcJ+Bw1wu1NpBhPRBgg8 UqcAfdknKiHwLJOOJKqcMJRHihKles/ZCpcZ/FoUPCFSAQhCAxTtpM6/d16SwzjAuzLz eKFph58kbjTSVQh0aXkRQ6CGk9RJA6GorwnJ+ti4mXbFA+C0vlInq7GmlG4B0bY0NIin 4AhhZ5wGV+DRzG7rwd5MBFB6J4ZXekNz/1IMRnrsUtbePKDa+h7KwpZDQ3H+0jB4yOCB e3xbRuDb13PjVB0xUCQqUTJettmHvrwoBrLUGqZ6OM3zwx4Fr8Vxl1a2Ce4tluTdTkMW jbgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=+D3UYu8TLNlY+0zw6W0vyjpmmNkD7r00jz2yYiUrd+k=; b=oHKpmKZwg5qdEEdzjbS/M5dP2xo8tIrCfMc5VkHuWBhX2JiJuUSvQCtvxLF6u1tKVe kFvIOx+GUDwPeFQyhtwzT9fjqYlz+cB2zfSSPQEjR88S/U4K94GbZ6L/hMCIhI0pZeJQ 9zBZ93BclUhaUNRoBnJwW954cQs32jbXP4va7NAAxuM3BIlLJcVEzFeyhxyafhJi3LZc 7y6PoW0Q0UOFr1FsvizPJ/WWwbqwJ1q6O4Bfj+c5KYsHYB1XYOKKYMxK2t0faG3K/ySy mjrfSmIhpsh6CBPjXDsoRZkX5CNojZN79jjCCjtv7iUkKVl4X0iOViM50joSep3c+Rm8 tTNg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si1274851pfr.234.2021.04.21.18.17.22; Wed, 21 Apr 2021 18:17:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245187AbhDUSUa (ORCPT + 99 others); Wed, 21 Apr 2021 14:20:30 -0400 Received: from netrider.rowland.org ([192.131.102.5]:46249 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S242578AbhDUSU2 (ORCPT ); Wed, 21 Apr 2021 14:20:28 -0400 Received: (qmail 217821 invoked by uid 1000); 21 Apr 2021 14:19:54 -0400 Date: Wed, 21 Apr 2021 14:19:54 -0400 From: Alan Stern To: Hans Verkuil , syzbot Cc: gregkh@linuxfoundation.org, johan@kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-media@vger.kernel.org, mathias.nyman@linux.intel.com, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] memory leak in usb_set_configuration (2) Message-ID: <20210421181954.GB216484@rowland.harvard.edu> References: <0000000000001ad5d605c07cfd2e@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0000000000001ad5d605c07cfd2e@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 21, 2021 at 08:12:18AM -0700, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 9cdbf646 Merge tag 'io_uring-5.12-2021-04-16' of git://git.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=136ce5a6d00000 > kernel config: https://syzkaller.appspot.com/x/.config?x=fd35e661e44323ea > dashboard link: https://syzkaller.appspot.com/bug?extid=d1e69c888f0d3866ead4 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16ecba29d00000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=143cf955d00000 > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+d1e69c888f0d3866ead4@syzkaller.appspotmail.com > > BUG: memory leak > unreferenced object 0xffff8881120e1400 (size 1024): > comm "kworker/0:2", pid 3660, jiffies 4294952380 (age 24.950s) > hex dump (first 32 bytes): > c8 78 3c 12 81 88 ff ff c8 78 3c 12 81 88 ff ff .x<......x<..... > 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [] kmalloc include/linux/slab.h:554 [inline] > [] kzalloc include/linux/slab.h:684 [inline] > [] usb_set_configuration+0x187/0xb90 drivers/usb/core/message.c:1992 > [] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238 > [] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293 > [] really_probe+0x159/0x4a0 drivers/base/dd.c:559 > [] driver_probe_device+0x84/0x100 drivers/base/dd.c:745 > [] __device_attach_driver+0xee/0x110 drivers/base/dd.c:851 > [] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431 > [] __device_attach+0x122/0x250 drivers/base/dd.c:919 > [] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491 > [] device_add+0x5d5/0xc40 drivers/base/core.c:3242 > [] usb_new_device.cold+0x16a/0x582 drivers/usb/core/hub.c:2555 > [] hub_port_connect drivers/usb/core/hub.c:5223 [inline] > [] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] > [] port_event drivers/usb/core/hub.c:5509 [inline] > [] hub_event+0x142e/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 > > BUG: memory leak > unreferenced object 0xffff888110a217a0 (size 32): > comm "kworker/0:2", pid 3660, jiffies 4294952380 (age 24.950s) > hex dump (first 32 bytes): > 31 2d 31 3a 30 2e 32 34 31 00 00 00 00 00 00 00 1-1:0.241....... > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [] kvasprintf+0x6c/0xf0 lib/kasprintf.c:25 > [] kvasprintf_const+0x58/0x110 lib/kasprintf.c:49 > [] kobject_set_name_vargs+0x3b/0xe0 lib/kobject.c:289 > [] dev_set_name+0x63/0x90 drivers/base/core.c:3028 > [] usb_set_configuration+0x6b9/0xb90 drivers/usb/core/message.c:2099 > [] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238 > [] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293 > [] really_probe+0x159/0x4a0 drivers/base/dd.c:559 > [] driver_probe_device+0x84/0x100 drivers/base/dd.c:745 > [] __device_attach_driver+0xee/0x110 drivers/base/dd.c:851 > [] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431 > [] __device_attach+0x122/0x250 drivers/base/dd.c:919 > [] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491 > [] device_add+0x5d5/0xc40 drivers/base/core.c:3242 > [] usb_new_device.cold+0x16a/0x582 drivers/usb/core/hub.c:2555 > [] hub_port_connect drivers/usb/core/hub.c:5223 [inline] > [] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] > [] port_event drivers/usb/core/hub.c:5509 [inline] > [] hub_event+0x142e/0x20c0 drivers/usb/core/hub.c:5591 This looks like a job for the linux-media people. The CPiA2 driver in drivers/media/usb/cpia2 calls v4l2_device_register() from within cpia2_init_camera_struct() in the probe routine, but doesn't call v4l2_device_unregister() on any of the probe failure paths. Alan Stern