linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Mirsad Goran Todorovac <mirsad.goran.todorovac@alu.hr>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Jiri Kosina <jikos@kernel.org>
Subject: Re: [BUG] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2
Date: Mon, 8 May 2023 08:51:55 +0200	[thread overview]
Message-ID: <2023050824-juiciness-catching-9290@gregkh> (raw)
In-Reply-To: <f64b17fa-d509-ad30-6e8d-e4c979818047@alu.unizg.hr>

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-<id>-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:
>     [<ffffffffb81a74be>] __kmem_cache_alloc_node+0x22e/0x2b0
>     [<ffffffffb8127b6e>] kmalloc_trace+0x2e/0xa0
>     [<ffffffffb87543d9>] class_create+0x29/0x80
>     [<ffffffffb8880d24>] 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?

thanks,

greg k-h

       reply	other threads:[~2023-05-08  6:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f64b17fa-d509-ad30-6e8d-e4c979818047@alu.unizg.hr>
2023-05-08  6:51 ` Greg Kroah-Hartman [this message]
2023-05-08  7:40   ` [BUG] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2 Mirsad Todorovac
2023-05-08 14:01   ` Greg Kroah-Hartman
2023-05-08 17:26     ` Mirsad Goran Todorovac
2023-05-08 23:51     ` Mirsad Goran Todorovac
2023-05-09  2:59       ` Greg Kroah-Hartman
2023-05-12 19:08         ` Mirsad Goran Todorovac
2023-05-12 21:33         ` [BUG][NEW DATA] " Mirsad Goran Todorovac
2023-05-16 14:36           ` Greg Kroah-Hartman
2023-05-17  7:24             ` Mirsad Goran Todorovac
2023-05-17 16:10             ` Mirsad Goran Todorovac
2023-05-17 18:57               ` Greg Kroah-Hartman
2023-05-17 19:41                 ` Mirsad Goran Todorovac
2023-05-18  8:00                 ` Mirsad Todorovac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2023050824-juiciness-catching-9290@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mirsad.goran.todorovac@alu.hr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).