27 Sep, 2014

1 commit

  • openrisc:defconfig fails to build in next-20140926 with the following error.

    In file included from arch/openrisc/kernel/signal.c:31:0:
    ./arch/openrisc/include/asm/syscall.h: In function 'syscall_get_arch':
    ./arch/openrisc/include/asm/syscall.h:77:9: error: 'EM_OPENRISC' undeclared

    Fix by moving EM_OPENRISC to include/uapi/linux/elf-em.h.

    Fixes: ce5d112827e5 ("ARCH: AUDIT: implement syscall_get_arch for all arches")
    Cc: Eric Paris
    Cc: Stefan Kristiansson
    Cc: Geert Uytterhoeven
    Cc: Stephen Rothwell
    Signed-off-by: Guenter Roeck
    Signed-off-by: Eric Paris

    Guenter Roeck
     

24 Sep, 2014

11 commits

  • The arm64 tree added calls to audit_syscall_entry() and rightly included
    the syscall number. The interface has since been changed to not need
    the syscall number. As such, arm64 should no longer pass that value.

    Signed-off-by: Eric Paris

    Eric Paris
     
  • This patch adds auditing functions on entry to or exit from
    every system call invocation.

    Acked-by: Richard Guy Briggs
    Acked-by Will Deacon
    Signed-off-by: AKASHI Takahiro
    Signed-off-by: Catalin Marinas

    AKASHI Takahiro
     
  • Since the arch is found locally in __audit_syscall_entry(), there is no need to
    pass it in as a parameter. Delete it from the parameter list.

    x86* was the only arch to call __audit_syscall_entry() directly and did so from
    assembly code.

    Signed-off-by: Richard Guy Briggs
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: x86@kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-audit@redhat.com
    Signed-off-by: Eric Paris

    ---

    As this patch relies on changes in the audit tree, I think it
    appropriate to send it through my tree rather than the x86 tree.

    Richard Guy Briggs
     
  • We are currently embedding the same check from thread_info.h into
    syscall.h thanks to the way syscall_get_arch() was implemented in the
    audit tree. Instead create a new function, is_32bit_task() which is
    similar to that found on the powerpc arch. This simplifies the
    syscall.h code and makes the build/Kconfig requirements much easier
    to understand.

    Signed-off-by: Eric Paris
    Cc: Stephen Rothwell
    Cc: sparclinux@vger.kernel.org

    Eric Paris
     
  • After merging the audit tree, today's linux-next build (sparc defconfig)
    failed like this:

    In file included from include/linux/audit.h:29:0,
    from mm/mmap.c:33:
    arch/sparc/include/asm/syscall.h: In function 'syscall_get_arch':
    arch/sparc/include/asm/syscall.h:131:9: error: 'TIF_32BIT' undeclared (first use in this function)
    arch/sparc/include/asm/syscall.h:131:9: note: each undeclared identifier is reported only once for each function it appears in

    And many more ...

    Caused by commit 374c0c054122 ("ARCH: AUDIT: implement syscall_get_arch
    for all arches").

    This patch wraps the usage of TIF_32BIT in:
    if defined(__sparc__) && defined(__arch64__)
    Which solves the build problem.

    Signed-off-by: Stephen Rothwell
    Acked-by: Richard Guy Briggs
    Signed-off-by: Eric Paris

    Stephen Rothwell
     
  • Include linux/thread_info.h so we can use is_32_bit_task() cleanly.
    Then just simplify syscall_get_arch() since is_32_bit_task() works for
    all configuration options.

    Suggested-by: Stephen Rothwell
    Signed-off-by: Eric Paris

    Eric Paris
     
  • We have a function where the arch can be queried, syscall_get_arch().
    So rather than have every single piece of arch specific code use and/or
    duplicate syscall_get_arch(), just have the audit code use the
    syscall_get_arch() code.

    Based-on-patch-by: Richard Briggs
    Signed-off-by: Eric Paris
    Cc: linux-alpha@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-ia64@vger.kernel.org
    Cc: microblaze-uclinux@itee.uq.edu.au
    Cc: linux-mips@linux-mips.org
    Cc: linux@lists.openrisc.net
    Cc: linux-parisc@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: linux-s390@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: sparclinux@vger.kernel.org
    Cc: user-mode-linux-devel@lists.sourceforge.net
    Cc: linux-xtensa@linux-xtensa.org
    Cc: x86@kernel.org

    Eric Paris
     
  • For all arches which support audit implement syscall_get_arch()
    They are all pretty easy and straight forward, stolen from how the call
    to audit_syscall_entry() determines the arch.

    Based-on-patch-by: Richard Briggs
    Signed-off-by: Eric Paris
    Cc: linux-ia64@vger.kernel.org
    Cc: microblaze-uclinux@itee.uq.edu.au
    Cc: linux-mips@linux-mips.org
    Cc: linux@lists.openrisc.net
    Cc: linux-parisc@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: sparclinux@vger.kernel.org

    Eric Paris
     
  • Since Alpha supports syscall audit it now needs to have a syscall.h
    which implements syscall_get_arch() rather than hard coding this value
    into audit_syscall_entry().

    Based-on-patch-by: Richard Briggs
    Signed-off-by: Eric Paris
    Cc: linux-alpha@vger.kernel.org

    Eric Paris
     
  • This patch defines syscall_get_arch() for the um platform. It adds a
    new syscall.h header file to define this. It copies the HOST_AUDIT_ARCH
    definition from ptrace.h. (that definition will be removed when we
    switch audit to use this new syscall_get_arch() function)

    Based-on-patch-by: Richard Briggs
    Signed-off-by: Eric Paris
    Cc: user-mode-linux-devel@lists.sourceforge.net

    Eric Paris
     
  • This patch defines syscall_get_arch() for the superh platform. It does
    so in both syscall_32.h and syscall_64.h. I'm not certain if the
    implementation in syscall_64.h couldn't just be used in syscall.h as I
    can't really track the setting of CONFIG_64BIT...

    This way is safe, but we might be able to combine these if a superh
    person were able to review...

    [v2]
    fixed indentation stoopidity (Sergei Shtylyov)
    use AUDIT_ARCH_SH instead of EM_SH

    Based-on-patch-by: Richard Briggs
    Signed-off-by: Eric Paris
    Cc: linux-sh@vger.kernel.org

    Eric Paris
     

03 Aug, 2014

1 commit

  • Pull ARM fixes from Russell King:
    "A few fixes for ARM. Some of these are correctness issues:
    - TLBs must be flushed after the old mappings are removed by the DMA
    mapping code, but before the new mappings are established.
    - An off-by-one entry error in the Keystone LPAE setup code.

    Fixes include:
    - ensuring that the identity mapping for LPAE does not remove the
    kernel image from the identity map.
    - preventing userspace from trapping into kgdb.
    - fixing a preemption issue in the Intel iwmmxt code.
    - fixing a build error with nommu.

    Other changes include:
    - Adding a note about which areas of memory are expected to be
    accessible while the identity mapping tables are in place"

    * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    ARM: 8124/1: don't enter kgdb when userspace executes a kgdb break instruction
    ARM: idmap: add identity mapping usage note
    ARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout
    ARM: fix alignment of keystone page table fixup
    ARM: 8112/1: only select ARM_PATCH_PHYS_VIRT if MMU is enabled
    ARM: 8100/1: Fix preemption disable in iwmmxt_task_enable()
    ARM: DMA: ensure that old section mappings are flushed from the TLB

    Linus Torvalds
     

02 Aug, 2014

4 commits

  • The kgdb breakpoint hooks (kgdb_brk_fn and kgdb_compiled_brk_fn)
    should only be entered when a kgdb break instruction is executed
    from the kernel. Otherwise, if kgdb is enabled, a userspace program
    can cause the kernel to drop into the debugger by executing either
    KGDB_BREAKINST or KGDB_COMPILED_BREAK.

    Acked-by: Will Deacon
    Signed-off-by: Omar Sandoval
    Signed-off-by: Russell King

    Omar Sandoval
     
  • Add a note about the usage of the identity mapping; we do not support
    accesses outside of the identity map region and kernel image while a
    CPU is using the identity map. This is because the identity mapping
    may overwrite vmalloc space, IO mappings, the vectors pages, etc.

    Acked-by: Will Deacon
    Signed-off-by: Russell King

    Russell King
     
  • Pull x86 fix from Peter Anvin:
    "A single fix to not invoke the espfix code on Xen PV, as it turns out
    to oops the guest when invoked after all. This patch leaves some
    amount of dead code, in particular unnecessary initialization of the
    espfix stacks when they won't be used, but in the interest of keeping
    the patch minimal that cleanup can wait for the next cycle"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86_64/entry/xen: Do not invoke espfix64 on Xen

    Linus Torvalds
     
  • Pull ARM straggler SoC fix from Olof Johansson:
    "A DT bugfix for Nomadik that had an ambigouos double-inversion of a
    gpio line, and one MAINTAINER URL update that might as well go in now.

    We could hold off until the merge window, but then we'll just have to
    mark the DT fix for stable and it just seems like in total causing
    more work"

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    MAINTAINERS: Update Tegra Git URL
    ARM: nomadik: fix up double inversion in DT

    Linus Torvalds
     

31 Jul, 2014

3 commits

  • The GPIO pin connected to card detect was inverted twice: once by
    the argument to the GPIO line itself where it was magically marked
    as active low by the flag GPIO_ACTIVE_LOW (0x01) in the third cell,
    and also marked active low AGAIN by explicitly stating
    "cd-inverted" (a deprecated method).

    After commit 78f87df2b4f8760954d7d80603d0cfcbd4759683
    "mmc: mmci: Use the common mmc DT parser" this results in the
    line being inverted twice so it was effectively uninverted, while
    the old code would not have this effect, instead disregarding the
    flag on the GPIO line altogether, which is a bug. I admit the
    semantics may be unclear but inverting twice is as good a
    definition as any on how this should work.

    So fix up the buggy device tree. Use proper #includes so the DTS
    is clear and readable.

    Cc: Ulf Hansson
    Signed-off-by: Linus Walleij
    Signed-off-by: Olof Johansson

    Linus Walleij
     
  • Pull Exynos platform DT fix from Grant Likely:
    "Device tree Exynos bug fix for v3.16-rc7

    This bug fix has been brewing for a while. I hate sending it to you
    so late, but I only got confirmation that it solves the problem this
    past weekend. The diff looks big for a bug fix, but the majority of
    it is only executed in the Exynos quirk case. Unfortunately it
    required splitting early_init_dt_scan() in two and adding quirk
    handling in the middle of it on ARM.

    Exynos has buggy firmware that puts bad data into the memory node.
    Commit 1c2f87c22566 ("ARM: Get rid of meminfo") exposed the bug by
    dropping the artificial upper bound on the number of memory banks that
    can be added. Exynos fails to boot after that commit. This branch
    fixes it by splitting the early DT parse function and inserting a
    fixup hook. Exynos uses the hook to correct the DT before parsing
    memory regions"

    * tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
    arm: Add devicetree fixup machine function
    of: Add memory limiting function for flattened devicetrees
    of: Split early_init_dt_scan into two parts

    Linus Torvalds
     
  • Pull Xen fix from David Vrabel:
    "Fix BUG when trying to expand the grant table. This seems to occur
    often during boot with Ubuntu 14.04 PV guests"

    * tag 'stable/for-linus-3.16-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    x86/xen: safely map and unmap grant frames when in atomic context

    Linus Torvalds
     

30 Jul, 2014

3 commits

  • arch_gnttab_map_frames() and arch_gnttab_unmap_frames() are called in
    atomic context but were calling alloc_vm_area() which might sleep.

    Also, if a driver attempts to allocate a grant ref from an interrupt
    and the table needs expanding, then the CPU may already by in lazy MMU
    mode and apply_to_page_range() will BUG when it tries to re-enable
    lazy MMU mode.

    These two functions are only used in PV guests.

    Introduce arch_gnttab_init() to allocates the virtual address space in
    advance.

    Avoid the use of apply_to_page_range() by using saving and using the
    array of PTE addresses from the alloc_vm_area() call (which ensures
    that the required page tables are pre-allocated).

    Signed-off-by: David Vrabel
    Signed-off-by: Konrad Rzeszutek Wilk

    David Vrabel
     
  • Commit 1c2f87c22566cd057bc8cde10c37ae9da1a1bb76
    (ARM: 8025/1: Get rid of meminfo) dropped the upper bound on
    the number of memory banks that can be added as there was no
    technical need in the kernel. It turns out though, some bootloaders
    (specifically the arndale-octa exynos boards) may pass invalid memory
    information and rely on the kernel to not parse this data. This is a
    bug in the bootloader but we still need to work around this.
    Work around this by introducing a dt_fixup function. This function
    gets called before the flattened devicetree is scanned for memory
    and the like. In this fixup function for exynos, limit the maximum
    number of memory regions in the devicetree.

    Signed-off-by: Laura Abbott
    Tested-by: Andreas Färber
    [glikely: Added a comment and fixed up function name]
    Signed-off-by: Grant Likely

    Laura Abbott
     
  • Pull ARM SoC fixes from Arnd Bergmann:
    "A nice small set of bug fixes for arm-soc:

    - two incorrect register addresses in DT files on shmobile and hisilicon
    - one revert for a regression on omap
    - one bug fix for a newly introduced pin controller binding
    - one regression fix for the memory controller on omap
    - one patch to avoid a harmless WARN_ON"

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: dts: Revert enabling of twl configuration for n900
    ARM: dts: fix L2 address in Hi3620
    ARM: OMAP2+: gpmc: fix gpmc_hwecc_bch_capable()
    pinctrl: dra: dt-bindings: Fix pull enable/disable
    ARM: shmobile: r8a7791: Fix SD2CKCR register address
    ARM: OMAP2+: l2c: squelch warning dump on power control setting

    Linus Torvalds
     

29 Jul, 2014

7 commits

  • On LPAE, each level 1 (pgd) page table entry maps 1GiB, and the level 2
    (pmd) entries map 2MiB.

    When the identity mapping is created on LPAE, the pgd pointers are copied
    from the swapper_pg_dir. If we find that we need to modify the contents
    of a pmd, we allocate a new empty pmd table and insert it into the
    appropriate 1GB slot, before then filling it with the identity mapping.

    However, if the 1GB slot covers the kernel lowmem mappings, we obliterate
    those mappings.

    When replacing a PMD, first copy the old PMD contents to the new PMD, so
    that we preserve the existing mappings, particularly the mappings of the
    kernel itself.

    [rewrote commit message and added code comment -- rmk]

    Fixes: ae2de101739c ("ARM: LPAE: Add identity mapping support for the 3-level page table format")
    Signed-off-by: Konstantin Khlebnikov
    Signed-off-by: Russell King

    Konstantin Khlebnikov
     
  • …/kernel/git/tmlind/linux-omap into fixes

    Merge "omap n900 regression fix for v3.16 rc series" from Tony Lindgren:

    Minimal regression fix for n900 display that got broken with
    enabling of twl4030 PM features. Turns out more work is needed
    before we can enable twl4030 PM on n900.

    I did not notice this earlier as I have my n900 in a rack
    and the display did not get enabled for device tree based booting
    until for v3.16.

    * tag 'omap-for-v3.16/n900-regression' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
    ARM: dts: Revert enabling of twl configuration for n900

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

    Arnd Bergmann
     
  • If init_mm.brk is not section aligned, the LPAE fixup code will miss
    updating the final PMD. Fix this by aligning map_end.

    Fixes: a77e0c7b2774 ("ARM: mm: Recreate kernel mappings in early_paging_init()")
    Cc:
    Signed-off-by: Russell King

    Russell King
     
  • Commit 9188883fd66e9 (ARM: dts: Enable twl4030 off-idle configuration
    for selected omaps) allowed n900 to cut off core voltages during
    off-idle. This however caused a regression where twl regulator
    vaux1 was not getting enabled for the LCD panel as we are not
    requesting it for the panel.

    Turns out quite a few devices on n900 are using vaux1, and we need
    to either stop idling it, or add proper regulator_get calls for all
    users. But until we have a proper solution implemented and tested,
    let's just disable the twl off-idle configuration for now for n900.

    Reported-by: Aaro Koskinen
    Fixes: 9188883fd66e9 (ARM: dts: Enable twl4030 off-idle configuration for selected omaps)
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     
  • This moves the espfix64 logic into native_iret. To make this work,
    it gets rid of the native patch for INTERRUPT_RETURN:
    INTERRUPT_RETURN on native kernels is now 'jmp native_iret'.

    This changes the 16-bit SS behavior on Xen from OOPSing to leaking
    some bits of the Xen hypervisor's RSP (I think).

    [ hpa: this is a nonzero cost on native, but probably not enough to
    measure. Xen needs to fix this in their own code, probably doing
    something equivalent to espfix64. ]

    Signed-off-by: Andy Lutomirski
    Link: http://lkml.kernel.org/r/7b8f1d8ef6597cb16ae004a43c56980a7de3cf94.1406129132.git.luto@amacapital.net
    Signed-off-by: H. Peter Anvin
    Cc:

    Andy Lutomirski
     
  • Pull ARM AES crypto fixes from Herbert Xu:
    "This push fixes a regression on ARM where odd-sized blocks supplied to
    AES may cause crashes"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: arm-aes - fix encryption of unaligned data
    crypto: arm64-aes - fix encryption of unaligned data

    Linus Torvalds
     
  • Pull powerpc fixes from Ben Herrenschmidt:
    "Here are 3 more small powerpc fixes that should still go into .16.

    One is a recent regression (MMCR2 business), the other is a trivial
    endian fix without which FW updates won't work on LE in IBM machines,
    and the 3rd one turns a BUG_ON into a WARN_ON which is definitely a
    LOT more friendly especially when the whole thing is about retrieving
    error logs ..."

    * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
    powerpc: Fix endianness of flash_block_list in rtas_flash
    powerpc/powernv: Change BUG_ON to WARN_ON in elog code
    powerpc/perf: Fix MMCR2 handling for EBB

    Linus Torvalds
     

28 Jul, 2014

6 commits

  • Fix the same alignment bug as in arm64 - we need to pass residue
    unprocessed bytes as the last argument to blkcipher_walk_done.

    Signed-off-by: Mikulas Patocka
    Cc: stable@vger.kernel.org # 3.13+
    Acked-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Mikulas Patocka
     
  • cryptsetup fails on arm64 when using kernel encryption via AF_ALG socket.
    See https://bugzilla.redhat.com/show_bug.cgi?id=1122937

    The bug is caused by incorrect handling of unaligned data in
    arch/arm64/crypto/aes-glue.c. Cryptsetup creates a buffer that is aligned
    on 8 bytes, but not on 16 bytes. It opens AF_ALG socket and uses the
    socket to encrypt data in the buffer. The arm64 crypto accelerator causes
    data corruption or crashes in the scatterwalk_pagedone.

    This patch fixes the bug by passing the residue bytes that were not
    processed as the last parameter to blkcipher_walk_done.

    Signed-off-by: Mikulas Patocka
    Acked-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Mikulas Patocka
     
  • The function rtas_flash_firmware passes the address of a data structure,
    flash_block_list, when making the update-flash-64-and-reboot rtas call.
    While the endianness of the address is handled correctly, the endianness
    of the data is not. This patch ensures that the data in flash_block_list
    is big endian when passed to rtas on little endian hosts.

    Signed-off-by: Thomas Falcon
    Signed-off-by: Benjamin Herrenschmidt

    Thomas Falcon
     
  • We can continue to read the error log (up to MAX size) even if
    we get the elog size more than MAX size. Hence change BUG_ON to
    WARN_ON.

    Also updated error message.

    Reported-by: Gopesh Kumar Chaudhary
    Signed-off-by: Vasant Hegde
    Signed-off-by: Ananth N Mavinakayanahalli
    Acked-by: Deepthi Dharwar
    Acked-by: Stewart Smith
    Signed-off-by: Benjamin Herrenschmidt

    Vasant Hegde
     
  • Pull perf fixes from Thomas Gleixner:
    "A bunch of fixes for perf and kprobes:
    - revert a commit that caused a perf group regression
    - silence dmesg spam
    - fix kprobe probing errors on ia64 and ppc64
    - filter kprobe faults from userspace
    - lockdep fix for perf exit path
    - prevent perf #GP in KVM guest
    - correct perf event and filters"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    kprobes: Fix "Failed to find blacklist" probing errors on ia64 and ppc64
    kprobes/x86: Don't try to resolve kprobe faults from userspace
    perf/x86/intel: Avoid spamming kernel log for BTS buffer failure
    perf/x86/intel: Protect LBR and extra_regs against KVM lying
    perf: Fix lockdep warning on process exit
    perf/x86/intel/uncore: Fix SNB-EP/IVT Cbox filter mappings
    perf/x86/intel: Use proper dTLB-load-misses event on IvyBridge
    perf: Revert ("perf: Always destroy groups on exit")

    Linus Torvalds
     
  • Pull x86 fixes from Peter Anvin:
    "A couple of crash fixes, plus a fix that on 32 bits would cause a
    missing -ENOSYS for nonexistent system calls"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, cpu: Fix cache topology for early P4-SMT
    x86_32, entry: Store badsys error code in %eax
    x86, MCE: Robustify mcheck_init_device

    Linus Torvalds
     

26 Jul, 2014

4 commits