Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1611596pxp; Sat, 12 Mar 2022 15:54:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLCc23FRC571mDm770X8y8hQ7KMF5o9Xp77wmmxTGkjxMlxAZdu1eB5ywyMKh/GolKu3jd X-Received: by 2002:a17:90a:4214:b0:1bf:6ae9:f62a with SMTP id o20-20020a17090a421400b001bf6ae9f62amr28394990pjg.64.1647129271998; Sat, 12 Mar 2022 15:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647129271; cv=none; d=google.com; s=arc-20160816; b=U/b7Wn9TrSJ3YAxZo8lEKO9VY/L0bfRqFXdTLex0vrwdwPOsstik7nUxO+A8f4WvuN IKQgfY26HNCHWTBCb9C2aQhkR33inZ710zqhQTbfsOwBQeoJmg6RjJcE+/kDdd8gyg/N j56B2WAoEA14QOjx08i2jGIH4rTp/l01qKI5Xw5pcAghq7hafg8e7lfR3DrTNKQHeR95 TiqFfnx3Lhf8Y00l1PIx4U7TM8xf5AVrYEjD/jrChRIgObk1Lzf1oK50l2D/p1zCVSQe cvYc893tGxrg7s0UqeF89LaZgpT0uMHNvjOiw5ppyQvJXamYM3ddFSfWyR0bnzN2H9HT wEWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=RMVbKUWJoamB63L91lhDISjUh7OaK8vRX+H8kEUqYOE=; b=vj9KSjiSRPE73WsgIzkngkbWgHic1EVYhF50Dqn1IkwKxsyCcloYPPj0ulj65yKEht oDnARJ3uUB760EN09Muepe8fSWW2t1nnAx4I29v57vHsiuPY2acazfSpV4Oj5Q0bA8WK /FX3hTe/xD2gs/Qot+rnxNuQ/Jkw5PgsLJ3RSijZ5JETQKoIHqpnm7QxP0AbWlfXV+JU AsGuiuWYia+OGC01Ln4no6zVUPD32deUrz/vmQmCQvvckmRZ+A/6W56+Tv2XsYmO0Bwh 11Ua+hRPecEDwXBSpa21t1TfIGTSMn2X8CP4pdV3htzqY5/lJF1bSAooYbrB/UsIIQXK ls5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EjkTLmpA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a17090aec0400b001bd14e0309dsi7968906pjy.117.2022.03.12.15.54.18; Sat, 12 Mar 2022 15:54:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EjkTLmpA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231392AbiCLPJa (ORCPT + 99 others); Sat, 12 Mar 2022 10:09:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbiCLPJ2 (ORCPT ); Sat, 12 Mar 2022 10:09:28 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F0C03E0DF; Sat, 12 Mar 2022 07:08:21 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id 25so15906609ljv.10; Sat, 12 Mar 2022 07:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=RMVbKUWJoamB63L91lhDISjUh7OaK8vRX+H8kEUqYOE=; b=EjkTLmpAHX67yQM2n/+sUQihO7Fulp+NNSqyOGypiVqBU/dAfqzJF3yz8HT6KR1MbM GbENIMt439W67jP7Ntb+BkGHnMo9kayaET6+DFIFeSGDqY0a4X6X2e64Iz21lINOcd5W PyShUvDMFe0NgQlxbgDEu0llHvdFFxtK+T8M5sI7KEsihHIXPMNXNY0w6KP9XFNTsEYy Aa9TAVhg3KWM3Fp8DkirQ2DoWkiGeKG3GRaLAtTIQvEmpoWnHrjkL5oA81tawkZFv6xY xoaRDfEy0TUl4dJ/cLNgCaMc38U83SJpd58Xlc6c9+agu8xlCfgUxURP1im6jmjhpcUN 1fuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=RMVbKUWJoamB63L91lhDISjUh7OaK8vRX+H8kEUqYOE=; b=rUXvms/8THLgUxB7rLanRTu7xlAyW4WUquRa91LuXYxb/zwxyaLOoHBIRxohm5zV++ uGkcy2jgTqVe8cZ6SmNfx9FA7KPWL2xYz9JlA1Fz2oGIc3y3krtRXb8j7S89XJRL1Hik cKXRxWTQZzcw/mEoF+ORW0Gg8pJrOiIF3Ddc9uZGAdPpr2Zl/jVU4STj6hzZeRbnY26F QHWJTcmKTfdDucCWuWCPEErsF6wUtR7RN17cv7FeQExO8g0WKSzzbgNInnvjaCORNP2b ytCM6K4KJBb4/detvradC1iRZaD2YTmH8MVb63H6ZSoqNwwsNa01FDDq2VkuLXC1rQ8A WJng== X-Gm-Message-State: AOAM530p1rRdqFHSwaXq/YWZuWy2xtuEPWLjX9Ye1yVTRBfhGiAD+3aT RD72JXtHPn21JUQhQtofN8w= X-Received: by 2002:a2e:871a:0:b0:246:ee2:1109 with SMTP id m26-20020a2e871a000000b002460ee21109mr8909285lji.165.1647097699713; Sat, 12 Mar 2022 07:08:19 -0800 (PST) Received: from [192.168.1.11] ([94.103.229.107]) by smtp.gmail.com with ESMTPSA id o1-20020a2e7301000000b002461808ad8bsm2408984ljc.102.2022.03.12.07.08.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Mar 2022 07:08:19 -0800 (PST) Message-ID: Date: Sat, 12 Mar 2022 18:08:18 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [syzbot] memory leak in usb_get_configuration Content-Language: en-US To: Alan Stern , syzbot Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, pavel.hofman@ivitera.com, rob@robgreener.com, syzkaller-bugs@googlegroups.com References: <000000000000351b8605d9d1d1bf@google.com> From: Pavel Skripkin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alan, On 3/12/22 00:01, Alan Stern wrote: > On Wed, Mar 09, 2022 at 03:54:24PM -0800, syzbot wrote: >> Hello, >> >> syzbot found the following issue on: >> >> HEAD commit: 0014404f9c18 Merge branch 'akpm' (patches from Andrew) >> git tree: upstream >> console output: https://syzkaller.appspot.com/x/log.txt?x=15864216700000 >> kernel config: https://syzkaller.appspot.com/x/.config?x=3f0a704147ec8e32 >> dashboard link: https://syzkaller.appspot.com/bug?extid=f0fae482604e6d9a87c9 >> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 >> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13a63dbe700000 >> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10e150a1700000 >> >> IMPORTANT: if you fix the issue, please add the following tag to the commit: >> Reported-by: syzbot+f0fae482604e6d9a87c9@syzkaller.appspotmail.com >> >> BUG: memory leak >> unreferenced object 0xffff88810c0289e0 (size 32): >> comm "kworker/1:2", pid 139, jiffies 4294947862 (age 15.910s) >> hex dump (first 32 bytes): >> 09 02 12 00 01 00 00 00 00 09 04 00 00 00 d0 bb ................ >> 3a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :............... >> backtrace: >> [] kmalloc include/linux/slab.h:586 [inline] >> [] usb_get_configuration+0x1c7/0x1cd0 drivers/usb/core/config.c:919 >> [] usb_enumerate_device drivers/usb/core/hub.c:2398 [inline] >> [] usb_new_device+0x1a9/0x2e0 drivers/usb/core/hub.c:2536 >> [] hub_port_connect drivers/usb/core/hub.c:5358 [inline] >> [] hub_port_connect_change drivers/usb/core/hub.c:5502 [inline] >> [] port_event drivers/usb/core/hub.c:5660 [inline] >> [] hub_event+0x1364/0x21a0 drivers/usb/core/hub.c:5742 >> [] process_one_work+0x2bf/0x600 kernel/workqueue.c:2307 >> [] worker_thread+0x59/0x5b0 kernel/workqueue.c:2454 >> [] kthread+0x125/0x160 kernel/kthread.c:377 >> [] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 > > The console log shows that this is connected to gspca_dev_probe. Let's > see who's calling it... > The execution path is more complicated. I've done some debugging, but no luck with root case... Just want to share what I found and maybe it will help. Firsly syzbot connects carl9170 device (usb ids from the log). carl9170_usb_probe() calls usb_reset_device() which fails with -19. If I remove this usb_reset_device() call then issue is no more reproducible. Then 2 other probes are called: usbtest and spca501. spca501 calls gspca_dev_probe(), but it fails early and I do not suspect this driver. usbtest probe function also looks correct, so I do not suspect this driver as well. Looks like the issue either in usb_reset_device() call or somewhere in usb internals With regards, Pavel Skripkin