Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
address `addr` still contains the value `val` (in the fashion of `futex(2)`).
If it doesn't then the call doesn't block. Else the calling thread is blocked
until a `PWQR_WAKE` command is received.
++
+`addr` must of course be a pointer to an aligned integer which stores the
+reference ticket in userland.
`PWQR_PARK`::
Puts the thread in park mode. Those are spare threads to avoid
preempt_notifier_unregister(&pwqt->notifier);
- if (is_wait && copy_from_user(&wait, arg, sizeof(wait))) {
- rc = -EFAULT;
- goto out;
+ if (is_wait) {
+ if (copy_from_user(&wait, arg, sizeof(wait))) {
+ rc = -EFAULT;
+ goto out;
+ }
+ if (unlikely((long)wait.pwqr_uaddr % sizeof(int) != 0)) {
+ rc = -EINVAL;
+ goto out;
+ }
}
pwqr_sb_lock_irqsave(sb, flags);