From nobody Mon Sep 28 06:35:54 2026 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926A047FAFE for ; Tue, 25 Aug 2026 15:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787670429; cv=none; b=Ia6ny5x/Zyb7QtD6s+LjJhJt8kO4/WGUFjw5vG55lyLtwJ9VnyE9/ZoflScV0+sE7r672xulmxtuaXnhM/qfvjxxQLBGrHfsWK0Nh1MaDVuOy3hPrUR/tTn3jTuhkCunx3e7+kt/71xXk8McJGNTVF0N7CICEoN8NjUoKrKchEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787670429; c=relaxed/simple; bh=ly7897731+VvttzNl0094AzP1tPEtuY5mxRbjgz//oM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LJMDq6rx2FkUqaF04acloSp83MNJE0wFxa2yrASekzv4qZKWlyLibNDgh5gljO+6AlWp/BnZ+0Npo/3mcssXq5NhCFzhHRFL9HONLIqR2i6XlwDLO6N0Bm62TghKjU9kBir9p0lvOV+jsDBlWBFx4/9RYLXjPZ9SrkPjbe4rpks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=snu.ac.kr; spf=pass smtp.mailfrom=snu.ac.kr; dkim=pass (1024-bit key) header.d=snu.ac.kr header.i=@snu.ac.kr header.b=twByNmWt; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=snu.ac.kr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=snu.ac.kr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=snu.ac.kr header.i=@snu.ac.kr header.b="twByNmWt" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-3964dfb5b9aso1066500a91.1 for ; Tue, 25 Aug 2026 08:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snu.ac.kr; s=google; t=1787670422; x=1788275222; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=TEcUlcO5OMpU25UL/7E+tl0pMAtyazvUdbJKhRWj8jU=; b=twByNmWtQ5gNVvoaKpasCNt+Zus+RKDfKUMDcT4JQRb/JPB/boeWDQz4ovz/NslBQY NNqpywXptmU8xkIdY4UyxlLgKPLH1/YUIdcUmg2BHYvP+SYbnqjJdwn2xtpYWiAq8cF+ 7IbXxIr5OiGCI7Xto1J4orgEtx+6RAPgDlkzY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787670422; x=1788275222; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TEcUlcO5OMpU25UL/7E+tl0pMAtyazvUdbJKhRWj8jU=; b=BWlJrInaZjfIDCZz13H6nwTXFpPOdVnHGXBQPDTIVZQJnNwFX3C/YggZxexxNSo0mb QBvgxauhlUqcJCAtRLxXHha5b0Wbq3kriCiTL4fFAXQtG4sfBc46O+Hk2DEE/2vaqlfz LeBhX95OTthrzgTiV7OPRfNItr/LiPxvzifJMoCFn4KunoCFsOM5loXqhWJmBuD3uP01 TKBrffvhvj/p7vKfglPfffYH2ctNCxmv8OHz5xJvjcFpwfGUNmCYHxOB67N8BIrTKjue WkXhRv/fJltcPh2nQJ91VhLz4Bb5SW3Atzyid4eyjx9dsdRqTHp+XPkVUMP2mvynpS+H yJZQ== X-Forwarded-Encrypted: i=1; AHgh+Rq6F5m+s4HN7dx9w5ie3eUihjXjiNOeWBhJy5GieCuPAzRTok0TZsERRvwoYZZdu/j0MOGOi8SXi66UdtE=@vger.kernel.org X-Gm-Message-State: AFuF++nRtOF6DpslPEe2Y8nYOq/OSLbW2bglONIp7o1eKcjGXIjDAKP4 QDBuwE30wZiOHNXpTJUxM4T0aWUhZ3I89D9hGb/8iR3wLy1no3704NfvGhORvYM0ZNSKJMc4eNw SouIQDXA= X-Gm-Gg: AR+sD13DcPmNAAYnlTE/tFuHpH7ApsZJAoZCIgx2HtgOQZVzgJiiRVFzyqNTK3WkmUD 2wsptDlgLuS7UFUdpuFK7ktl2iqDCPTS8+rKeAgEX5PX8SyPN+LjBo39MmVkfA7jiZo0xRXmeXo wZZMgA/n78mn7WdG24jhYy7UsL2qVR4BrsNCBlglt00pF7giJnR2Hu1cwBj4oFW9hOYMC1aVv5R mr8WPdcGhhc84T2JSuB4FY1XNqe1k6qk+JfNyheq0i9LgDGQYSjOGhV5081Iwx4b4Hu1fjcDcra LdWWfPgv0PI/ziCPgemJ5i5WlAcbxGlLf+bnHqeGsNy2gOjetzWEZrmbKK+GPQ+E0pHIAAEgI+8 ObzBXkMOr5Y2GZd5+AanL+2uTDe+/gVHketXjLgkeYYW+4szWbcGSv2piZif/qzPVnbaICFBtk0 I983NE9g9fqRLGUbROk3oja0vMDOxrhYn4HiEu72qtl60g20pE9KWKTtpHmpr3oOvqcxLLKCCJy HK2a8bsEAKPOWrtxViSTk3yRcUv+LYlYQegwyGd6B7lbbi81ORbAudsCf3xVDyQT76D1KI8T/It IIF0ZpoZVRSPqXkJKBHG0lrgV1Bhwdzf9GTMtz9Hao9JczFa30yb8A== X-Received: by 2002:a17:90b:3b48:b0:393:1cf4:d972 with SMTP id 98e67ed59e1d1-395dee55f7emr47103024a91.3.1787670421953; Tue, 25 Aug 2026 08:07:01 -0700 (PDT) Received: from leesin ([147.46.121.37]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-396448095c5sm1433154a91.2.2026.08.25.08.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 08:07:01 -0700 (PDT) From: Jaeyoung Chung To: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com Cc: 726ksm@gmail.com, kees@kernel.org, linux-kernel@vger.kernel.org, eulgyukim@snu.ac.kr, jjy600901@snu.ac.kr Subject: [BUG] KASAN: slab-use-after-free Read in slip_receive_buf Date: Wed, 26 Aug 2026 00:06:54 +0900 Message-ID: <20260825150655.1450271-1-jjy600901@snu.ac.kr> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hello, We found a "KASAN: slab-use-after-free Read in slip_receive_buf" on Linux v= 7.2. The issue was found by our own race fuzzer. We have not analyzed the root c= ause, so we do not have a proposed fix to offer. To reproduce the race reliably, we applied the delay patch below to the kernel and ran the C reproducer as root inside an x86_64 QEMU guest. The crash log we observed, the delay patch and the reproducer are all included below. The following kernel config options are required to reproduce the issue: CONFIG_SLIP=3Dy CONFIG_LEGACY_TIOCSTI=3Dy CONFIG_UNIX98_PTYS=3Dy CONFIG_TTY=3Dy CONFIG_KASAN=3Dy We hope this report is useful. Please let us know if any further information would help. Reported-by: Eulgyu Kim Reported-by: Jaeyoung Chung Kernel delay patch: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index faae711cf793..328f54553cb5 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c @@ -689,6 +689,9 @@ static void slip_receive_buf(struct tty_struct *tty, co= nst u8 *cp, const u8 *fp, size_t count) { struct slip *sl =3D tty->disc_data; + if (sl && strncmp(current->comm, "syzrepro0", 10) =3D=3D 0) { + mdelay(1500); + } =20 if (!sl || sl->magic !=3D SLIP_MAGIC || !netif_running(sl->dev)) return; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D C reproducer: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #ifndef N_SLIP #define N_SLIP 1 #endif #ifndef TIOCSETD #define TIOCSETD 0x5423 #endif #ifndef TIOCSTI #define TIOCSTI 0x5412 #endif #ifndef TIOCVHANGUP #define TIOCVHANGUP 0x5437 #endif #define T1_HEAD_START_US 30000 static char g_marker[16] =3D "syzrepro"; static int g_fd =3D -1; static void set_thread_name(int idx) { char nm[16]; snprintf(nm, sizeof(nm), "%s%d", g_marker, idx); nm[15] =3D '\0'; if (prctl(PR_SET_NAME, nm, 0, 0, 0) !=3D 0) printf("repro: prctl(PR_SET_NAME, %s) failed: %s\n", nm, strerror(errno)); } static void *thread_use(void *arg) { unsigned char ch =3D 0x40; int r; (void)arg; set_thread_name(0); r =3D ioctl(g_fd, TIOCSTI, &ch); if (r !=3D 0) printf("repro: T0 TIOCSTI -> %d (%s)\n", r, strerror(errno)); return NULL; } static void *thread_free(void *arg) { int r; (void)arg; set_thread_name(1); usleep(T1_HEAD_START_US); r =3D ioctl(g_fd, TIOCVHANGUP, 0); if (r !=3D 0) printf("repro: T1 TIOCVHANGUP -> %d (%s)\n", r, strerror(errno)); return NULL; } int main(void) { int iters =3D 10; int i; setvbuf(stdout, NULL, _IONBF, 0); for (i =3D 0; i < iters; i++) { int fd, ldisc =3D N_SLIP; pthread_t t0, t1; fd =3D open("/dev/ptmx", O_RDWR | O_NOCTTY); if (fd < 0) { usleep(200000); continue; } if (ioctl(fd, TIOCSETD, &ldisc) !=3D 0) { close(fd); usleep(200000); continue; } g_fd =3D fd; if (pthread_create(&t0, NULL, thread_use, NULL) !=3D 0) { close(fd); continue; } if (pthread_create(&t1, NULL, thread_free, NULL) !=3D 0) { pthread_join(t0, NULL); close(fd); continue; } pthread_join(t0, NULL); pthread_join(t1, NULL); g_fd =3D -1; close(fd); } return 0; } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Crash log: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BUG: KASAN: slab-use-after-free in slip_receive_buf+0x89b/0x8b0 drivers/net= /slip/slip.c:696 Read of size 4 at addr ffff888107d24a80 by task syzrepro0/400 CPU: 2 UID: 0 PID: 400 Comm: syzrepro0 Not tainted 7.2.0-dirty #3 PREEMPT=20 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1= .1 04/01/2014 Call Trace: dump_stack_lvl+0x5e/0x80 lib/dump_stack.c:120 print_address_description+0x77/0x200 mm/kasan/report.c:378 print_report+0x64/0x70 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 slip_receive_buf+0x89b/0x8b0 drivers/net/slip/slip.c:696 tiocsti+0x165/0x1c0 drivers/tty/tty_io.c:2290 tty_ioctl+0x76c/0xa40 drivers/tty/tty_io.c:2706 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xb6/0x100 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf7/0x370 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7b142e575d6b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 = 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 f= f ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007b142e473e60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007b142e4746c0 RCX: 00007b142e575d6b RDX: 00007b142e473ec7 RSI: 0000000000005412 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000064 R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffff80 R13: 0000000000000000 R14: 00007ffc1370b9a0 R15: 00007b142dc74000 Allocated by task 399: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x72/0x90 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5334 [inline] __kvmalloc_node_noprof+0x36a/0x620 mm/slub.c:6905 alloc_netdev_mqs+0x8c/0x1170 net/core/dev.c:12059 sl_alloc drivers/net/slip/slip.c:763 [inline] slip_open+0x280/0x970 drivers/net/slip/slip.c:824 tty_ldisc_open+0x83/0xc0 drivers/tty/tty_ldisc.c:432 tty_set_ldisc+0x2f8/0x4b0 drivers/tty/tty_ldisc.c:563 tty_ioctl+0x822/0xa40 drivers/tty/tty_io.c:2728 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xb6/0x100 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf7/0x370 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e Freed by task 401: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x3a/0x60 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2677 [inline] slab_free mm/slub.c:6377 [inline] kfree+0x16c/0x3e0 mm/slub.c:6692 device_release+0xbc/0x1b0 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x142/0x1c0 lib/kobject.c:737 netdev_run_todo+0x392/0x10b0 net/core/dev.c:11760 rtnl_net_unlock include/linux/rtnetlink.h:135 [inline] rtnl_net_dev_unlock net/core/dev.c:2180 [inline] unregister_netdev+0x10d/0x160 net/core/dev.c:12532 tty_ldisc_hangup+0x163/0x3d0 drivers/tty/tty_ldisc.c:705 __tty_hangup+0x50c/0x770 drivers/tty/tty_io.c:621 tty_vhangup drivers/tty/tty_io.c:691 [inline] tty_ioctl+0x27f/0xa40 drivers/tty/tty_io.c:2732 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xb6/0x100 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf7/0x370 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e The buggy address belongs to the object at ffff888107d24000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 2688 bytes inside of freed 4096-byte region [ffff888107d24000, ffff888107d25000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107d20 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888107d21011 flags: 0x200000000000040(head|node=3D0|zone=3D2) page_type: f5(slab) raw: 0200000000000040 ffff88810004a280 dead000000000100 dead000000000122 raw: 0000000000000000 0000200000040004 00000000f5000000 ffff888107d21011 head: 0200000000000040 ffff88810004a280 dead000000000100 dead000000000122 head: 0000000000000000 0000200000040004 00000000f5000000 ffff888107d21011 head: 0200000000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888107d24980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888107d24a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888107d24a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888107d24b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888107d24b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D