Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4414140rwr; Mon, 8 May 2023 07:22:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/8JMTZq4E0qaz9Ynxdmw13b6vC2riRvXaA1gGPEuSVk5SAF+uwU1N5Dj/w8PO4UsEIbRK X-Received: by 2002:a17:902:cec8:b0:1ac:5c53:2c1b with SMTP id d8-20020a170902cec800b001ac5c532c1bmr7550177plg.66.1683555776522; Mon, 08 May 2023 07:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683555776; cv=none; d=google.com; s=arc-20160816; b=q63pCcJ/rLpOz75b0tX7pZpm/BiGxelhRaYmp5q7vNa2M4Z1/eytbhE0MUvO3AN49q kxofrYThDoNUT5q5g4NtbSh3DAAetg38+KbUog+n/VBRrIR7UX5YjBa0wp/lTVCh0i5H 0OP/c087sIbtXICrLMRF416LM9yl6MmpzjnVotBetLiZdWlUnmLDQQZRGd1Dx1FDI7TH sPxSXGhVu0eciKsN6KvKZ8Kh4ePu2ziUkdLiKs7Z7VBDvDQ4jMzftLFyrpRfQV3wXPXb wpX5pm7nOMZ3CSeODFvdEAqAVItm433l4bKy6qTr69rEgLHqXOl2mZbNq/KtXna9JWBm t87g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Jyx13JswPeA7RcVsEyuIyognfRQDQHb03FvSS3afwEE=; b=OLjA4xNhOCcIUxNgSBuJaap0JvZpAtT8FvehN+eFDYpFItc4JnJGZZxoilADu0+hej UgFsmr62l8bklv/iPXxlYqMbz15e2kC1X15lEs+WEN9mp2dpwB5njVkQliT8f6nyzFIV SfzkdaYM+NQjEGABQ4+AR9bRF6JOm2uGuPSj/lexJnlCOHWzaBAkQfNivXO+lucFBy3H ffIubEKV5iS6wd04S81MKr/8Ui+/FTeK+WGL4DoCVBJJ0Rn8BmJI9f76e7tnXd66B83D Ti0+VmDaE+N4N+YA1JHVXV6UjtUy5QcvkvgONRphdCUOXjS38J/o/WlsD4sPf3DGRs9J vEfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ymgv1cow; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lt9-20020a17090b354900b0024df993792dsi1898826pjb.80.2023.05.08.07.22.41; Mon, 08 May 2023 07:22:56 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=Ymgv1cow; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233524AbjEHOBW (ORCPT + 99 others); Mon, 8 May 2023 10:01:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233475AbjEHOBV (ORCPT ); Mon, 8 May 2023 10:01:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E330C348B5; Mon, 8 May 2023 07:01:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78DF962D9B; Mon, 8 May 2023 14:01:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BDCEC433EF; Mon, 8 May 2023 14:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683554475; bh=O8tjsOi+oKea2wipKtbwhwqOEm7vtb389lfsVLc4ECo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ymgv1cowBjCfDf/5ikYFlNvu2+D2jnmp7vR8c95Fs+X+AO9Z9RAYUOf1OlPwVxept XHDgQUFJxDL98IXbSNLc2U1JKnisBGWsYm51DJ4IHGYzDojlv1On+XTfmI4RPFvvN/ be00CmCOf7hXa1tkn7Ni0VP7Fa4OSn8dnJMw6SZQ= Date: Mon, 8 May 2023 16:01:12 +0200 From: Greg Kroah-Hartman To: Mirsad Goran Todorovac Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Subject: Re: [BUG] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2 Message-ID: <2023050854-collage-dreamt-660c@gregkh> References: <2023050824-juiciness-catching-9290@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2023050824-juiciness-catching-9290@gregkh> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_FILL_THIS_FORM_SHORT,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 On Mon, May 08, 2023 at 08:51:55AM +0200, Greg Kroah-Hartman wrote: > On Mon, May 08, 2023 at 08:30:07AM +0200, Mirsad Goran Todorovac wrote: > > Hi, > > > > There seems to be a kernel memory leak in the USB keyboard driver. > > > > The leaked memory allocs are 96 and 512 bytes. > > > > The platform is Ubuntu 22.04 LTS on a assembled AMD Ryzen 9 with X670E PG > > Lightning mobo, > > and Genius SlimStar i220 GK-080012 keyboard. > > > > (Logitech M100 HID mouse is not affected by the bug.) > > > > BIOS is: > > > > ???? *-firmware > > ????????? description: BIOS > > ????????? vendor: American Megatrends International, LLC. > > ????????? physical id: 0 > > ????????? version: 1.21 > > ????????? date: 04/26/2023 > > ????????? size: 64KiB > > > > The kernel is 6.3.0-torvalds--13466-gfc4354c6e5c2. > > > > The keyboard is recognised as Chicony: > > > > ???????????????? *-usb > > ????????????????????? description: Keyboard > > ????????????????????? product: CHICONY USB Keyboard > > ????????????????????? vendor: CHICONY > > ????????????????????? physical id: 2 > > ????????????????????? bus info: usb@5:2 > > ????????????????????? logical name: input35 > > ????????????????????? logical name: /dev/input/event4 > > ????????????????????? logical name: input35::capslock > > ????????????????????? logical name: input35::numlock > > ????????????????????? logical name: input35::scrolllock > > ????????????????????? logical name: input36 > > ????????????????????? logical name: /dev/input/event5 > > ????????????????????? logical name: input37 > > ????????????????????? logical name: /dev/input/event6 > > ????????????????????? logical name: input38 > > ????????????????????? logical name: /dev/input/event8 > > ????????????????????? version: 2.30 > > ????????????????????? capabilities: usb-2.00 usb > > ????????????????????? configuration: driver=usbhid maxpower=100mA > > speed=1Mbit/s > > > > The bug is easily reproduced by unplugging the USB keyboard, waiting about a > > couple of seconds, > > and then reconnect and scan for memory leaks twice. > > > > The kmemleak log is as follows [edited privacy info]: > > > > root@hostname:/home/username# cat /sys/kernel/debug/kmemleak > > unreferenced object 0xffff8dd020037c00 (size 96): > > ? comm "systemd-udevd", pid 435, jiffies 4294892550 (age 8909.356s) > > ? hex dump (first 32 bytes): > > ??? 5d 8e 4e b9 ff ff ff ff 00 00 00 00 00 00 00 00 ].N............. > > ??? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > > ? backtrace: > > ??? [] __kmem_cache_alloc_node+0x22e/0x2b0 > > ??? [] kmalloc_trace+0x2e/0xa0 > > ??? [] class_create+0x29/0x80 > > ??? [] usb_register_dev+0x1d4/0x2e0 > > As the call to class_create() in this path is now gone in 6.4-rc1, can > you retry that release to see if this is still there or not? No, wait, it's still there, I was looking at a development branch of mine that isn't sent upstream yet. And syzbot just reported the same thing: https://lore.kernel.org/r/00000000000058d15f05fb264013@google.com So something's wrong here, let me dig into it tomorrow when I get a chance... thanks, greg k-h