[LTP] [PATCH v15 1/2] futex_wake05: Add EFAULT error coverage test

Cyril Hrubis chrubis@suse.cz
Wed Jun 17 15:07:38 CEST 2026


Hi!
> +/*\
> + * Check that futex(FUTEX_WAKE) returns EFAULT when uaddr points to
> + * unmapped, PROT_NONE, or kernel-space memory.
> + *
> + * For the unmapped and PROT_NONE cases, opflags=0 (no FUTEX_PRIVATE_FLAG)
> + * ensures futex_wake() takes the shared-futex path in get_futex_key()
> + * which must resolve the physical page. For PROT_NONE memory this page
> + * lookup fails with EFAULT, even though futex_wake() never reads *uaddr.
> + *
> + * The three cases exercise different code paths: a kernel-space address
> + * is rejected by the kernel's user-space address check before physical
> + * page resolution; unmapped memory fails at find_vma() (no VMA exists);
> + * PROT_NONE memory fails at get_user_pages_fast() (VMA exists but page
> + * is inaccessible).

Now we have to paragraphs here with some amount of duplicit information,
I would simplify it as:

...
* For opflags=0 (no FUTEX_PRIVATE_FLAG) futex_wake() takes the
* shared-futex path in get_futex_key() which must resolve the physical
* page.
*
* The three cases exercise different code paths: a kernel-space address
* is rejected by the kernel's user-space address check before physical
* page resolution; unmapped memory fails at find_vma() (no VMA exists);
* PROT_NONE memory fails at get_user_pages_fast() (VMA exists but page
* is inaccessible).
...


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list