|
From: | Diego Nieto Cid |
Subject: | Re: [PATCH v16] kern: simple futex for gnumach |
Date: | Fri, 17 Jan 2014 22:49:25 -0200 |
El ene 17, 2014 11:36 a.m., "Marin Ramesa" <mpr@hi.t-com.hr> escribió:
>
> +
> +kern_return_t
> +futex_wait(task_t task, vm_offset_t futex_address, int value,
> + mach_msg_timeout_t msec, boolean_t private_futex)
> +{
> + if (private_futex) {
> + struct private_futex *futex;
> +
> + futex = futex_private_lookup_address(futex_address);
> + if (futex == NULL) {
> + futex = futex_private_init(futex_address);
> + if (futex == NULL)
> + return KERN_RESOURCE_SHORTAGE;
> + }
> +
> + if (__atomic_load_n(
> + (int *) futex_address, __ATOMIC_RELAXED) == value) {
Are you sure you can dereference futex_address?
It's a user supplied virtual address which is probably not valid in the kernel's virtual address space (unless things like copyin are used)
I have the vague idea that the kernel has it's own address space. Can somebody confirm that? :-)
[Prev in Thread] | Current Thread | [Next in Thread] |