Skip to content

Commit d4f309c

Browse files
committed
Merge tag 'powerpc-5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Fix an existing bug in our user access handling, exposed by one of the bug fixes we merged this cycle. - A fix for a boot hang on 32-bit with CONFIG_TRACE_IRQFLAGS and the recently added CONFIG_VMAP_STACK. Thanks to: Christophe Leroy, Guenter Roeck. * tag 'powerpc-5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: Fix CONFIG_TRACE_IRQFLAGS with CONFIG_VMAP_STACK powerpc/futex: Fix incorrect user access blocking
2 parents b0ef7cd + d4bf905 commit d4f309c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

arch/powerpc/include/asm/futex.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval,
3535
{
3636
int oldval = 0, ret;
3737

38-
allow_write_to_user(uaddr, sizeof(*uaddr));
38+
allow_read_write_user(uaddr, uaddr, sizeof(*uaddr));
3939
pagefault_disable();
4040

4141
switch (op) {
@@ -62,7 +62,7 @@ static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval,
6262

6363
*oval = oldval;
6464

65-
prevent_write_to_user(uaddr, sizeof(*uaddr));
65+
prevent_read_write_user(uaddr, uaddr, sizeof(*uaddr));
6666
return ret;
6767
}
6868

@@ -76,7 +76,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
7676
if (!access_ok(uaddr, sizeof(u32)))
7777
return -EFAULT;
7878

79-
allow_write_to_user(uaddr, sizeof(*uaddr));
79+
allow_read_write_user(uaddr, uaddr, sizeof(*uaddr));
80+
8081
__asm__ __volatile__ (
8182
PPC_ATOMIC_ENTRY_BARRIER
8283
"1: lwarx %1,0,%3 # futex_atomic_cmpxchg_inatomic\n\
@@ -97,7 +98,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
9798
: "cc", "memory");
9899

99100
*uval = prev;
100-
prevent_write_to_user(uaddr, sizeof(*uaddr));
101+
prevent_read_write_user(uaddr, uaddr, sizeof(*uaddr));
102+
101103
return ret;
102104
}
103105

arch/powerpc/kernel/entry_32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ transfer_to_handler_cont:
214214
* To speed up the syscall path where interrupts stay on, let's check
215215
* first if we are changing the MSR value at all.
216216
*/
217-
tophys(r12, r1)
217+
tophys_novmstack r12, r1
218218
lwz r12,_MSR(r12)
219219
andi. r12,r12,MSR_EE
220220
bne 1f

0 commit comments

Comments
 (0)