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/.fasyncfile 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/_IOWRioctl commands, including 32-bitcompat_ioctlon 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.