Commit a7833969 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

powerpc/interrupts: Fix kuep_unlock() call



Same as kuap_user_restore(), kuep_unlock() has to be called when
really returning to user, that is in interrupt_exit_user_prepare(),
not in interrupt_exit_prepare().

Fixes: b5efec00 ("powerpc/32s: Move KUEP locking/unlocking in C")
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b831e54a2579db24fbef836ed415588ce2b3e825.1620312573.git.christophe.leroy@csgroup.eu
parent 6efb943b
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -153,8 +153,6 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
 */
 */
static inline void interrupt_exit_prepare(struct pt_regs *regs, struct interrupt_state *state)
static inline void interrupt_exit_prepare(struct pt_regs *regs, struct interrupt_state *state)
{
{
	if (user_mode(regs))
		kuep_unlock();
}
}


static inline void interrupt_async_enter_prepare(struct pt_regs *regs, struct interrupt_state *state)
static inline void interrupt_async_enter_prepare(struct pt_regs *regs, struct interrupt_state *state)
+1 −0
Original line number Original line Diff line number Diff line
@@ -427,6 +427,7 @@ notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned


	/* Restore user access locks last */
	/* Restore user access locks last */
	kuap_user_restore(regs);
	kuap_user_restore(regs);
	kuep_unlock();


	return ret;
	return ret;
}
}