Commit 430da7a8 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20160915' into staging



linux-user changes since 2.7 release

# gpg: Signature made Thu 22 Sep 2016 13:09:17 BST
# gpg:                using RSA key 0xB44890DEDE3C9BC0
# gpg: Good signature from "Riku Voipio <riku.voipio@iki.fi>"
# gpg:                 aka "Riku Voipio <riku.voipio@linaro.org>"
# Primary key fingerprint: FF82 03C8 C391 98AE 0581  41EF B448 90DE DE3C 9BC0

* remotes/riku/tags/pull-linux-user-20160915: (26 commits)
  linux-user: fix TARGET_NR_select
  linux-user: Fix incorrect offset of tuc_stack in ARM do_sigframe_return_v2
  linux-user: Sanity check clone flags
  linux-user: Remove unnecessary nptl_flags variable from do_fork()
  linux-user: Implement force_sigsegv() via force_sig()
  linux-user: SIGSEGV from sigreturn need not be fatal
  linux-user: ARM: Give SIGSEGV if signal frame setup fails
  linux-user: SIGSEGV on signal entry need not be fatal
  linux-user: Pass si_type information to queue_signal() explicitly
  linux-user: Recheck for pending synchronous signals too
  linux-user: ppc64: set MSR_CM bit for BookE 2.06 MMU
  linux-user: Use correct target SHMLBA in shmat()
  linux-user: Use glib malloc functions in load_symbols()
  linux-user: Check dump_write() return in elf_core_dump()
  linux-user: Fix error handling in flatload.c target_pread()
  linux-user: Fix incorrect use of host errno in do_ioctl_dm()
  linux-user: Check lock_user() return value for NULL
  linux-user: Pass missing MAP_ANONYMOUS to target_mmap() call
  linux-user: report signals being taken in strace output
  linux-user: Range check the nfds argument to ppoll syscall
  ...

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 3648100e 5457dc9e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -32,5 +32,13 @@ struct target_pt_regs {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE  2
#define TARGET_WANT_OLD_SYS_SELECT

#define TARGET_FORCE_SHMLBA

static inline abi_ulong target_shmlba(CPUARMState *env)
{
    return 4 * 4096;
}

#endif /* ARM_TARGET_SYSCALL_H */
+11 −9
Original line number Diff line number Diff line
@@ -2111,19 +2111,19 @@ static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias)

 found:
    /* Now know where the strtab and symtab are.  Snarf them.  */
    s = malloc(sizeof(*s));
    s = g_try_new(struct syminfo, 1);
    if (!s) {
        goto give_up;
    }

    i = shdr[str_idx].sh_size;
    s->disas_strtab = strings = malloc(i);
    s->disas_strtab = strings = g_try_malloc(i);
    if (!strings || pread(fd, strings, i, shdr[str_idx].sh_offset) != i) {
        goto give_up;
    }

    i = shdr[sym_idx].sh_size;
    syms = malloc(i);
    syms = g_try_malloc(i);
    if (!syms || pread(fd, syms, i, shdr[sym_idx].sh_offset) != i) {
        goto give_up;
    }
@@ -2157,7 +2157,7 @@ static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias)
       that we threw away.  Whether or not this has any effect on the
       memory allocation depends on the malloc implementation and how
       many symbols we managed to discard.  */
    new_syms = realloc(syms, nsyms * sizeof(*syms));
    new_syms = g_try_renew(struct elf_sym, syms, nsyms);
    if (new_syms == NULL) {
        goto give_up;
    }
@@ -2178,9 +2178,9 @@ static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias)
    return;

give_up:
    free(s);
    free(strings);
    free(syms);
    g_free(s);
    g_free(strings);
    g_free(syms);
}

int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
@@ -2233,7 +2233,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
               we do not have the power to recompile these, we emulate
               the SVr4 behavior.  Sigh.  */
            target_mmap(0, qemu_host_page_size, PROT_READ | PROT_EXEC,
                        MAP_FIXED | MAP_PRIVATE, -1, 0);
                        MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
        }
    }

@@ -3050,7 +3050,9 @@ static int elf_core_dump(int signr, const CPUArchState *env)
        phdr.p_align = ELF_EXEC_PAGESIZE;

        bswap_phdr(&phdr, 1);
        dump_write(fd, &phdr, sizeof (phdr));
        if (dump_write(fd, &phdr, sizeof(phdr)) != 0) {
            goto out;
        }
    }

    /*
+6 −0
Original line number Diff line number Diff line
@@ -95,7 +95,13 @@ static int target_pread(int fd, abi_ulong ptr, abi_ulong len,
    int ret;

    buf = lock_user(VERIFY_WRITE, ptr, len, 0);
    if (!buf) {
        return -EFAULT;
    }
    ret = pread(fd, buf, len, offset);
    if (ret < 0) {
        ret = -errno;
    }
    unlock_user(buf, ptr, len);
    return ret;
}
+1 −0
Original line number Diff line number Diff line
@@ -153,5 +153,6 @@ struct target_vm86plus_struct {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE  2
#define TARGET_WANT_OLD_SYS_SELECT

#endif /* I386_TARGET_SYSCALL_H */
+3 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@
                   MK_PTR(MK_STRUCT(STRUCT_fiemap)))
#endif

     IOCTL(FS_IOC_GETFLAGS, IOC_R, MK_PTR(TYPE_INT))
     IOCTL(FS_IOC_SETFLAGS, IOC_W, MK_PTR(TYPE_INT))

  IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
  IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
  IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
Loading