Messages in this thread Patch in this message | | | From | WANG Cong <> | Subject | [PATCH 03/16] fs: use get_personality() | Date | Sat, 23 Feb 2008 16:14:06 +0800 |
| |
Use get_personality() macro instead of explicit reference.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
--- fs/binfmt_elf.c | 6 +++--- fs/compat.c | 6 +++--- fs/select.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 41a958a..1b5803f 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -516,7 +516,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top) unsigned int random_variable = 0; if ((current->flags & PF_RANDOMIZE) && - !(current->personality & ADDR_NO_RANDOMIZE)) { + !(get_personality() & ADDR_NO_RANDOMIZE)) { random_variable = get_random_int() & STACK_RND_MASK; random_variable <<= PAGE_SHIFT; } @@ -744,7 +744,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) if (elf_read_implies_exec(loc->elf_ex, executable_stack)) current->personality |= READ_IMPLIES_EXEC; - if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) + if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space) current->flags |= PF_RANDOMIZE; arch_pick_mmap_layout(current->mm); @@ -969,7 +969,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) arch_randomize_brk(current->mm); #endif - if (current->personality & MMAP_PAGE_ZERO) { + if (get_personality() & MMAP_PAGE_ZERO) { /* Why this, you ask??? Well SVr4 maps page 0 as read-only, and some applications "depend" upon this behavior. Since we do not have the power to recompile these, we diff --git a/fs/compat.c b/fs/compat.c index 2ce4456..eefe23b 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -1610,7 +1610,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, if (tvp) { struct compat_timeval rtv; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)); rtv.tv_sec = timeout; @@ -1685,7 +1685,7 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, if (tsp) { struct compat_timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rts.tv_sec = timeout / HZ; @@ -1800,7 +1800,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, if (tsp && timeout >= 0) { struct compat_timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; /* Yes, we know it's actually an s64, but it's also positive. */ rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * diff --git a/fs/select.c b/fs/select.c index 5633fe9..6041e24 100644 --- a/fs/select.c +++ b/fs/select.c @@ -401,7 +401,7 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, if (tvp) { struct timeval rtv; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)); rtv.tv_sec = timeout; @@ -467,7 +467,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, if (tsp) { struct timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000; @@ -814,7 +814,7 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, if (tsp && timeout >= 0) { struct timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; /* Yes, we know it's actually an s64, but it's also positive. */ rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * -- 1.5.3.8
| |