Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp906523rwp; Thu, 13 Jul 2023 03:07:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPPmzMPzvF5iaZePVSM9UVAWb++lIijp5rgfQP3fjZOTDlSZjU/QEFOwJicGgCq/R0feSh X-Received: by 2002:a05:651c:1059:b0:2b6:c7f5:65fa with SMTP id x25-20020a05651c105900b002b6c7f565famr949132ljm.20.1689242855429; Thu, 13 Jul 2023 03:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689242855; cv=none; d=google.com; s=arc-20160816; b=Ri4qgjr6jRKhBFYoGfeL2g2UrGzB8Usih2ISmClaASZ/KKVv451Gcg5L7IXSgUplnd TQqziZ49WCUzsC7i0pbZRT22z3GVtmtk2nKLAgMD0Ef42FdCNi2drWLtGBAfjdC1dvcC tvbXRNfpDyDKiYLLWVzM/ACtXqs3TGRfWVv7jrOu20AFRAcsFtwZbGHtyJdvgUW1cYqV hi3+FsSAzuWEZEem0e2mayFlFmtgaXaJGSGoVUOTijnceMO4kxF+KWSoEwqUF2R1LOqm tANPh5GUMcd9qVBsBX53B1t7k0WK4Msvv7oNgfXe+Xb6kTOL7RCF99qK1iRTHS7hG9Km kxOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:message-id:date:mime-version; bh=mTij7KSOxkJc3DOrNp655BMRHw+1Y0mxxpIcA3AxT/s=; fh=kjq0w+Ha88p0bSJYhqgfnRO279gFu4v2zTDgDteFs/Y=; b=UNeAHCro9Y3BJxmAHwQTqNw/S8eTZIoxbw8kaN70lJByCUpjAXr6iJ1jp+Yb9tJXJ6 ZMsW1jyF2XRW6n6vJz5M50nRVP+2vMBLiuFmZS2ZnND16kv8bFJvHPkdYJWKUL6IcM82 d9lnzta0WS/C3mUX+FD1++TOqwfl3t3281E+LKTmheSXBqRoS2vykugI0VZ9LWNAqLuW LVq+e3cqAd7jF06YdTs1DzDhh5LF/fDFKQSl2NXEnihbN5u8EGadG7ExiJ/xzuI09nWC dugXZF/PL4p0YKZqak5GAAkD/WL5e422nVKwtFaVzy/YPWyZAM9jnbkMMcIt55kWR+JU 2qgQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt23-20020a170906f21700b00993a68a3afcsi6958185ejb.489.2023.07.13.03.07.10; Thu, 13 Jul 2023 03:07:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234396AbjGMKAv (ORCPT + 99 others); Thu, 13 Jul 2023 06:00:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234319AbjGMKAW (ORCPT ); Thu, 13 Jul 2023 06:00:22 -0400 Received: from mail-ot1-f80.google.com (mail-ot1-f80.google.com [209.85.210.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37D8430DB for ; Thu, 13 Jul 2023 02:59:51 -0700 (PDT) Received: by mail-ot1-f80.google.com with SMTP id 46e09a7af769-6b7523df143so781903a34.0 for ; Thu, 13 Jul 2023 02:59:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689242390; x=1691834390; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=mTij7KSOxkJc3DOrNp655BMRHw+1Y0mxxpIcA3AxT/s=; b=ha3IjlFYybZHSMTRqGfBbiTk6yk3EUkzy4QrN1VrCPQQfT82Y1FZ6jQxcS9e729wer X8BbvUAFyo3CHvN71PKql8JkUF5SGEG12ZqC92Q1rZ5J+gLvEWsf7MhAEefzr0GHKWi7 foybTrG4MJAnUz7bp+DEoTp1dclyl0BLe9D639yBi29ZtudIec1QkvkXsFi3fOpE+a/M I9gYfXLsiQ3brokwAd2z9yWM5iGTUjTsenmiYqIMQb7P6Qzyj/Lm/uzZaSC0WEh0Mp8X 6LgMKKZCXXeXY+7Hx/pOsC3rcjxBlxIn5tq7CrR/j7BPjsk+1Zqj8cxMxZiaZgxOdLNI v30Q== X-Gm-Message-State: ABy/qLbPKUsn5+eNURWjdcz50vUpbThSQmTO0tP0v/Qef2UVmu8bA3O3 4Q6nNa7fdAP0tFEctBtuk+vTCvHDymHulySsV0xKmfo4v0aK MIME-Version: 1.0 X-Received: by 2002:a9d:74c9:0:b0:6b9:5b73:f70 with SMTP id a9-20020a9d74c9000000b006b95b730f70mr1018604otl.1.1689242390343; Thu, 13 Jul 2023 02:59:50 -0700 (PDT) Date: Thu, 13 Jul 2023 02:59:50 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <0000000000009db51a06005b64e9@google.com> Subject: [syzbot] [usb?] memory leak in raw_open From: syzbot To: andreyknvl@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,FROM_LOCAL_HEX, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, syzbot found the following issue on: HEAD commit: 1c7873e33645 mm: lock newly mapped VMA with corrected orde.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1517663ca80000 kernel config: https://syzkaller.appspot.com/x/.config?x=832b404e095b70c0 dashboard link: https://syzkaller.appspot.com/bug?extid=feb045d335c1fdde5bf7 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=1776519ca80000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=117f9778a80000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/43b42bd2cf70/disk-1c7873e3.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/011ba1b9e8c1/vmlinux-1c7873e3.xz kernel image: https://storage.googleapis.com/syzbot-assets/18b349342595/bzImage-1c7873e3.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+feb045d335c1fdde5bf7@syzkaller.appspotmail.com BUG: memory leak unreferenced object 0xffff88810b172000 (size 4096): comm "syz-executor103", pid 5067, jiffies 4294964128 (age 13.070s) hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 bc 96 0e 81 88 ff ff ................ 5d b6 9e 85 ff ff ff ff 03 00 00 00 00 00 00 00 ]............... backtrace: [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] kzalloc include/linux/slab.h:703 [inline] [] dev_new drivers/usb/gadget/legacy/raw_gadget.c:191 [inline] [] raw_open+0x45/0x110 drivers/usb/gadget/legacy/raw_gadget.c:385 [] misc_open+0x1a9/0x1f0 drivers/char/misc.c:165 [] chrdev_open+0x11b/0x340 fs/char_dev.c:414 [] do_dentry_open+0x30f/0x990 fs/open.c:914 [] do_open fs/namei.c:3636 [inline] [] path_openat+0x178b/0x1b20 fs/namei.c:3793 [] do_filp_open+0xc5/0x1b0 fs/namei.c:3820 [] do_sys_openat2+0xe3/0x140 fs/open.c:1407 [] do_sys_open fs/open.c:1422 [inline] [] __do_sys_openat fs/open.c:1438 [inline] [] __se_sys_openat fs/open.c:1433 [inline] [] __x64_sys_openat+0x83/0xe0 fs/open.c:1433 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd BUG: memory leak unreferenced object 0xffff88810ad20d60 (size 32): comm "syz-executor103", pid 5067, jiffies 4294964128 (age 13.070s) hex dump (first 32 bytes): 72 61 77 2d 67 61 64 67 65 74 2e 30 00 00 00 00 raw-gadget.0.... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] raw_ioctl_init+0xdf/0x410 drivers/usb/gadget/legacy/raw_gadget.c:460 [] raw_ioctl+0x5f9/0x1120 drivers/usb/gadget/legacy/raw_gadget.c:1250 [] vfs_ioctl fs/ioctl.c:51 [inline] [] __do_sys_ioctl fs/ioctl.c:870 [inline] [] __se_sys_ioctl fs/ioctl.c:856 [inline] [] __x64_sys_ioctl+0x103/0x140 fs/ioctl.c:856 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd BUG: memory leak unreferenced object 0xffff88810e96bc00 (size 128): comm "syz-executor103", pid 5067, jiffies 4294964128 (age 13.070s) hex dump (first 32 bytes): 64 75 6d 6d 79 5f 75 64 63 00 00 00 00 00 00 00 dummy_udc....... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] raw_ioctl_init+0x11d/0x410 drivers/usb/gadget/legacy/raw_gadget.c:468 [] raw_ioctl+0x5f9/0x1120 drivers/usb/gadget/legacy/raw_gadget.c:1250 [] vfs_ioctl fs/ioctl.c:51 [inline] [] __do_sys_ioctl fs/ioctl.c:870 [inline] [] __se_sys_ioctl fs/ioctl.c:856 [inline] [] __x64_sys_ioctl+0x103/0x140 fs/ioctl.c:856 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd BUG: memory leak unreferenced object 0xffff88810e96ba80 (size 128): comm "syz-executor103", pid 5067, jiffies 4294964128 (age 13.070s) hex dump (first 32 bytes): 64 75 6d 6d 79 5f 75 64 63 2e 30 00 00 00 00 00 dummy_udc.0..... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] raw_ioctl_init+0x1ac/0x410 drivers/usb/gadget/legacy/raw_gadget.c:479 [] raw_ioctl+0x5f9/0x1120 drivers/usb/gadget/legacy/raw_gadget.c:1250 [] vfs_ioctl fs/ioctl.c:51 [inline] [] __do_sys_ioctl fs/ioctl.c:870 [inline] [] __se_sys_ioctl fs/ioctl.c:856 [inline] [] __x64_sys_ioctl+0x103/0x140 fs/ioctl.c:856 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd BUG: memory leak unreferenced object 0xffff88810e96bd00 (size 128): comm "syz-executor103", pid 5067, jiffies 4294964128 (age 13.070s) hex dump (first 32 bytes): 00 bd 96 0e 81 88 ff ff 00 bd 96 0e 81 88 ff ff ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] kzalloc include/linux/slab.h:703 [inline] [] dummy_alloc_request+0x5a/0xe0 drivers/usb/gadget/udc/dummy_hcd.c:665 [] usb_ep_alloc_request+0x22/0xd0 drivers/usb/gadget/udc/core.c:196 [] gadget_bind+0x6d/0x370 drivers/usb/gadget/legacy/raw_gadget.c:292 [] gadget_bind_driver+0xe3/0x2e0 drivers/usb/gadget/udc/core.c:1591 [] call_driver_probe drivers/base/dd.c:579 [inline] [] really_probe+0x12d/0x430 drivers/base/dd.c:658 [] __driver_probe_device+0xc1/0x1a0 drivers/base/dd.c:798 [] driver_probe_device+0x2a/0x120 drivers/base/dd.c:828 [] __driver_attach drivers/base/dd.c:1214 [inline] [] __driver_attach+0xfe/0x1f0 drivers/base/dd.c:1154 [] bus_for_each_dev+0xa5/0x110 drivers/base/bus.c:368 [] bus_add_driver+0x126/0x2a0 drivers/base/bus.c:673 [] driver_register+0x8a/0x190 drivers/base/driver.c:246 [] usb_gadget_register_driver_owner+0x64/0x160 drivers/usb/gadget/udc/core.c:1665 [] raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:546 [inline] [] raw_ioctl+0x6f6/0x1120 drivers/usb/gadget/legacy/raw_gadget.c:1253 [] vfs_ioctl fs/ioctl.c:51 [inline] [] __do_sys_ioctl fs/ioctl.c:870 [inline] [] __se_sys_ioctl fs/ioctl.c:856 [inline] [] __x64_sys_ioctl+0x103/0x140 fs/ioctl.c:856 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the bug is already fixed, let syzbot know by replying with: #syz fix: exact-commit-title If you want syzbot to run the reproducer, reply with: #syz test: git://repo/address.git branch-or-commit-hash If you attach or paste a git patch, syzbot will apply it before testing. If you want to change bug's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the bug is a duplicate of another bug, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup