From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796314883; b=McF4Hfv7UVy6dXz8e8AMtGpCETw9mAlAIpIFcrnCOMZ/XCEksThx7YGQWjMu+DkRN/SV CPjlfJVSgHI/hTOfOuRN4gJN3rPcvlU/o2eojPPAWJqi4n9y3yoc/M4VM0mFAHubMLmLI mfw6xfRaufqE5Fhx5qPWf4MzZNK5CJrkQ0xpG+XoVNqmNVNcwmfMwXPmGpQpVvsBjVuzF AWjrjrhZU3o1iIL8139SPN3N0Rm1JO1oxtJcjYPUr1nbJwIrxf9ky/BRb5ggwk/T+JuE3 e7eW5JWpwC/eF5rYmoQB/hkLjSlAKKH1TSojroDIN2TctgItemwyTlT0bKAIJK2mBdg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796314883; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date:From: To:Cc:Subject; bh=FHVuoPq78vqkgNjDr56kGBC5hU7ps6yQhzC0WvNExio=; b=46JzkRUVdvuP5NLgjzwD5BeqQLk2IGZyyLLYDhTnPhJDk6aJC84hopxbcVSkCRYOlD3f AufL1WzoNFiA8wHiGkuy2DL58W3RjvkrUNLYVQ9K8Auh3dvr4SWjoHbEd5rfcNzCWvGr6 b6r1VgSTbcIguLhOohNlTCZo2AJ4OTKstjXlDFXdS6qYGlP2gtg/JrqqbSEQm3iCZY4Io gPxs7o/Nc71n7D7AZ+u+5DHGygH5InQRS1jm/SMra13/w83AmyjXNavemMfajYQNETfkI Po8Y2zYbcNBWTkT/n94YnbWpOIs8Mw6xfRxXGb9u8+7noFxB40U29hGzU9K2sbdHLcw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=asu.edu; spf=pass smtp.mailfrom=asu.edu; dkim=pass header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b=G9EGHVwB; arc=none smtp.remote-ip=74.125.82.175 Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com [74.125.82.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF841606A322 for ; Thu, 3 Dec 2026 16:21:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EF841606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=asu.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=asu.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b=G9EGHVwB Received: by mail-dy1-f175.google.com with SMTP id 5a478bee46e88-3874781f6easo98713eec.3 for ; Thu, 03 Dec 2026 08:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu.edu; s=google; t=1796314882; x=1796919682; darn=vger.kernel.org; h=subject:cc:to:from:date:message-id:from:to:cc:subject:date :message-id:reply-to:content-type; bh=FHVuoPq78vqkgNjDr56kGBC5hU7ps6yQhzC0WvNExio=; b=G9EGHVwBr99uTgH05JeF8jxJn09xIoCOLe+hzvqFQISAmolA4Wq/vk0D35/GHK+vqa MOvFgv9NS8uXC+hfsU5Xgi/lKD6a3SY/QSMwvZuTNfhDjBuE7RtEMkZzdio6SQJnGvtG +Oyw5EfwJZy2pKYymIT+YNPvIHhuFGmnNenPf4cqHG0bYDPSV1KKe8j/TwNhvBEUbCM+ dPofPqoo2iF+AKCv7CiDPwYx0mLbygsZNLssvTMH6/zDCg4P+QJJ6mjBBDW2yN84RKh8 /Sm8/qsSxVazTrITOmlEsUjmwXvKzUGQvZE6tcj9FRFJ8H3ytlC4XZNC16+xai59cLDH svxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796314882; x=1796919682; h=subject:cc:to:from:date:message-id:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=FHVuoPq78vqkgNjDr56kGBC5hU7ps6yQhzC0WvNExio=; b=zQEqb+RBRJc4K12XcVQF0sgV3loe5l4zNHNDPCGp6rkz5c52SeFCeFWP+YCtj0ICTh QVgsnedNgs1jb6egMlFwqnjA8QDUdTO9a22871gxA/MGq03r9hTXSO9eP29PwnpD7plF PCGQv9MD9zUgPhcqYtuifrC2SNL3HeeZcZo+LTpA3uHl7fMXXFHJBrInM0+T6+wa2xi+ dng7i1JC23WIZ12XmmxgSAlGCmdBzVOscrTLdaZUKguQmY3idGquh1GXGc52+G/l11Fo 0OIjQx+r2Qz6Evz8+FaKTU45mCqi9D9OK4yO8NvF12eyhLrZaGXhUY/Du+uXwSvII5oS wecw== X-Gm-Message-State: APuU4Z/Jkij6bT63cdQ3PJISQXrnT+sLxlbH8zB4W9OJ3EtpjjT7G8yw BiEnLfrunnFi6+aWdw+E4WuDVRAnEhmTcLjKUl0UWvzRlJ8r4BnmhJmxTQcbNaT9Qw== X-Gm-Gg: AZFdTZfsLnfTh0jaXJIDuSuITqCEvDjfeUFwV4NaLLmyAl8VDJrOh2Ib7BZ+XBcdWk0 HRSIbSX7N9xfiKxJYnNfc3zkCcPWzmc27FtVKP7bfS4cMO5XIoZMt6zI9poF9LkaVv+1Z75rh5g YicBXSJ8qr84ZnPViX3fotmoFzgGHNOFWDZJ5qepVZmlet7XvY6VdXfe4aPUXBJKBbWHUhsH/RB 4bnN0c7R9UzeiCLW6j9/WMatP/os+PYDjIQkNYsMRB5tLMDGBiAo7wpMNIC8zMVgK/ju4DMbIYX bN6FPTFZ4vLQHtn3taTlMCWESScDXRVeFnbOJYPyjoYbs8b4ndtZ7YYqbqdM6/yp+Bk29CTlMt7 1hTwCo3Jwx+KYT+Q6Cq0BhPnuCgI9Zb00vB0uyl/JFqJK3OZy3vwogwfECsp24gSRSNN15naV6G X+8PPZyMMR6D/uGbPLPzqZyMM3gzBbDRg9fu6dTAvToz0rxhbVQNxgys+fBKIcd+xFkZTZvmebX bBPbtvbr4vvTOpwp4B8kmNz9icvIib92EPIrI1Z3GiPLg9Bp7e8ZItdlNrKXVYN9oB7PhjM6VhF UbmoCg== X-Received: by 2002:a05:693c:65d6:b0:36d:5fbc:8c8d with SMTP id 5a478bee46e88-38744c10a00mr2794157eec.2.1796314881596; Thu, 03 Dec 2026 08:21:21 -0800 (PST) Received: from 04-usb-gadget-ext-prop.eml ([2607:fb91:4185:7cd1:d36:ab6e:2627:426c]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386aa203267sm90173337eec.0.2026.12.03.08.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 08:21:21 -0800 (PST) Message-ID: <6b119701.352d1d53.1eec8f.8089@mx.google.com> Date: Thu, 03 Dec 2026 08:21:21 -0800 (PST) From: Rahul Priolkar To: Greg Kroah-Hartman , Neill Kapron Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BUG] usb: gadget: configfs extended property reads can use freed storage X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Hello, We first saw these KASAN reports on Linux v7.4-rc4 while testing the configfs handlers for USB OS descriptor extended properties. We used an unbound gadget configured by root in an x86_64 KVM guest. We repeated the tests on v7.4-rc5 (fe6ff8d5d675). On that kernel, KASAN reported 52 double frees in ext_prop_data_store(). In ext_prop_data_show() it reported 60 use-after-free reads and 50 out-of-bounds reads. In 33 reads, the property returned unrelated bytes. The rc5 build included the zero-termination fix in 7a7d9a926501. When we ran the operations one at a time, each control ran for 60 seconds without a KASAN report. In the rc4 double-free trace, ext_prop_data_store() appears on the allocation stack and on both free stacks. The two read traces show different failures: a 4,000-byte read from a freed 4,096-byte region and a 20-byte read from the start of a 10-byte allocation. The logs below are from the original v7.4-rc4 runs. Some end partway through the report. Double free in ext_prop_data_store() [ 146.042764][ T4468] BUG: KASAN: double-free in ext_prop_data_store+0x154/0x3a0 [ 146.042776][ T4468] Free of addr ffff888028e3a800 by task control-r4-gadg/4468 [ 146.042784][ T4468] [ 146.042790][ T4468] CPU: 0 UID: 0 PID: 4468 Comm: control-r4-gadg Tainted: G B 7.4.0-rc4 #2 PREEMPT(full) [ 146.042805][ T4468] Tainted: [B]=BAD_PAGE [ 146.042809][ T4468] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 146.042818][ T4468] Call Trace: [ 146.042822][ T4468] [ 146.042827][ T4468] dump_stack_lvl+0xe8/0x150 [ 146.042845][ T4468] print_address_description+0x55/0x1e0 [ 146.042862][ T4468] print_report+0x58/0x70 [ 146.042888][ T4468] kasan_report_invalid_free+0xea/0x110 [ 146.042932][ T4468] check_slab_allocation+0xbc/0xe0 [ 146.042947][ T4468] kfree+0x17a/0x650 [ 146.042991][ T4468] ext_prop_data_store+0x154/0x3a0 [ 146.043019][ T4468] configfs_write_iter+0x33c/0x430 [ 146.043036][ T4468] vfs_write+0x617/0xba0 [ 146.043148][ T4468] __x64_sys_pwrite64+0x215/0x2d0 [ 146.043237][ T4468] do_syscall_64+0x171/0x540 [ 146.043281][ T4468] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 146.043293][ T4468] RIP: 0033:0x4577e2 [ 146.043302][ T4468] Code: 08 0f 85 11 e3 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 [ 146.043312][ T4468] RSP: 002b:00007f4169302138 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 [ 146.043324][ T4468] RAX: ffffffffffffffda RBX: 0000000000000075 RCX: 00000000004577e2 [ 146.043332][ T4468] RDX: 0000000000000076 RSI: 00000000004e3c20 RDI: 0000000000000004 [ 146.043340][ T4468] RBP: 00007f4169302160 R08: 0000000000000000 R09: 0000000000000000 [ 146.043348][ T4468] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004 [ 146.043356][ T4468] R13: 0000000000000001 R14: 0000000000000011 R15: 00007ffec01deb87 [ 146.043374][ T4468] [ 146.043379][ T4468] [ 146.043382][ T4468] Allocated by task 4468: [ 146.043387][ T4468] kasan_save_track+0x3f/0x90 [ 146.043397][ T4468] __kasan_kmalloc+0x93/0xb0 [ 146.043409][ T4468] __kmalloc_node_track_caller_noprof+0x4db/0x750 [ 146.043427][ T4468] kmemdup_noprof+0x30/0x70 [ 146.043441][ T4468] ext_prop_data_store+0xbb/0x3a0 [ 146.043452][ T4468] configfs_write_iter+0x33c/0x430 [ 146.043464][ T4468] vfs_write+0x617/0xba0 [ 146.043480][ T4468] __x64_sys_pwrite64+0x215/0x2d0 [ 146.043498][ T4468] do_syscall_64+0x171/0x540 [ 146.043512][ T4468] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 146.043524][ T4468] [ 146.043527][ T4468] Freed by task 4469: [ 146.043532][ T4468] kasan_save_track+0x3f/0x90 [ 146.043542][ T4468] kasan_save_free_info+0x40/0x50 [ 146.043564][ T4468] __kasan_slab_free+0x70/0x90 [ 146.043575][ T4468] kfree+0x1cc/0x650 [ 146.043589][ T4468] ext_prop_data_store+0x154/0x3a0 [ 146.043600][ T4468] configfs_write_iter+0x33c/0x430 [ 146.043612][ T4468] vfs_write+0x617/0xba0 [ 146.043628][ T4468] __x64_sys_pwrite64+0x215/0x2d0 [ 146.043645][ T4468] do_syscall_64+0x171/0x540 [ 146.043660][ T4468] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 146.043671][ T4468] [ 146.043674][ T4468] The buggy address belongs to the object at ffff888028e3a800 [ 146.043674][ T4468] which belongs to the cache kmalloc-128 of size 128 [ 146.043683][ T4468] The buggy address is located 0 bytes inside of [ 146.043683][ T4468] 128-byte region [ffff888028e3a800, ffff888028e3a880) [ 146.043695][ T4468] [ 146.043698][ T4468] The buggy address belongs to the physical page: [ 146.043702][ T4468] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28e3a [ 146.043712][ T4468] flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) [ 146.043721][ T4468] page_type: f5(slab) [ 146.043730][ T4468] raw: 00fff00000000000 ffff88801bc42a00 dead000000000100 dead000000000122 [ 146.043741][ T4468] raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 [ 146.043748][ T4468] page dumped because: kasan: bad access detected [ 146.043753][ T4468] [ 146.043756][ T4468] Memory state around the buggy address: [ 146.043762][ T4468] ffff888028e3a700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 fc [ 146.043773][ T4468] ffff888028e3a780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc Use-after-free read in ext_prop_data_show() [ 84.159739][ T4431] BUG: KASAN: slab-use-after-free in ext_prop_data_show+0xcb/0x120 [ 84.159752][ T4431] Read of size 4000 at addr ffff88802a2f4000 by task control-r4-gadg/4431 [ 84.159762][ T4431] [ 84.159768][ T4431] CPU: 2 UID: 0 PID: 4431 Comm: control-r4-gadg Tainted: G B 7.4.0-rc4 #2 PREEMPT(full) [ 84.159784][ T4431] Tainted: [B]=BAD_PAGE [ 84.159789][ T4431] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 84.159797][ T4431] Call Trace: [ 84.159802][ T4431] [ 84.159807][ T4431] dump_stack_lvl+0xe8/0x150 [ 84.159825][ T4431] print_address_description+0x55/0x1e0 [ 84.159854][ T4431] print_report+0x58/0x70 [ 84.159869][ T4431] kasan_report+0x117/0x150 [ 84.159903][ T4431] kasan_check_range+0x3c7/0x3f0 [ 84.159931][ T4431] __asan_memcpy+0x29/0x70 [ 84.159951][ T4431] ext_prop_data_show+0xcb/0x120 [ 84.159977][ T4431] configfs_read_iter+0x2bc/0x630 [ 84.159994][ T4431] vfs_read+0x59a/0xa80 [ 84.160160][ T4431] ksys_read+0x155/0x270 [ 84.160249][ T4431] do_syscall_64+0x171/0x540 [ 84.160293][ T4431] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 84.160306][ T4431] RIP: 0033:0x4577e2 [ 84.160315][ T4431] Code: 08 0f 85 11 e3 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 [ 84.160325][ T4431] RSP: 002b:00007f78f6107118 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [ 84.160337][ T4431] RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00000000004577e2 [ 84.160346][ T4431] RDX: 0000000000002000 RSI: 00007f78f61076a0 RDI: 0000000000000005 [ 84.160354][ T4431] RBP: 00007f78f6107140 R08: 0000000000000000 R09: 0000000000000000 [ 84.160362][ T4431] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000021 [ 84.160370][ T4431] R13: 00007ffef76e3680 R14: 00007f78f61076a0 R15: 00007ffef76e3777 [ 84.160390][ T4431] [ 84.160394][ T4431] [ 84.160397][ T4431] Allocated by task 4430: [ 84.160403][ T4431] kasan_save_track+0x3f/0x90 [ 84.160413][ T4431] __kasan_kmalloc+0x93/0xb0 [ 84.160424][ T4431] __kmalloc_node_track_caller_noprof+0x4db/0x750 [ 84.160443][ T4431] kmemdup_noprof+0x30/0x70 [ 84.160458][ T4431] ext_prop_data_store+0xbb/0x3a0 [ 84.160469][ T4431] configfs_write_iter+0x33c/0x430 [ 84.160482][ T4431] vfs_write+0x617/0xba0 [ 84.160498][ T4431] __x64_sys_pwrite64+0x215/0x2d0 [ 84.160516][ T4431] do_syscall_64+0x171/0x540 [ 84.160530][ T4431] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 84.160542][ T4431] [ 84.160545][ T4431] Freed by task 4430: [ 84.160550][ T4431] kasan_save_track+0x3f/0x90 [ 84.160561][ T4431] kasan_save_free_info+0x40/0x50 [ 84.160577][ T4431] __kasan_slab_free+0x70/0x90 [ 84.160588][ T4431] kfree+0x1cc/0x650 [ 84.160602][ T4431] ext_prop_data_store+0x154/0x3a0 [ 84.160613][ T4431] configfs_write_iter+0x33c/0x430 [ 84.160626][ T4431] vfs_write+0x617/0xba0 [ 84.160642][ T4431] __x64_sys_pwrite64+0x215/0x2d0 [ 84.160659][ T4431] do_syscall_64+0x171/0x540 [ 84.160674][ T4431] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 84.160686][ T4431] [ 84.160689][ T4431] The buggy address belongs to the object at ffff88802a2f4000 [ 84.160689][ T4431] which belongs to the cache kmalloc-4k of size 4096 [ 84.160699][ T4431] The buggy address is located 0 bytes inside of [ 84.160699][ T4431] freed 4096-byte region [ffff88802a2f4000, ffff88802a2f5000) [ 84.160711][ T4431] [ 84.160714][ T4431] The buggy address belongs to the physical page: [ 84.160719][ T4431] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a2f0 [ 84.160730][ T4431] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 84.160739][ T4431] flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) [ 84.160749][ T4431] page_type: f5(slab) [ 84.160759][ T4431] raw: 00fff00000000040 ffff88801bc43040 dead000000000100 dead000000000122 [ 84.160770][ T4431] raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 [ 84.160782][ T4431] head: 00fff00000000040 ffff88801bc43040 dead000000000100 dead000000000122 [ 84.160793][ T4431] head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 [ 84.160804][ T4431] head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff [ 84.160815][ T4431] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 Out-of-bounds read in ext_prop_data_show() [ 268.458293][ T4505] BUG: KASAN: slab-out-of-bounds in ext_prop_data_show+0xcb/0x120 [ 268.458311][ T4505] Read of size 20 at addr ffff8880227f8ae0 by task control-r4-gadg/4505 [ 268.458325][ T4505] [ 268.458334][ T4505] CPU: 2 UID: 0 PID: 4505 Comm: control-r4-gadg Tainted: G B 7.4.0-rc4 #2 PREEMPT(full) [ 268.458355][ T4505] Tainted: [B]=BAD_PAGE [ 268.458362][ T4505] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 268.458373][ T4505] Call Trace: [ 268.458379][ T4505] [ 268.458386][ T4505] dump_stack_lvl+0xe8/0x150 [ 268.458411][ T4505] print_address_description+0x55/0x1e0 [ 268.458450][ T4505] print_report+0x58/0x70 [ 268.458470][ T4505] kasan_report+0x117/0x150 [ 268.458514][ T4505] kasan_check_range+0x3c7/0x3f0 [ 268.458552][ T4505] __asan_memcpy+0x29/0x70 [ 268.458578][ T4505] ext_prop_data_show+0xcb/0x120 [ 268.458613][ T4505] configfs_read_iter+0x2bc/0x630 [ 268.458637][ T4505] vfs_read+0x59a/0xa80 [ 268.458855][ T4505] ksys_read+0x155/0x270 [ 268.458972][ T4505] do_syscall_64+0x171/0x540 [ 268.459031][ T4505] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 268.459048][ T4505] RIP: 0033:0x4577e2 [ 268.459060][ T4505] Code: 08 0f 85 11 e3 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 [ 268.459074][ T4505] RSP: 002b:00007ffe86b8e1a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [ 268.459091][ T4505] RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00000000004577e2 [ 268.459103][ T4505] RDX: 0000000000002000 RSI: 00000000004dfac0 RDI: 0000000000000006 [ 268.459114][ T4505] RBP: 00007ffe86b8e1d0 R08: 0000000000000000 R09: 0000000000000000 [ 268.459125][ T4505] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe86b8e240 [ 268.459136][ T4505] R13: 00007ffe86b8ff72 R14: 00000000004dfac0 R15: 0000000000000002 [ 268.459161][ T4505] [ 268.459167][ T4505] [ 268.459171][ T4505] Allocated by task 4505: [ 268.459179][ T4505] kasan_save_track+0x3f/0x90 [ 268.459192][ T4505] __kasan_kmalloc+0x93/0xb0 [ 268.459203][ T4505] __kmalloc_node_track_caller_noprof+0x4db/0x750 [ 268.459222][ T4505] kmemdup_noprof+0x30/0x70 [ 268.459238][ T4505] ext_prop_data_store+0xbb/0x3a0 [ 268.459252][ T4505] configfs_write_iter+0x33c/0x430 [ 268.459269][ T4505] vfs_write+0x617/0xba0 [ 268.459291][ T4505] ksys_write+0x155/0x270 [ 268.459314][ T4505] do_syscall_64+0x171/0x540 [ 268.459334][ T4505] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 268.459349][ T4505] [ 268.459354][ T4505] The buggy address belongs to the object at ffff8880227f8ae0 [ 268.459354][ T4505] which belongs to the cache kmalloc-16 of size 16 [ 268.459367][ T4505] The buggy address is located 0 bytes inside of [ 268.459367][ T4505] allocated 10-byte region [ffff8880227f8ae0, ffff8880227f8aea) [ 268.459384][ T4505] [ 268.459388][ T4505] The buggy address belongs to the physical page: [ 268.459396][ T4505] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880227f8ce0 pfn:0x227f8 [ 268.459410][ T4505] flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) [ 268.459423][ T4505] page_type: f5(slab) [ 268.459438][ T4505] raw: 00fff00000000200 ffff88801bc42640 ffff88801bc40408 ffffea0000808fd0 [ 268.459453][ T4505] raw: ffff8880227f8ce0 0000000000800072 00000000f5000000 0000000000000000 [ 268.459462][ T4505] page dumped because: kasan: bad access detected [ 268.459469][ T4505] [ 268.459473][ T4505] Memory state around the buggy address: [ 268.459481][ T4505] ffff8880227f8980: 00 03 fc fc fa fb fc fc 00 05 fc fc fa fb fc fc [ 268.459493][ T4505] ffff8880227f8a00: 00 03 fc fc fa fb fc fc 00 00 fc fc fa fb fc fc [ 268.459504][ T4505] >ffff8880227f8a80: 00 07 fc fc fa fb fc fc 00 04 fc fc 00 02 fc fc [ 268.459514][ T4505] ^ [ 268.459523][ T4505] ffff8880227f8b00: 00 03 fc fc fa fb fc fc 00 06 fc fc fa fb fc fc [ 268.459534][ T4505] ffff8880227f8b80: 00 04 fc fc fa fb fc fc 00 03 fc fc fa fb fc fc [ 268.459543][ T4505] ================================================================== [ 268.470996][ T4505] ================================================================== Saved diagnostic from the C39-usb-gadget-ext-prop-unlocked test record BUG: KASAN: double-free in ext_prop_data_store+0x154/0x3a0 Free of addr ffff88802de97400 by task control-gadget-/4407 CPU: 1 UID: 0 PID: 4407 Comm: control-gadget- Not tainted 7.4.0-rc4 #2 PREEMPT(full) Call Trace: kfree+0x17a/0x650 ext_prop_data_store+0x154/0x3a0 configfs_write_iter+0x33c/0x430 vfs_write+0x617/0xba0 __x64_sys_pwrite64+0x215/0x2d0 do_syscall_64+0x171/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Allocated by task 4407: __kmalloc_node_track_caller_noprof+0x4db/0x750 kmemdup_noprof+0x30/0x70 ext_prop_data_store+0xbb/0x3a0 configfs_write_iter+0x33c/0x430 vfs_write+0x617/0xba0 __x64_sys_pwrite64+0x215/0x2d0 do_syscall_64+0x171/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 4408: kfree+0x1cc/0x650 ext_prop_data_store+0x154/0x3a0 configfs_write_iter+0x33c/0x430 vfs_write+0x617/0xba0 __x64_sys_pwrite64+0x215/0x2d0 do_syscall_64+0x171/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802de97400 which belongs to the cache kmalloc-96 of size 96 Can you confirm that this is a bug in USB gadget configfs? Thanks, Rahul Priolkar