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

Commit 4f31d774 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml

Pull UML updates from Richard Weinberger:
 "This contains beside of random fixes/cleanups two bigger changes:

   - seccomp support by Mickaël Salaün

   - IRQ rework by Anton Ivanov"

* 'for-linus-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  um: Use race-free temporary file creation
  um: Do not set unsecure permission for temporary file
  um: Fix build error and kconfig for i386
  um: Add seccomp support
  um: Add full asm/syscall.h support
  selftests/seccomp: Remove the need for HAVE_ARCH_TRACEHOOK
  um: Fix ptrace GETREGS/SETREGS bugs
  um: link with -lpthread
  um: Update UBD to use pread/pwrite family of functions
  um: Do not change hard IRQ flags in soft IRQ processing
  um: Prevent IRQ handler reentrancy
  uml: flush stdout before forking
  uml: fix hostfs mknod()
parents 1baa5efb 3e46b253
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -33,7 +33,7 @@
    |          sh: | TODO |
    |          sh: | TODO |
    |       sparc: | TODO |
    |       sparc: | TODO |
    |        tile: |  ok  |
    |        tile: |  ok  |
    |          um: | TODO |
    |          um: |  ok  |
    |   unicore32: | TODO |
    |   unicore32: | TODO |
    |         x86: |  ok  |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    |      xtensa: | TODO |
+1 −0
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@ config UML
	bool
	bool
	default y
	default y
	select HAVE_ARCH_AUDITSYSCALL
	select HAVE_ARCH_AUDITSYSCALL
	select HAVE_ARCH_SECCOMP_FILTER
	select HAVE_UID16
	select HAVE_UID16
	select HAVE_FUTEX_CMPXCHG if FUTEX
	select HAVE_FUTEX_CMPXCHG if FUTEX
	select GENERIC_IRQ_SHOW
	select GENERIC_IRQ_SHOW
+16 −0
Original line number Original line Diff line number Diff line
@@ -104,3 +104,19 @@ config PGTABLE_LEVELS
	int
	int
	default 3 if 3_LEVEL_PGTABLES
	default 3 if 3_LEVEL_PGTABLES
	default 2
	default 2

config SECCOMP
	def_bool y
	prompt "Enable seccomp to safely compute untrusted bytecode"
	---help---
	  This kernel feature is useful for number crunching applications
	  that may need to compute untrusted bytecode during their
	  execution. By using pipes or other transports made available to
	  the process as file descriptors supporting the read/write
	  syscalls, it's possible to isolate those applications in
	  their own address space using seccomp. Once seccomp is
	  enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
	  and the task is only allowed to execute a few safe syscalls
	  defined by each seccomp mode.

	  If unsure, say Y.
+5 −22
Original line number Original line Diff line number Diff line
@@ -535,11 +535,7 @@ static int read_cow_bitmap(int fd, void *buf, int offset, int len)
{
{
	int err;
	int err;


	err = os_seek_file(fd, offset);
	err = os_pread_file(fd, buf, len, offset);
	if (err < 0)
		return err;

	err = os_read_file(fd, buf, len);
	if (err < 0)
	if (err < 0)
		return err;
		return err;


@@ -1377,14 +1373,8 @@ static int update_bitmap(struct io_thread_req *req)
	if(req->cow_offset == -1)
	if(req->cow_offset == -1)
		return 0;
		return 0;


	n = os_seek_file(req->fds[1], req->cow_offset);
	n = os_pwrite_file(req->fds[1], &req->bitmap_words,
	if(n < 0){
			  sizeof(req->bitmap_words), req->cow_offset);
		printk("do_io - bitmap lseek failed : err = %d\n", -n);
		return 1;
	}

	n = os_write_file(req->fds[1], &req->bitmap_words,
			  sizeof(req->bitmap_words));
	if(n != sizeof(req->bitmap_words)){
	if(n != sizeof(req->bitmap_words)){
		printk("do_io - bitmap update failed, err = %d fd = %d\n", -n,
		printk("do_io - bitmap update failed, err = %d fd = %d\n", -n,
		       req->fds[1]);
		       req->fds[1]);
@@ -1399,7 +1389,6 @@ static void do_io(struct io_thread_req *req)
	char *buf;
	char *buf;
	unsigned long len;
	unsigned long len;
	int n, nsectors, start, end, bit;
	int n, nsectors, start, end, bit;
	int err;
	__u64 off;
	__u64 off;


	if (req->op == UBD_FLUSH) {
	if (req->op == UBD_FLUSH) {
@@ -1428,18 +1417,12 @@ static void do_io(struct io_thread_req *req)
		len = (end - start) * req->sectorsize;
		len = (end - start) * req->sectorsize;
		buf = &req->buffer[start * req->sectorsize];
		buf = &req->buffer[start * req->sectorsize];


		err = os_seek_file(req->fds[bit], off);
		if(err < 0){
			printk("do_io - lseek failed : err = %d\n", -err);
			req->error = 1;
			return;
		}
		if(req->op == UBD_READ){
		if(req->op == UBD_READ){
			n = 0;
			n = 0;
			do {
			do {
				buf = &buf[n];
				buf = &buf[n];
				len -= n;
				len -= n;
				n = os_read_file(req->fds[bit], buf, len);
				n = os_pread_file(req->fds[bit], buf, len, off);
				if (n < 0) {
				if (n < 0) {
					printk("do_io - read failed, err = %d "
					printk("do_io - read failed, err = %d "
					       "fd = %d\n", -n, req->fds[bit]);
					       "fd = %d\n", -n, req->fds[bit]);
@@ -1449,7 +1432,7 @@ static void do_io(struct io_thread_req *req)
			} while((n < len) && (n != 0));
			} while((n < len) && (n != 0));
			if (n < len) memset(&buf[n], 0, len - n);
			if (n < len) memset(&buf[n], 0, len - n);
		} else {
		} else {
			n = os_write_file(req->fds[bit], buf, len);
			n = os_pwrite_file(req->fds[bit], buf, len, off);
			if(n != len){
			if(n != len){
				printk("do_io - write failed err = %d "
				printk("do_io - write failed err = %d "
				       "fd = %d\n", -n, req->fds[bit]);
				       "fd = %d\n", -n, req->fds[bit]);
+23 −0
Original line number Original line Diff line number Diff line
#ifndef __ASM_UM_HARDIRQ_H
#define __ASM_UM_HARDIRQ_H

#include <linux/cache.h>
#include <linux/threads.h>

typedef struct {
	unsigned int __softirq_pending;
} ____cacheline_aligned irq_cpustat_t;

#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
#include <linux/irq.h>

#ifndef ack_bad_irq
static inline void ack_bad_irq(unsigned int irq)
{
	printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
}
#endif

#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1

#endif /* __ASM_UM_HARDIRQ_H */
Loading