kernel-uaccess-safety

Installation
SKILL.md

Kernel UAccess Safety

Rules for exchanging data between a Linux kernel driver and user space without -EFAULT, crashes, or privilege-escalation holes. Load references/uaccess.md before writing any copy_to_user, ioctl, or mmap path.

When to use

  • Implementing or reviewing .read / .write / .ioctl / .mmap / .poll / .fasync file operations.
  • Copying data across the boundary (copy_to_user, copy_from_user, get_user, put_user, strncpy_from_user, strnlen_user).
  • Handling _IO / _IOW / _IOR / _IOWR ioctl commands, including 32-bit compat_ioctl on 64-bit kernels.
  • Mapping device memory with remap_pfn_range / pgprot_noncached.
  • Debugging -EFAULT, -ENOTTY, or SIGSEGV symptoms in drivers.
  • Reviewing patches for CWE-787 / CWE-252 / CWE-190 / CWE-191.

When not to use

Installs
2
GitHub Stars
2
First Seen
Sep 3, 2026