Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efb84681 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm64: kernel: check mode for get_user in undefinstr"

parents beb4f370 95994bbc
Loading
Loading
Loading
Loading
+15 −11
Original line number Original line Diff line number Diff line
@@ -311,6 +311,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
	/* check for AArch32 breakpoint instructions */
	/* check for AArch32 breakpoint instructions */
	if (!aarch32_break_handler(regs))
	if (!aarch32_break_handler(regs))
		return;
		return;
	if (user_mode(regs)) {
		if (compat_thumb_mode(regs)) {
		if (compat_thumb_mode(regs)) {
			if (get_user(instr, (u16 __user *)pc))
			if (get_user(instr, (u16 __user *)pc))
				goto die_sig;
				goto die_sig;
@@ -321,10 +322,13 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
				instr <<= 16;
				instr <<= 16;
				instr |= instr2;
				instr |= instr2;
			}
			}

		} else if (get_user(instr, (u32 __user *)pc)) {
	} else if ((get_user(instr, (u32 __user *)pc))) {
			goto die_sig;
			goto die_sig;
		}
		}
	} else {
		/* kernel mode */
		instr = *((u32 *)pc);
	}


	if (call_undef_hook(regs, instr) == 0)
	if (call_undef_hook(regs, instr) == 0)
		return;
		return;