Skip to content

Commit

Permalink
futex: Mark restart_block.futex.uaddr[2] __user
Browse files Browse the repository at this point in the history
@uaddr and @uaddr2 fields in restart_block.futex are user
pointers. Add __user and remove unnecessary casts.

Signed-off-by: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Darren Hart <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
namhyung authored and KAGA-KOKO committed Sep 18, 2010
1 parent 1dcc41b commit a3c74c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/linux/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ struct restart_block {
};
/* For futex_wait and futex_wait_requeue_pi */
struct {
u32 *uaddr;
u32 __user *uaddr;
u32 val;
u32 flags;
u32 bitset;
u64 time;
u32 *uaddr2;
u32 __user *uaddr2;
} futex;
/* For nanosleep */
struct {
Expand Down
4 changes: 2 additions & 2 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ static int futex_wait(u32 __user *uaddr, int fshared,

restart = &current_thread_info()->restart_block;
restart->fn = futex_wait_restart;
restart->futex.uaddr = (u32 *)uaddr;
restart->futex.uaddr = uaddr;
restart->futex.val = val;
restart->futex.time = abs_time->tv64;
restart->futex.bitset = bitset;
Expand All @@ -1869,7 +1869,7 @@ static int futex_wait(u32 __user *uaddr, int fshared,

static long futex_wait_restart(struct restart_block *restart)
{
u32 __user *uaddr = (u32 __user *)restart->futex.uaddr;
u32 __user *uaddr = restart->futex.uaddr;
int fshared = 0;
ktime_t t, *tp = NULL;

Expand Down

0 comments on commit a3c74c5

Please sign in to comment.