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

Cyril Hrubis <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
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
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.