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

Commit 955bd1d2 authored by David S. Miller's avatar David S. Miller
Browse files
parents be1b6e8b 5b7d2796
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -62,7 +62,15 @@ trivial patch so apply some common sense.

7.	When sending security related changes or reports to a maintainer
	please Cc: security@kernel.org, especially if the maintainer
	does not respond.
	does not respond. Please keep in mind that the security team is
	a small set of people who can be efficient only when working on
	verified bugs. Please only Cc: this list when you have identified
	that the bug would present a short-term risk to other users if it
	were publicly disclosed. For example, reports of address leaks do
	not represent an immediate threat and are better handled publicly,
	and ideally, should come with a patch proposal. Please do not send
	automated reports to this list either. Such bugs will be handled
	better and faster in the usual public places.

8.	Happy hacking.

@@ -12253,7 +12261,7 @@ M: Security Officers <security@kernel.org>
S:	Supported

SECURITY SUBSYSTEM
M:	James Morris <james.l.morris@oracle.com>
M:	James Morris <jmorris@namei.org>
M:	"Serge E. Hallyn" <serge@hallyn.com>
L:	linux-security-module@vger.kernel.org (suggested Cc:)
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ obj-$(CONFIG_CRYPTO_MD5_SPARC64) += md5-sparc64.o

obj-$(CONFIG_CRYPTO_AES_SPARC64) += aes-sparc64.o
obj-$(CONFIG_CRYPTO_DES_SPARC64) += des-sparc64.o
obj-$(CONFIG_CRYPTO_DES_SPARC64) += camellia-sparc64.o
obj-$(CONFIG_CRYPTO_CAMELLIA_SPARC64) += camellia-sparc64.o

obj-$(CONFIG_CRYPTO_CRC32C_SPARC64) += crc32c-sparc64.o

+4 −1
Original line number Diff line number Diff line
@@ -29,10 +29,13 @@ KASAN_SANITIZE_stacktrace.o := n
KASAN_SANITIZE_paravirt.o				:= n

OBJECT_FILES_NON_STANDARD_relocate_kernel_$(BITS).o	:= y
OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o		:= y
OBJECT_FILES_NON_STANDARD_test_nx.o			:= y
OBJECT_FILES_NON_STANDARD_paravirt_patch_$(BITS).o	:= y

ifdef CONFIG_FRAME_POINTER
OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o		:= y
endif

# If instrumentation of this dir is enabled, boot hangs during first second.
# Probably could be more selective here, but note that files related to irqs,
# boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
+15 −9
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <asm/ftrace.h>
#include <asm/export.h>
#include <asm/nospec-branch.h>
#include <asm/unwind_hints.h>

	.code64
	.section .entry.text, "ax"
@@ -20,7 +21,6 @@ EXPORT_SYMBOL(__fentry__)
EXPORT_SYMBOL(mcount)
#endif

/* All cases save the original rbp (8 bytes) */
#ifdef CONFIG_FRAME_POINTER
# ifdef CC_USING_FENTRY
/* Save parent and function stack frames (rip and rbp) */
@@ -31,7 +31,7 @@ EXPORT_SYMBOL(mcount)
# endif
#else
/* No need to save a stack frame */
# define MCOUNT_FRAME_SIZE	8
# define MCOUNT_FRAME_SIZE	0
#endif /* CONFIG_FRAME_POINTER */

/* Size of stack used to save mcount regs in save_mcount_regs */
@@ -64,10 +64,10 @@ EXPORT_SYMBOL(mcount)
 */
.macro save_mcount_regs added=0

	/* Always save the original rbp */
#ifdef CONFIG_FRAME_POINTER
	/* Save the original rbp */
	pushq %rbp

#ifdef CONFIG_FRAME_POINTER
	/*
	 * Stack traces will stop at the ftrace trampoline if the frame pointer
	 * is not set up properly. If fentry is used, we need to save a frame
@@ -105,7 +105,11 @@ EXPORT_SYMBOL(mcount)
	 * Save the original RBP. Even though the mcount ABI does not
	 * require this, it helps out callers.
	 */
#ifdef CONFIG_FRAME_POINTER
	movq MCOUNT_REG_SIZE-8(%rsp), %rdx
#else
	movq %rbp, %rdx
#endif
	movq %rdx, RBP(%rsp)

	/* Copy the parent address into %rsi (second parameter) */
@@ -148,7 +152,7 @@ EXPORT_SYMBOL(mcount)

ENTRY(function_hook)
	retq
END(function_hook)
ENDPROC(function_hook)

ENTRY(ftrace_caller)
	/* save_mcount_regs fills in first two parameters */
@@ -184,7 +188,7 @@ GLOBAL(ftrace_graph_call)
/* This is weak to keep gas from relaxing the jumps */
WEAK(ftrace_stub)
	retq
END(ftrace_caller)
ENDPROC(ftrace_caller)

ENTRY(ftrace_regs_caller)
	/* Save the current flags before any operations that can change them */
@@ -255,7 +259,7 @@ GLOBAL(ftrace_regs_caller_end)

	jmp ftrace_epilogue

END(ftrace_regs_caller)
ENDPROC(ftrace_regs_caller)


#else /* ! CONFIG_DYNAMIC_FTRACE */
@@ -313,9 +317,10 @@ ENTRY(ftrace_graph_caller)
	restore_mcount_regs

	retq
END(ftrace_graph_caller)
ENDPROC(ftrace_graph_caller)

GLOBAL(return_to_handler)
ENTRY(return_to_handler)
	UNWIND_HINT_EMPTY
	subq  $24, %rsp

	/* Save the return values */
@@ -330,4 +335,5 @@ GLOBAL(return_to_handler)
	movq (%rsp), %rax
	addq $24, %rsp
	JMP_NOSPEC %rdi
END(return_to_handler)
#endif
+47 −1
Original line number Diff line number Diff line
@@ -74,8 +74,50 @@ static struct orc_entry *orc_module_find(unsigned long ip)
}
#endif

#ifdef CONFIG_DYNAMIC_FTRACE
static struct orc_entry *orc_find(unsigned long ip);

/*
 * Ftrace dynamic trampolines do not have orc entries of their own.
 * But they are copies of the ftrace entries that are static and
 * defined in ftrace_*.S, which do have orc entries.
 *
 * If the undwinder comes across a ftrace trampoline, then find the
 * ftrace function that was used to create it, and use that ftrace
 * function's orc entrie, as the placement of the return code in
 * the stack will be identical.
 */
static struct orc_entry *orc_ftrace_find(unsigned long ip)
{
	struct ftrace_ops *ops;
	unsigned long caller;

	ops = ftrace_ops_trampoline(ip);
	if (!ops)
		return NULL;

	if (ops->flags & FTRACE_OPS_FL_SAVE_REGS)
		caller = (unsigned long)ftrace_regs_call;
	else
		caller = (unsigned long)ftrace_call;

	/* Prevent unlikely recursion */
	if (ip == caller)
		return NULL;

	return orc_find(caller);
}
#else
static struct orc_entry *orc_ftrace_find(unsigned long ip)
{
	return NULL;
}
#endif

static struct orc_entry *orc_find(unsigned long ip)
{
	static struct orc_entry *orc;

	if (!orc_init)
		return NULL;

@@ -111,7 +153,11 @@ static struct orc_entry *orc_find(unsigned long ip)
				  __stop_orc_unwind_ip - __start_orc_unwind_ip, ip);

	/* Module lookup: */
	return orc_module_find(ip);
	orc = orc_module_find(ip);
	if (orc)
		return orc;

	return orc_ftrace_find(ip);
}

static void orc_sort_swap(void *_a, void *_b, int size)
Loading