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

Commit 81e7d458 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge 4.14.12 into android-4.14



Changes in 4.14.12
	exec: Weaken dumpability for secureexec
	capabilities: fix buffer overread on very short xattr
	x86/cpu, x86/pti: Do not enable PTI on AMD processors
	x86/pti: Make sure the user/kernel PTEs match
	x86/dumpstack: Fix partial register dumps
	x86/dumpstack: Print registers for first stack frame
	x86/pti: Switch to kernel CR3 at early in entry_SYSCALL_compat()
	x86/process: Define cpu_tss_rw in same section as declaration
	Revert "xfrm: Fix stack-out-of-bounds read in xfrm_state_find."
	rtc: m41t80: m41t80_sqw_set_rate should return 0 on success
	rtc: m41t80: fix m41t80_sqw_round_rate return value
	rtc: m41t80: avoid i2c read in m41t80_sqw_recalc_rate
	rtc: m41t80: avoid i2c read in m41t80_sqw_is_prepared
	rtc: m41t80: remove unneeded checks from m41t80_sqw_set_rate
	Linux 4.14.12

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parents 51caa5cc 8d577afd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 11
SUBLEVEL = 12
EXTRAVERSION =
NAME = Petit Gorille

+6 −7
Original line number Diff line number Diff line
@@ -190,8 +190,13 @@ ENTRY(entry_SYSCALL_compat)
	/* Interrupts are off on entry. */
	swapgs

	/* Stash user ESP and switch to the kernel stack. */
	/* Stash user ESP */
	movl	%esp, %r8d

	/* Use %rsp as scratch reg. User ESP is stashed in r8 */
	SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp

	/* Switch to the kernel stack */
	movq	PER_CPU_VAR(cpu_current_top_of_stack), %rsp

	/* Construct struct pt_regs on stack */
@@ -219,12 +224,6 @@ GLOBAL(entry_SYSCALL_compat_after_hwframe)
	pushq   $0			/* pt_regs->r14 = 0 */
	pushq   $0			/* pt_regs->r15 = 0 */

	/*
	 * We just saved %rdi so it is safe to clobber.  It is not
	 * preserved during the C calls inside TRACE_IRQS_OFF anyway.
	 */
	SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi

	/*
	 * User mode is traced as though IRQs are on, and SYSENTER
	 * turned them off.
+13 −4
Original line number Diff line number Diff line
@@ -56,18 +56,27 @@ void unwind_start(struct unwind_state *state, struct task_struct *task,

#if defined(CONFIG_UNWINDER_ORC) || defined(CONFIG_UNWINDER_FRAME_POINTER)
/*
 * WARNING: The entire pt_regs may not be safe to dereference.  In some cases,
 * only the iret frame registers are accessible.  Use with caution!
 * If 'partial' returns true, only the iret frame registers are valid.
 */
static inline struct pt_regs *unwind_get_entry_regs(struct unwind_state *state)
static inline struct pt_regs *unwind_get_entry_regs(struct unwind_state *state,
						    bool *partial)
{
	if (unwind_done(state))
		return NULL;

	if (partial) {
#ifdef CONFIG_UNWINDER_ORC
		*partial = !state->full_regs;
#else
		*partial = false;
#endif
	}

	return state->regs;
}
#else
static inline struct pt_regs *unwind_get_entry_regs(struct unwind_state *state)
static inline struct pt_regs *unwind_get_entry_regs(struct unwind_state *state,
						    bool *partial)
{
	return NULL;
}
+2 −2
Original line number Diff line number Diff line
@@ -899,7 +899,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)

	setup_force_cpu_cap(X86_FEATURE_ALWAYS);

	/* Assume for now that ALL x86 CPUs are insecure */
	if (c->x86_vendor != X86_VENDOR_AMD)
		setup_force_cpu_bug(X86_BUG_CPU_INSECURE);

	fpu__init_system(c);
+22 −9
Original line number Diff line number Diff line
@@ -76,11 +76,22 @@ void show_iret_regs(struct pt_regs *regs)
		regs->sp, regs->flags);
}

static void show_regs_safe(struct stack_info *info, struct pt_regs *regs)
static void show_regs_if_on_stack(struct stack_info *info, struct pt_regs *regs,
				  bool partial)
{
	if (on_stack(info, regs, sizeof(*regs)))
	/*
	 * These on_stack() checks aren't strictly necessary: the unwind code
	 * has already validated the 'regs' pointer.  The checks are done for
	 * ordering reasons: if the registers are on the next stack, we don't
	 * want to print them out yet.  Otherwise they'll be shown as part of
	 * the wrong stack.  Later, when show_trace_log_lvl() switches to the
	 * next stack, this function will be called again with the same regs so
	 * they can be printed in the right context.
	 */
	if (!partial && on_stack(info, regs, sizeof(*regs))) {
		__show_regs(regs, 0);
	else if (on_stack(info, (void *)regs + IRET_FRAME_OFFSET,

	} else if (partial && on_stack(info, (void *)regs + IRET_FRAME_OFFSET,
				       IRET_FRAME_SIZE)) {
		/*
		 * When an interrupt or exception occurs in entry code, the
@@ -98,11 +109,13 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
	struct stack_info stack_info = {0};
	unsigned long visit_mask = 0;
	int graph_idx = 0;
	bool partial;

	printk("%sCall Trace:\n", log_lvl);

	unwind_start(&state, task, regs, stack);
	stack = stack ? : get_stack_pointer(task, regs);
	regs = unwind_get_entry_regs(&state, &partial);

	/*
	 * Iterate through the stacks, starting with the current stack pointer.
@@ -120,7 +133,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
	 * - hardirq stack
	 * - entry stack
	 */
	for (regs = NULL; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
	for ( ; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
		const char *stack_name;

		if (get_stack_info(stack, task, &stack_info, &visit_mask)) {
@@ -140,7 +153,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
			printk("%s <%s>\n", log_lvl, stack_name);

		if (regs)
			show_regs_safe(&stack_info, regs);
			show_regs_if_on_stack(&stack_info, regs, partial);

		/*
		 * Scan the stack, printing any text addresses we find.  At the
@@ -164,7 +177,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,

			/*
			 * Don't print regs->ip again if it was already printed
			 * by show_regs_safe() below.
			 * by show_regs_if_on_stack().
			 */
			if (regs && stack == &regs->ip)
				goto next;
@@ -199,9 +212,9 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
			unwind_next_frame(&state);

			/* if the frame has entry regs, print them */
			regs = unwind_get_entry_regs(&state);
			regs = unwind_get_entry_regs(&state, &partial);
			if (regs)
				show_regs_safe(&stack_info, regs);
				show_regs_if_on_stack(&stack_info, regs, partial);
		}

		if (stack_name)
Loading