Skip to content

Commit dc164f4

Browse files
committed
Merge tag 'for-linus-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull UML fixes from Richard Weinberger: - Various fixes for build warnings - Fix default kernel command line * tag 'for-linus-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: arch: um: Mark the stack non-executable to fix a binutils warning um: Prevent KASAN splats in dump_stack() um: fix default console kernel parameter um: Cleanup compiler warning in arch/x86/um/tls_32.c um: Cleanup syscall_handler_t cast in syscalls_32.h
2 parents 26c9564 + bd71558 commit dc164f4

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

arch/um/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,18 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
132132
# The wrappers will select whether using "malloc" or the kernel allocator.
133133
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
134134

135+
# Avoid binutils 2.39+ warnings by marking the stack non-executable and
136+
# ignorning warnings for the kallsyms sections.
137+
LDFLAGS_EXECSTACK = -z noexecstack
138+
ifeq ($(CONFIG_LD_IS_BFD),y)
139+
LDFLAGS_EXECSTACK += $(call ld-option,--no-warn-rwx-segments)
140+
endif
141+
135142
LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS),-Wl,$(opt))
136143

137144
# Used by link-vmlinux.sh which has special support for um link
138145
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
146+
export LDFLAGS_vmlinux := $(LDFLAGS_EXECSTACK)
139147

140148
# When cleaning we don't include .config, so we don't include
141149
# TT or skas makefiles and don't clean skas_ptregs.h.

arch/um/kernel/sysrq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ void show_stack(struct task_struct *task, unsigned long *stack,
4848
break;
4949
if (i && ((i % STACKSLOTS_PER_LINE) == 0))
5050
pr_cont("\n");
51-
pr_cont(" %08lx", *stack++);
51+
pr_cont(" %08lx", READ_ONCE_NOCHECK(*stack));
52+
stack++;
5253
}
5354

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

arch/um/kernel/um_arch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "um_arch.h"
3434

3535
#define DEFAULT_COMMAND_LINE_ROOT "root=98:0"
36-
#define DEFAULT_COMMAND_LINE_CONSOLE "console=tty"
36+
#define DEFAULT_COMMAND_LINE_CONSOLE "console=tty0"
3737

3838
/* Changed in add_arg and setup_arch, which run before SMP is started */
3939
static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 };

arch/x86/um/shared/sysdep/syscalls_32.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
#include <asm/unistd.h>
77
#include <sysdep/ptrace.h>
88

9-
typedef long syscall_handler_t(struct pt_regs);
9+
typedef long syscall_handler_t(struct syscall_args);
1010

1111
extern syscall_handler_t *sys_call_table[];
1212

1313
#define EXECUTE_SYSCALL(syscall, regs) \
14-
((long (*)(struct syscall_args)) \
15-
(*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))
14+
((*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))

arch/x86/um/tls_32.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ static int get_free_idx(struct task_struct* task)
6565
struct thread_struct *t = &task->thread;
6666
int idx;
6767

68-
if (!t->arch.tls_array)
69-
return GDT_ENTRY_TLS_MIN;
70-
7168
for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++)
7269
if (!t->arch.tls_array[idx].present)
7370
return idx + GDT_ENTRY_TLS_MIN;
@@ -240,9 +237,6 @@ static int get_tls_entry(struct task_struct *task, struct user_desc *info,
240237
{
241238
struct thread_struct *t = &task->thread;
242239

243-
if (!t->arch.tls_array)
244-
goto clear;
245-
246240
if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
247241
return -EINVAL;
248242

arch/x86/um/vdso/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ quiet_cmd_vdso = VDSO $@
6565
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
6666
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
6767

68-
VDSO_LDFLAGS = -fPIC -shared -Wl,--hash-style=sysv
68+
VDSO_LDFLAGS = -fPIC -shared -Wl,--hash-style=sysv -z noexecstack
6969
GCOV_PROFILE := n
7070

7171
#

0 commit comments

Comments
 (0)