🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26396

Re: [PATCH net] net: hso: fix use-after-free after failed tty open

#26396
From: Johan Hovold
Date: Thu, 03 Dec 2026 13:11
97 lines
15347 bytes
On Tue, Dec 01, 2026 at 12:48:36PM +0000, Yannick Müller wrote:
> Hey all, The issue was found during a security review with AI support however the finding was manually confirmed. I wrote a working PoC and confirmed that the bug is trigerable at runtime using a real device. The kernel version which was beeing used is "7.3.7". Triggering it against the 7.3.7 kernel using KASAN resulted in the following dmesg trace: [ 62.333336] ================================================================== [ 62.333341] BUG: KASAN: slab-use-after-free in tty_init_dev.part.0+0x3d3/0x3f0 [ 62.333348] Write of size 8 at addr ffff88800374d120 by task reclaim_poc/1549 [ 62.333354] CPU: 0 UID: 0 PID: 1549 Comm: reclaim_poc Not tainted 7.3.7 #1 PREEMPT(lazy) [ 62.333358] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 62.333361] Call Trace: [ 62.333362] <TASK> [ 62.333363] dump_stack_lvl+0x4e/0x70 [ 62.333368] print_report+0x157/0x4c9 [ 62.333372] ? __pfx__raw_spin_lock_irqsave+0x10/0x10 [ 62.333376] ? tty_ldisc_get.part.0+0xe1/0x2a0 [ 62.333380] ? tty_init_dev.part.0+0x3d3/0x3f0 [ 62.333383] kasan_report+0xce/0x100 [ 62.333387] ? tty_init_dev.part.0+0x3d3/0x3f0 [ 62.333390] tty_init_dev.part.0+0x3d3/0x3f0 [ 62.333393] tty_open+0x8f8/0x1180 [ 62.333396] ? __pfx_tty_open+0x10/0x10 [ 62.333398] ? __pfx_kobject_get_unless_zero+0x10/0x10 [ 62.333401] ? __pfx__raw_spin_lock+0x10/0x10 [ 62.333405] ? selinux_file_open+0x2f4/0x4a0 [ 62.333408] chrdev_open+0x1e5/0x5b0 [ 62.333411] ? __pfx_chrdev_open+0x10/0x10 [ 62.333414] ? __pfx_lockref_get+0x10/0x10 [ 62.333418] ? __pfx_chrdev_open+0x10/0x10 [ 62.333420] do_dentry_open+0x401/0x1280 [ 62.333424] vfs_open+0x74/0x350 [ 62.333427] path_openat+0x16b5/0x2020 [ 62.333430] ? __pfx_path_openat+0x10/0x10 [ 62.333433] do_file_open+0x1cd/0x400 [ 62.333436] ? __pfx_do_file_open+0x10/0x10 [ 62.333439] ? alloc_fd+0x32e/0x580 [ 62.333442] do_sys_openat2+0xe2/0x180 [ 62.333445] ? __pfx_do_sys_openat2+0x10/0x10 [ 62.333449] __x64_sys_openat+0x103/0x1d0 [ 62.333452] ? __pfx___x64_sys_openat+0x10/0x10 [ 62.333456] do_syscall_64+0xdf/0x4b0 [ 62.333459] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 62.333462] RIP: 0033:0x7fdd867e93a7 [ 62.333465] Code: 48 89 fa 4c 89 df e8 78 b3 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff [ 62.333468] RSP: 002b:00007fffca637ab0 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 [ 62.333472] RAX: ffffffffffffffda RBX: 00007fdd86757780 RCX: 00007fdd867e93a7 [ 62.333474] RDX: 0000000000000902 RSI: 000056281beeb004 RDI: ffffffffffffff9c [ 62.333476] RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 [ 62.333478] R10: 0000000000000000 R11: 0000000000000202 R12: 000056281beeb01c [ 62.333479] R13: 000056281beed0c0 R14: 0000000000000040 R15: 000056281beeb004 [ 62.333482] </TASK> [ 62.333484] Allocated by task 1473: [ 62.333486] kasan_save_stack+0x30/0x50 [ 62.333489] kasan_save_track+0x14/0x30 [ 62.333491] __kasan_kmalloc+0x8f/0xa0 [ 62.333493] __kmalloc_noprof+0x1ae/0x460 [ 62.333497] load_elf_phdrs+0xd4/0x190 [ 62.333500] load_elf_binary+0x1dd/0x4700 [ 62.333503] bprm_execve+0x6c7/0x12c0 [ 62.333506] do_execveat_common.isra.0+0x3c4/0x540 [ 62.333508] __x64_sys_execve+0x8e/0xc0 [ 62.333510] do_syscall_64+0xdf/0x4b0 [ 62.333513] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 62.333516] Freed by task 1473: [ 62.333517] kasan_save_stack+0x30/0x50 [ 62.333519] kasan_save_track+0x14/0x30 [ 62.333522] kasan_save_free_info+0x3b/0x70 [ 62.333525] __kasan_slab_free+0x43/0x70 [ 62.333527] kfree+0x135/0x390 [ 62.333530] load_elf_binary+0x1834/0x4700 [ 62.333533] bprm_execve+0x6c7/0x12c0 [ 62.333536] do_execveat_common.isra.0+0x3c4/0x540 [ 62.333538] __x64_sys_execve+0x8e/0xc0 [ 62.333540] do_syscall_64+0xdf/0x4b0 [ 62.333542] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 62.333545] The buggy address belongs to the object at ffff88800374d000 which belongs to the cache kmalloc-1k of size 1024 [ 62.333548] The buggy address is located 288 bytes inside of freed 1024-byte region [ffff88800374d000, ffff88800374d400) [ 62.333551] The buggy address belongs to the physical page: [ 62.333553] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3748 [ 62.333556] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 62.333558] flags: 0x100000000000040(head|node=0|zone=1) [ 62.333561] page_type: f5(slab) [ 62.333565] raw: 0100000000000040 ffff888001041dc0 dead000000000100 dead000000000122 [ 62.333567] raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 [ 62.333570] head: 0100000000000040 ffff888001041dc0 dead000000000100 dead000000000122 [ 62.333572] head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 [ 62.333574] head: 0100000000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff [ 62.333576] head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 62.333577] page dumped because: kasan: bad access detected [ 62.333579] Memory state around the buggy address: [ 62.333580] ffff88800374d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 62.333582] ffff88800374d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 62.333584] >ffff88800374d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 62.333585] ^ [ 62.333586] ffff88800374d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 62.333588] ffff88800374d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb I also run the same PoC against a patched kernel containing my fix and it resolved the use-after-free issue. If you need more information please let me know! Thanks, Yannick Müller On Dec 1, 2026, at 11:18 AM, netdev-bot+sinfo@kernel.org wrote: Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. - Whether the issue was actually triggered, or is only theoretical (e.g. found by LLM and not proven at runtime). If it was triggered please include the symptoms, like the stack trace or kernel messages. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. *IMPORTANT*: If you do repost (for other reasons) - please include the relevant info in the cover letter or commit messages. -- The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.

The mailing lists rejects HTML so this never made it to the list (and is
pretty unreadable for the rest of us as you can see above).

Johan
Technical Details
Message-ID: <axFqeMR310lFgrVN@hovoldconsulting.com>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376622-linux-kernel-netdev=dewy.ru
References: <20261201101336.164922-1-mail@ynnk.dev> <179612033434.3305.13685457274572639061@kernel.org> <f261c2e9-6235-4564-ab6f-b05ec892d64b@me.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376622-linux-kernel-netdev=dewy.ru
From: johan@kernel.org (Johan Hovold)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: hso: fix use-after-free after failed tty open
Date: Thu, 3 Dec 2026 14:11:20 +0100
Organization: Usenet Network
Message-ID: <axFqeMR310lFgrVN@hovoldconsulting.com>
References: <20261201101336.164922-1-mail@ynnk.dev> <179612033434.3305.13685457274572639061@kernel.org> <f261c2e9-6235-4564-ab6f-b05ec892d64b@me.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network; logging-data="2499298"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:A+qJk9A10Shzh+EDxKH5DnwLuEA= sha256:AXqraItVQB8kIJlQZvE4OJ5wF/R94Jd7uHCRg9x6fZ4= sha1:iQ88vD5RzDMzvqegDzo3TyhAOvY= sha256:E6Qa1jkNvNqBqPPUeA3c7duD0GnIKmJU7OU8IE0b+s0=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 14F92117957; Thu,  3 Dec 2026 16:11:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.54
X-Spam-Status: No, score=-2.54 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0cEcXq7c9BhP; Thu,  3 Dec 2026 16:11:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376622-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B8CB3117952; Thu,  3 Dec 2026 16:11:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 7C7EA2AB15; Thu,  3 Dec 2026 13:11:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796303489; b=m+W2JIRczQfAflb1SWictsXKRHmeb8uZt6y1pAZQ4OtJtBlPPkcL6WzOwGRbu88PKQao CBBi/dQNJANpk13HnrX4RR+BnNflPgLxHrIgY1cbFHMXPfwT4o7OpSmuBjNmFPEyGw4MH VVfySdaOlhpk88YdxV2d7RkGig3OitamNDLZgMgSQmLaZwAIYDwSOV3PB47MjetARS48D /XwtTVrejRR/+3V+pBd9smVqL1vNzcPAzyZcLMAvj2YaGsVzLW4DzvA194JU7H/WohTNC TeLKzh8Iqy6ilw5ttb6ftYb5kmOWG2Giry495C+3CpRLA35527UTJpNPxWF4YS5S7MA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796303489; h=X-Original-To:Received:Received:DKIM-Signature:Received:Date:From:To: Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=Tyy02rIbLIXdczXCKN+yVU9BMyFm/IiEdDfZOLEnRwE=; b=dUrfVfhjPBURV5P6RQ9aZglpLHsvezwdItvR/wzt2k07yYQ2et3psViEQSPc2JS5T1GJ qr1zCwupxhAqMfkbyQH2byD5VoJd2q1w788VzL9j20NRIWRqStIWuW98YVbQGxYyT8Dux Tgv7vf5xgTbi8z6T8xvGuRYVU+jnZlXrjsvIp/EKecLBw6fBtUfNzWdfwNun4D3fETnEC 4UQbDT/hwkUVd2KsZhEB16VHuLo9WnZYgVbT1+79bkKx2fF2PZYLNwL+ZXfSYNEbrrz39 GiybTHmaCckrwg+15Dw5boYYtNyTJMeQyZbyrAhrRA6e+co6Je1QGs+UBsX5VijTJiw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=agTcIhAm; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 548AC606A330; Thu,  3 Dec 2026 13:11:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=agTcIhAm
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796303483; b=zu2OEf7kwOZWgAHeCdvPIq+nvnR7l0iXoPLNYLiWaAdKVySma1umiepZbq80VhzsW7eq qlgvpAvYbiTqKyPQAgDHjvwKn6NNUd2C5bP4gzdxhDVStKSGBdJtK6U6JbtaGHRJ0Kpug Bzb2ePQpuTYwrHoGPixY+OENCSZwzfYycp0UFyfgD5ERu33KIK2xMZI26f2TvKyZi/8Iv vcdZGhjce8nheOYkzn8lTQc0Y2xOWHbq1IbJudn3GzmEmP/wVSgpnjHHoxAjPVFeGV2ZC UvS1yZd1dphdllU2ALYsuiyg9+isPG8SUHCa/Qy2gJW9FiPe7VlFMgoscn4F7ukkkmQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796303483; h=Received:DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=Tyy02rIbLIXdczXCKN+yVU9BMyFm/IiEdDfZOLEnRwE=; b=kw8qvGV0C1GqRR3NbsbBR9bYTMcd2C4NQ8mP6QJGKf3z8kfSK6qwJ2IQNQFqgKAbBwtW Ul46Dj++A91GUxAz+jUZpODRET7n41yv5oxK4GYLuVx1nzO8V6VQCvch4QYH9xndT437n 8LAt0+X8jLlKrZURmp6KDZ6w1lRXj4WR7SR0VcQJBWzhGJOnaCmmL6+b5CbPTXtAOmHpY /7x1bzv8i1LLfBEr2+2hlCREb/5ZLykpkfSKHViAGmQbvz6o3CFU4/VuyoVpgBu0jcFR4 CedtFQm1h7Gq3qSnMGmwCW6A2Nvwgb85OU2r4Q+kLYZUAiMaQyBr6ci38DeQlkcX8Ow==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=agTcIhAm; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 703D1606A32C; Thu,  3 Dec 2026 13:11:23 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 225ED1F00893; Thu,  3 Dec 2026 13:11:23 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796303483; bh=Tyy02rIbLIXdczXCKN+yVU9BMyFm/IiEdDfZOLEnRwE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=agTcIhAmJbhCjGfdmJWyHEWUpkoWOf47KyKsaFlRM3sFmPfLVR9Qi20SjXR7TCkqa g5JgjV3N/kLwGpCTfhkEWbQg2zVU491nQsqzlcYGr9/rgw3QgbU+e/6XLiaxmC6fBU MHkKPtUIGdZ04yPluhezMBF6+n/g2ydROgDZrdYpQdcBK2bE409nXmoNkYo1d77Ur6 2yiVdsfgau10kW8SE2mJK6TGxYwhcTSPzDqAtRklYs5qlJRKm+mvM6LcDbq+/yRV8q 3p48FLw7zztIGXGngVCAj9MrOD0L6IQ8docJgsT3LhGwBDRfwcj0ubVdV8DB58ufqt bxOhzyxuY1aXg==
X-Received: from johan by xi.lan with local (Exim 4.100.2) (envelope-from <johan@kernel.org>) id 1xZ6am-00000005DA5-3UrG; Thu, 03 Dec 2026 14:11:20 +0100
X-Cc: netdev-bot+sinfo@kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-usb@vger.kernel.org, netdev@vger.kernel.org
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <f261c2e9-6235-4564-ab6f-b05ec892d64b@me.com>
X-Received-Bytes: 15009