Skip to content

Instantly share code, notes, and snippets.

View yskzalloc's full-sized avatar
🏠
Working from home

Yunseong Kim yskzalloc

🏠
Working from home
View GitHub Profile
@yskzalloc
yskzalloc / qdisc-null-ptr-deref.c
Last active June 21, 2024 16:06
Yun Levi and I submit the Linux kernel patch for fixing the NULL pointer dereference that can occur in perf trace events when using the veth and Bluetooth device. It's twice as fun working on it together! 💪 😎 😎 👍 kernel mailing list: https://lore.kernel.org/all/20240621114551.2061-3-yskelg@gmail.com/ bugzilla: https://bugzilla.redhat.com/show_bu…
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syscall.h>
@yskzalloc
yskzalloc / kprobe_insn_boundary-stall.txt
Created June 27, 2024 03:48
scripts/decode_stacktrace.sh /usr/lib/debug/boot/vmlinux-6.8.0-36-generic $HOME/linux-source-6.8.0 < kprobe_insn_boundary-stall.txt
rcu: INFO: rcu_sched detected stalls on CPUs/tasks:s:
rcu:
(detected by 0, t=6002 jiffies, g=24353, q=1 ncpus=1)1)
rcu: All QSes seen, last rcu_sched kthread activity 6002 (4294978930-4294972928), jiffies_till_next_fqs=1, root ->qsmask 0x0x0
rcu: rcu_sched kthread starved for 6002 jiffies! g24353 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=0=0
rcu:
Unless rcu_sched kthread gets sufficient CPU time, OOM is now expected behavior.r.
rcu: RCU grace-period kthread stack dump:p:
task:rcu_sched state:R running task stack:0 pid:16 tgid:16 ppid:2 flags:0x0000000000
Call Trace:e:
@yskzalloc
yskzalloc / perf-disabled-child.c
Last active July 24, 2025 18:48
Triggers kernel WARN and UBSAN by creating a disabled child perf event in a hardware event group. Link: https://lore.kernel.org/lkml/aIIT7fq3xG9qtRD8@J2N7QTR9R3/
/*
* Reproducer by Mark Rutland <mark.rutland@arm.com>
* Triggers kernel WARN and UBSAN with disabled child perf event.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/syscall.h>
@yskzalloc
yskzalloc / PREEMPT_RT-perf-soft-lockup.log
Created July 25, 2025 00:00
https://lore.kernel.org/linux-rt-devel/20250610080307.LMm1hleC@linutronix.de/ ``` $ git remote add rt-devel git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git $ git checkout v6.16-rc1-rt1 ``` Arm64 Server - RADXA Orion6 - Armv9.2 Architecture - Quad Big Cortex®-A720 Up to 2.6GHz - Quad Medium Cortex®-A720 Up to 2.4GHz - Quad Lit…
perf lockup
watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [syz.1.915:10188]
CPU#2 Utilization every 4s during lockup:
#1: 100% system, 0% softirq, 0% hardirq, 0% idle
#2: 100% system, 0% softirq, 0% hardirq, 0% idle
#3: 100% system, 0% softirq, 1% hardirq, 0% idle
#4: 100% system, 0% softirq, 0% hardirq, 0% idle
#5: 100% system, 0% softirq, 0% hardirq, 0% idle
Modules linked in:
@yskzalloc
yskzalloc / PREEMPT_RT-hardlockup.log
Created July 25, 2025 00:05
https://lore.kernel.org/linux-rt-devel/20250610080307.LMm1hleC@linutronix.de/ ``` $ git remote add rt-devel git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git $ git checkout v6.16-rc1-rt1 ``` Arm64 Server - RADXA Orion6 - Armv9.2 Architecture
📃 coverage
🤖 syscalls
🛒 corpus
💻 VMs
🔧 config
Kernel panic - not syncing: Hard LOCKUP
CPU: 1 UID: 0 PID: 9003 Comm: systemd-rfkill Tainted: G W 6.16.0-rc1-rt1 #11 PREEMPT_RT
Tainted: [W]=WARN
@yskzalloc
yskzalloc / kcov-usb-invalid-sleeping.log
Created July 25, 2025 19:33
PREEPT_RT have BUG from f85d39dd7ed8 ("kcov, usb: disable interrupts in kcov_remote_start_usb_softirq")
[ 114.639440][ C1] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[ 114.639474][ C1] in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 30, name: ksoftirqd/1
[ 114.639483][ C1] preempt_count: 0, expected: 0
[ 114.639488][ C1] RCU nest depth: 2, expected: 2
[ 114.639501][ C1] CPU: 1 UID: 0 PID: 30 Comm: ksoftirqd/1 Tainted: G W 6.16.0-rc1-rt1 #11 PREEMPT_RT
[ 114.639516][ C1] Tainted: [W]=WARN
[ 114.639519][ C1] Hardware name: QEMU KVM Virtual Machine, BIOS 2025.02-8 05/13/2025
[ 114.639525][ C1] Call trace:
[ 114.639529][ C1] show_stack+0x2c/0x3c (C)
[ 114.639561][ C1] __dump_stack+0x30/0x40
@yskzalloc
yskzalloc / gist:cd33d735406dc1b532fc0194eac73b70
Last active August 14, 2025 06:29
coccicheck for the atomic in sleep for the PREEMPT_RT Linux Kernel
make[1]: Entering directory '/home/ysk/linux/fs/gfs2'
Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.
/home/ysk/.local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file /home/ysk/linux/scripts/coccinelle/api/alloc/alloc_cast.cocci --no-includes --include-headers --patch /home/ysk/linux --dir . -I /home/ysk/linux/arch/arm64/include -I /home/ysk/linux/arch/arm64/include/generated -I /home/ysk/linux/include -I /home/ysk/linux/include -I /home/ysk/linux/arch/arm64/include/uapi -I /home/ysk/linux/arch/arm64/include/generated/uapi -I /home/ysk/linux/include/uapi -I /home/ysk/linux/include/generated/uapi --include /home/ysk/linux/include/linux/compiler-version.h --include /home/ysk/linux/include/linux/kconfig.h --jobs 6 --chunksize 1 --use-idutils --use-glimpse --very-quiet --jobs 12
can't open glimpse index-file /home/ysk/linux/fs/gfs2/.glimpse_index
(use -H to give an index-directory or run 'glimpseind
@yskzalloc
yskzalloc / atomic sleep check on gfs2 with cocci
Created August 16, 2025 02:52
This is WIP for atomic sleep check in linux kernel with cocci check. `make coccicheck COCCI=../../scripts/coccinelle/rt/sleep_in_atomic.cocci MODE=report M=./fs/gfs2 2>&1 | tee gfs2-rt.log`
make[1]: Entering directory '/home/ysk/linux/fs/gfs2'
Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.
/home/ysk/.local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ../../scripts/coccinelle/rt/sleep_in_atomic.cocci --no-includes --include-headers --patch /home/ysk/linux --dir . -I /home/ysk/linux/arch/arm64/include -I /home/ysk/linux/arch/arm64/include/generated -I /home/ysk/linux/include -I /home/ysk/linux/include -I /home/ysk/linux/arch/arm64/include/uapi -I /home/ysk/linux/arch/arm64/include/generated/uapi -I /home/ysk/linux/include/uapi -I /home/ysk/linux/include/generated/uapi --include /home/ysk/linux/include/linux/compiler-version.h --include /home/ysk/linux/include/linux/kconfig.h --jobs 6 --chunksize 1
Error: Required data (ATOMIC_CALLEES, POTENTIAL_SLEEPERS, or CALL_GRAPH) not collected.
Debug: POTENTIAL_SLEEPERS = {'gfs2_quota_sync': {'mutex_lock() at ./quota.c:1324 (is a sleeping l
@yskzalloc
yskzalloc / openssl-oqs.log
Created September 17, 2025 21:02
liboqs(https://github.com/open-quantum-safe/liboqs): 1698d86177c51aeea3f22eb531a793625edd321f, oqs-provider(https://github.com/open-quantum-safe/oqs-provider): 39c5ab11246d6426720d72c0a74510d5d26de9f1
$ git clone https://github.com/open-quantum-safe/liboqs.git
$ cd liboqs
$ mkdir build && cd build
$ cmake -DBUILD_SHARED_LIBS=ON -DOQS_ALGS_ENABLED="All" -DOQS_ENABLE_SIG_STFL_LMS=ON -DCMAKE_INSTALL_PREFIX=$HOME/.local -DOQS_USE_OPENSSL=ON..
$ sed -i "s/false/true/g" oqs-template/generate.yml && LIBOQS_SRC_DIR=$HOME/liboqs python3 oqs-template/generate.py
$ git clone https://github.com/open-quantum-safe/oqs-provider.git
$ cd oqs-provider/
$ mkdir build
@yskzalloc
yskzalloc / compac.syzlang
Last active October 7, 2025 06:34
Reproducible hung task on https://github.com/maxbyungchulpark/linux-dept/pull/2 ` ./syz-execprog -threaded=1 -repeat=0 -procs=8 -collide=1 -disable=binfmt_misc,cgroups,close_fds,devlink_pci,ieee802154,net_dev,net_reset,nic_vf,swap,sysctl,tun,usb,vhci,wifi compact.syzlang`
2m28.194272433s ago: executing program 7 (id=14399):
r0 = openat$vimc2(0xffffffffffffff9c, &(0x7f00000002c0), 0x2, 0x0)
close(r0)
openat$sysctl(0xffffffffffffff9c, &(0x7f0000000080)='/proc/sys/vm/compact_memory\x00', 0x1, 0x0)
pwritev2(r0, &(0x7f0000000040)=[{&(0x7f00000000c0)='1', 0x1}], 0x1, 0x0, 0x2, 0x10)
r1 = openat$ppp(0xffffffffffffff9c, &(0x7f0000000000), 0x400, 0x0)
ioctl$PPPIOCGNPMODE(r1, 0xc008744c, &(0x7f0000000100)={0x29})
ioctl$sock_inet6_SIOCADDRT(0xffffffffffffffff, 0x890b, 0x0)
syz_mount_image$btrfs(&(0x7f0000005100), &(0x7f00000002c0)='./file0\x00', 0x0, &(0x7f0000005180), 0x0, 0x50e7, &(0x7f00000051c0)="$eJzs3U+IVVUcB/DzZpxxUpl5gcbUbGwrgeIiSDEHI2jC4JWrCnR0EYSQgxTUQhBdSLRoQAl0pYRCITE7Ny6kwBBCaRdUECFCiCC1kP4sYt6958595/rue45jY/r5xMy95/7uOfe8x13M9+W5LwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAI4dxTe07V1bdMbVh3fmrnjRO7r945d+zylRAa7eONvL5nxytvvLNrz2sjscP069m22ew2ZNb1l6wx3HFwvl/nz94QwlAywGC+fXmwMmp592B1wFpH1p6cGL+14+KZibNrth9qHKi+dOaNLPcElkt+X11fuJcm278Hk