Skip to content

Instantly share code, notes, and snippets.

@erosca
erosca / console
Last active April 30, 2024 07:55
dev_uevent: KASAN: null-ptr-deref
rcar-h3-salvator-x (root) # while true; do modprobe ds90ux9xx-dummy; msleep $(( RANDOM % 100 )); modprobe -r ds90ux9xx-dummy; done &
[1] 2795
rcar-h3-salvator-x (root) # while true; do cat /sys/bus/i2c/devices/5-000f/uevent > /dev/null; done
[ 185.570549][ T3677] Device: 5-000f - pid: 3677
[ 185.575433][ T3677] Unable to handle kernel paging request at virtual address dfff800000000000
[ 185.584471][ T3677] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
[ 185.592982][ T3677] Mem abort info:
[ 185.596651][ T3677] ESR = 0x0000000096000005
[ 185.601311][ T3677] EC = 0x25: DABT (current EL), IL = 32 bits
[ 185.607473][ T3677] SET = 0, FnV = 0
#!/bin/bash -e
ABS_ROOT=/tmp/aaaaaaaa/bbbb/cccccc/ddddddddddddddddddddddddddddddddddd/eeeeeee/fffff/ggggg/hhhhhhh
ABS_KOBJ=$ABS_ROOT/iii/jjjjjj/kkkkkkk/llllllllllll/mmm/nnnnnnnn/ooooooooooooooo/pppppppppppppp
ABS_KSRC=$ABS_ROOT/kernel_platform/msm-kernel
REL_KMOD=../../vendor/qcom/opensource/audio-kernel
ABS_KMOD=$ABS_KSRC/$REL_KMOD
mkdir -p $ABS_ROOT
mkdir -p $ABS_KOBJ
@erosca
erosca / gist:7b5f1dadd4172b38461478d38c1040b8
Created September 7, 2022 13:51
[4.9.327 / 4.14.292 / 4.19.257] WARNING: inconsistent lock state => inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage
### .config used: https://gist.github.com/erosca/b6f6b048f0dd4cb0296951107ec31871
###
### Culprit commits:
### v4.19.238 commit https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=242a3e0c75b6
### v4.14.276 commit https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dd7d3a609aac
### v4.9.311 commit https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6180bbce5273
##############################################################################################
[ 7.432028] ================================
@erosca
erosca / gist:b6f6b048f0dd4cb0296951107ec31871
Created September 7, 2022 13:21
.config for reproducing "WARNING: inconsistent lock state" on 4.14.292
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 4.14.292 Kernel Configuration
#
CONFIG_ARM64=y
CONFIG_64BIT=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_MMU=y
CONFIG_ARM64_PAGE_SHIFT=12
CONFIG_ARM64_CONT_SHIFT=4
@erosca
erosca / gist:690c3e6065b55546e511f9ef8ba59625
Last active March 23, 2022 21:08
I2C/SMBus test setup (configuration & compiler)
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.17.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=100301
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23601
@erosca
erosca / ffs2.sh
Created June 4, 2021 10:33
BUG: KASAN: use-after-free in ffs_data_clear+0x70/0x370 [usb_f_fs]
Kernel: v5.13-rc4-88-gf88cd3fb9df2
GCC: aarch64-linux-gnu-gcc 10.0.0 20191203
HW: Renesas R-Car H3-ES2.0-Salvator-X
root@rcar-gen3:~# cat ffs2.sh
mkdir -p /dev/ffs
mkdir -p /dev/cfs
modprobe libcomposite
mount -t configfs none /dev/cfs
mkdir -p /dev/cfs/usb_gadget/g1
@erosca
erosca / ffs1.sh
Last active June 4, 2021 10:34
BUG: KASAN: use-after-free in ffs_release_dev+0x64/0xa8 [usb_f_fs]
Kernel: v5.13-rc4-88-gf88cd3fb9df2
GCC: aarch64-linux-gnu-gcc 10.0.0 20191203
HW: Renesas R-Car H3-ES2.0-Salvator-X
root@rcar-gen3:~# cat ffs1.sh
mkdir -p /dev/ffs
mkdir -p /dev/cfs
modprobe libcomposite
mount -t configfs none /dev/cfs
mkdir -p /dev/cfs/usb_gadget/g1
[ 5.452796] Starting kernel ...
[ 5.456062]
[ 5.457604] [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd073]
[ 0.000000] Linux version 5.7.0-rc2-00073-g8829cae72218 (erosca@lxhi-065) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)), GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #134 SM0
[ 0.000000] Machine model: Renesas H3ULCB Kingfisher board based on r8a77951
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 32 MiB at 0x000000007e000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000048000000-0x000000073fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x73f7e0100-0x73f7e1fff]
@erosca
erosca / gist:ac779c348dd272c448e162c406c48f4a
Last active April 21, 2020 23:32
[5.7.0-rc2-00069-g18bf34080c4c] NFS4: Couldn't follow remote path
[ 5.425913] Starting kernel ...
[ 5.429179]
[ 5.430721] [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd073]
[ 0.000000] Linux version 5.7.0-rc2-00069-g18bf34080c4c (erosca@lxhi-065) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)), GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #133 SM0
[ 0.000000] Machine model: Renesas H3ULCB Kingfisher board based on r8a77951
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 32 MiB at 0x000000007e000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000048000000-0x000000073fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x73f7e0100-0x73f7e1fff]
=> part list mmc 0
Partition Map for MMC device 0 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 2048 524288 c3d57e39-01 83
2 526336 8388608 c3d57e39-02 83
3 8914944 22201344 c3d57e39-03 05 Extd
5 8916992 524288 c3d57e39-05 83
6 9443328 2097152 c3d57e39-06 83