Skip to content

Commit

Permalink
Merge branch 'for-linus-4.2-rc1' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/rw/uml

Pull UML updates from Richard Weinberger:

 - remove hppfs ("HonePot ProcFS")

 - initial support for musl libc

 - uaccess cleanup

 - random cleanups and bug fixes all over the place

* 'for-linus-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (21 commits)
  um: Don't pollute kernel namespace with uapi
  um: Include sys/types.h for makedev(), major(), minor()
  um: Do not use stdin and stdout identifiers for struct members
  um: Do not use __ptr_t type for stack_t's .ss pointer
  um: Fix mconsole dependency
  um: Handle tracehook_report_syscall_entry() result
  um: Remove copy&paste code from init.h
  um: Stop abusing __KERNEL__
  um: Catch unprotected user memory access
  um: Fix warning in setup_signal_stack_si()
  um: Rework uaccess code
  um: Add uaccess.h to ldt.c
  um: Add uaccess.h to syscalls_64.c
  um: Add asm/elf.h to vma.c
  um: Cleanup mem_32/64.c headers
  um: Remove hppfs
  um: Move syscall() declaration into os.h
  um: kernel: ksyms: Export symbol syscall() for fixing modpost issue
  um/os-Linux: Use char[] for syscall_stub declarations
  um: Use char[] for linker script address declarations
  ...
  • Loading branch information
Linus Torvalds committed Jun 28, 2015
2 parents b779157 + da028d5 commit 21dc2e6
Show file tree
Hide file tree
Showing 46 changed files with 155 additions and 1,064 deletions.
16 changes: 1 addition & 15 deletions arch/um/Kconfig.um
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,9 @@ config HOSTFS
If you'd like to be able to work with files stored on the host,
say Y or M here; otherwise say N.

config HPPFS
tristate "HoneyPot ProcFS"
depends on PROC_FS
help
hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc
entries to be overridden, removed, or fabricated from the host.
Its purpose is to allow a UML to appear to be a physical machine
by removing or changing anything in /proc which gives away the
identity of a UML.

See <http://user-mode-linux.sf.net/old/hppfs.html> for more information.

You only need this if you are setting up a UML honeypot. Otherwise,
it is safe to say 'N' here.

config MCONSOLE
bool "Management console"
depends on PROC_FS
default y
help
The user mode linux management console is a low-level interface to
Expand Down
7 changes: 4 additions & 3 deletions arch/um/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \

KBUILD_AFLAGS += $(ARCH_INCLUDE)

USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
$(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
$(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \
-D_FILE_OFFSET_BITS=64 -idirafter include \
-D__KERNEL__ -D__UM_HOST__

#This will adjust *FLAGS accordingly to the platform.
include $(ARCH_DIR)/Makefile-os-$(OS)
Expand Down
18 changes: 9 additions & 9 deletions arch/um/drivers/harddog_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
#include <os.h>

struct dog_data {
int stdin;
int stdout;
int stdin_fd;
int stdout_fd;
int close_me[2];
};

static void pre_exec(void *d)
{
struct dog_data *data = d;

dup2(data->stdin, 0);
dup2(data->stdout, 1);
dup2(data->stdout, 2);
close(data->stdin);
close(data->stdout);
dup2(data->stdin_fd, 0);
dup2(data->stdout_fd, 1);
dup2(data->stdout_fd, 2);
close(data->stdin_fd);
close(data->stdout_fd);
close(data->close_me[0]);
close(data->close_me[1]);
}
Expand All @@ -49,8 +49,8 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
goto out_close_in;
}

data.stdin = out_fds[0];
data.stdout = in_fds[1];
data.stdin_fd = out_fds[0];
data.stdout_fd = in_fds[1];
data.close_me[0] = out_fds[1];
data.close_me[1] = in_fds[0];

Expand Down
2 changes: 1 addition & 1 deletion arch/um/drivers/mconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef __MCONSOLE_H__
#define __MCONSOLE_H__

#ifndef __KERNEL__
#ifdef __UM_HOST__
#include <stdint.h>
#define u32 uint32_t
#endif
Expand Down
6 changes: 3 additions & 3 deletions arch/um/drivers/net_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ int net_sendto(int fd, void *buf, int len, void *to, int sock_len)

struct change_pre_exec_data {
int close_me;
int stdout;
int stdout_fd;
};

static void change_pre_exec(void *arg)
{
struct change_pre_exec_data *data = arg;

close(data->close_me);
dup2(data->stdout, 1);
dup2(data->stdout_fd, 1);
}

static int change_tramp(char **argv, char *output, int output_len)
Expand All @@ -189,7 +189,7 @@ static int change_tramp(char **argv, char *output, int output_len)
return err;
}
pe_data.close_me = fds[0];
pe_data.stdout = fds[1];
pe_data.stdout_fd = fds[1];
pid = run_helper(change_pre_exec, &pe_data, argv);

if (pid > 0) /* Avoid hang as we won't get data in failure case. */
Expand Down
14 changes: 7 additions & 7 deletions arch/um/drivers/slip_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ static int set_up_tty(int fd)
}

struct slip_pre_exec_data {
int stdin;
int stdout;
int stdin_fd;
int stdout_fd;
int close_me;
};

static void slip_pre_exec(void *arg)
{
struct slip_pre_exec_data *data = arg;

if (data->stdin >= 0)
dup2(data->stdin, 0);
dup2(data->stdout, 1);
if (data->stdin_fd >= 0)
dup2(data->stdin_fd, 0);
dup2(data->stdout_fd, 1);
if (data->close_me >= 0)
close(data->close_me);
}
Expand All @@ -85,8 +85,8 @@ static int slip_tramp(char **argv, int fd)
}

err = 0;
pe_data.stdin = fd;
pe_data.stdout = fds[1];
pe_data.stdin_fd = fd;
pe_data.stdout_fd = fds[1];
pe_data.close_me = fds[0];
err = run_helper(slip_pre_exec, &pe_data, argv);
if (err < 0)
Expand Down
16 changes: 8 additions & 8 deletions arch/um/drivers/slirp_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ static int slirp_user_init(void *data, void *dev)
}

struct slirp_pre_exec_data {
int stdin;
int stdout;
int stdin_fd;
int stdout_fd;
};

static void slirp_pre_exec(void *arg)
{
struct slirp_pre_exec_data *data = arg;

if (data->stdin != -1)
dup2(data->stdin, 0);
if (data->stdout != -1)
dup2(data->stdout, 1);
if (data->stdin_fd != -1)
dup2(data->stdin_fd, 0);
if (data->stdout_fd != -1)
dup2(data->stdout_fd, 1);
}

static int slirp_tramp(char **argv, int fd)
{
struct slirp_pre_exec_data pe_data;
int pid;

pe_data.stdin = fd;
pe_data.stdout = fd;
pe_data.stdin_fd = fd;
pe_data.stdout_fd = fd;
pid = run_helper(slirp_pre_exec, &pe_data, argv);

return pid;
Expand Down
1 change: 0 additions & 1 deletion arch/um/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ generic-y += param.h
generic-y += pci.h
generic-y += percpu.h
generic-y += preempt.h
generic-y += sections.h
generic-y += switch_to.h
generic-y += topology.h
generic-y += trace_clock.h
Expand Down
3 changes: 1 addition & 2 deletions arch/um/include/asm/ptrace-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#ifndef __ASSEMBLY__

#include <asm/ptrace-abi.h>
#include <sysdep/ptrace.h>

struct pt_regs {
Expand Down Expand Up @@ -37,7 +36,7 @@ extern int putreg(struct task_struct *child, int regno, unsigned long value);

extern int arch_copy_tls(struct task_struct *new);
extern void clear_flushed_tls(struct task_struct *task);
extern void syscall_trace_enter(struct pt_regs *regs);
extern int syscall_trace_enter(struct pt_regs *regs);
extern void syscall_trace_leave(struct pt_regs *regs);

#endif
Expand Down
9 changes: 9 additions & 0 deletions arch/um/include/asm/sections.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef __UM_SECTIONS_H
#define __UM_SECTIONS_H

#include <asm-generic/sections.h>

extern char __binary_start[];
extern char __syscall_stub_start[], __syscall_stub_end[];

#endif
2 changes: 1 addition & 1 deletion arch/um/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <asm/types.h>
#include <asm/page.h>
#include <asm/uaccess.h>
#include <asm/segment.h>

struct thread_info {
struct task_struct *task; /* main task structure */
Expand Down
Loading

0 comments on commit 21dc2e6

Please sign in to comment.