1. 28 4月, 2016 6 次提交
  2. 23 4月, 2016 1 次提交
  3. 07 4月, 2016 2 次提交
  4. 01 4月, 2016 1 次提交
    • A
      efi/arm64: Don't apply MEMBLOCK_NOMAP to UEFI memory map mapping · 7cc8cbcf
      Ard Biesheuvel 提交于
      Commit 4dffbfc4 ("arm64/efi: mark UEFI reserved regions as
      MEMBLOCK_NOMAP") updated the mapping logic of both the RuntimeServices
      regions as well as the kernel's copy of the UEFI memory map to set the
      MEMBLOCK_NOMAP flag, which causes these regions to be omitted from the
      kernel direct mapping, and from being covered by a struct page.
      For the RuntimeServices regions, this is an obvious win, since the contents
      of these regions have significance to the firmware executable code itself,
      and are mapped in the EFI page tables using attributes that are described in
      the UEFI memory map, and which may differ from the attributes we use for
      mapping system RAM. It also prevents the contents from being modified
      inadvertently, since the EFI page tables are only live during runtime
      service invocations.
      
      None of these concerns apply to the allocation that covers the UEFI memory
      map, since it is entirely owned by the kernel. Setting the MEMBLOCK_NOMAP on
      the region did allow us to use ioremap_cache() to map it both on arm64 and
      on ARM, since the latter does not allow ioremap_cache() to be used on
      regions that are covered by a struct page.
      
      The ioremap_cache() on ARM restriction will be lifted in the v4.7 timeframe,
      but in the mean time, it has been reported that commit 4dffbfc4 causes
      a regression on 64k granule kernels. This is due to the fact that, given
      the 64 KB page size, the region that we end up removing from the kernel
      direct mapping is rounded up to 64 KB, and this 64 KB page frame may be
      shared with the initrd when booting via GRUB (which does not align its
      EFI_LOADER_DATA allocations to 64 KB like the stub does). This will crash
      the kernel as soon as it tries to access the initrd.
      
      Since the issue is specific to arm64, revert back to memblock_reserve()'ing
      the UEFI memory map when running on arm64. This is a temporary fix for v4.5
      and v4.6, and will be superseded in the v4.7 timeframe when we will be able
      to move back to memblock_reserve() unconditionally.
      
      Fixes: 4dffbfc4 ("arm64/efi: mark UEFI reserved regions as MEMBLOCK_NOMAP")
      Reported-by: NMark Salter <msalter@redhat.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Jeremy Linton <jeremy.linton@arm.com>
      Cc: Mark Langsdorf <mlangsdo@redhat.com>
      Cc: <stable@vger.kernel.org> # v4.5
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      7cc8cbcf
  5. 23 3月, 2016 2 次提交
    • D
      kernel: add kcov code coverage · 5c9a8750
      Dmitry Vyukov 提交于
      kcov provides code coverage collection for coverage-guided fuzzing
      (randomized testing).  Coverage-guided fuzzing is a testing technique
      that uses coverage feedback to determine new interesting inputs to a
      system.  A notable user-space example is AFL
      (http://lcamtuf.coredump.cx/afl/).  However, this technique is not
      widely used for kernel testing due to missing compiler and kernel
      support.
      
      kcov does not aim to collect as much coverage as possible.  It aims to
      collect more or less stable coverage that is function of syscall inputs.
      To achieve this goal it does not collect coverage in soft/hard
      interrupts and instrumentation of some inherently non-deterministic or
      non-interesting parts of kernel is disbled (e.g.  scheduler, locking).
      
      Currently there is a single coverage collection mode (tracing), but the
      API anticipates additional collection modes.  Initially I also
      implemented a second mode which exposes coverage in a fixed-size hash
      table of counters (what Quentin used in his original patch).  I've
      dropped the second mode for simplicity.
      
      This patch adds the necessary support on kernel side.  The complimentary
      compiler support was added in gcc revision 231296.
      
      We've used this support to build syzkaller system call fuzzer, which has
      found 90 kernel bugs in just 2 months:
      
        https://github.com/google/syzkaller/wiki/Found-Bugs
      
      We've also found 30+ bugs in our internal systems with syzkaller.
      Another (yet unexplored) direction where kcov coverage would greatly
      help is more traditional "blob mutation".  For example, mounting a
      random blob as a filesystem, or receiving a random blob over wire.
      
      Why not gcov.  Typical fuzzing loop looks as follows: (1) reset
      coverage, (2) execute a bit of code, (3) collect coverage, repeat.  A
      typical coverage can be just a dozen of basic blocks (e.g.  an invalid
      input).  In such context gcov becomes prohibitively expensive as
      reset/collect coverage steps depend on total number of basic
      blocks/edges in program (in case of kernel it is about 2M).  Cost of
      kcov depends only on number of executed basic blocks/edges.  On top of
      that, kernel requires per-thread coverage because there are always
      background threads and unrelated processes that also produce coverage.
      With inlined gcov instrumentation per-thread coverage is not possible.
      
      kcov exposes kernel PCs and control flow to user-space which is
      insecure.  But debugfs should not be mapped as user accessible.
      
      Based on a patch by Quentin Casasnovas.
      
      [akpm@linux-foundation.org: make task_struct.kcov_mode have type `enum kcov_mode']
      [akpm@linux-foundation.org: unbreak allmodconfig]
      [akpm@linux-foundation.org: follow x86 Makefile layout standards]
      Signed-off-by: NDmitry Vyukov <dvyukov@google.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Cc: syzkaller <syzkaller@googlegroups.com>
      Cc: Vegard Nossum <vegard.nossum@oracle.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Tavis Ormandy <taviso@google.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
      Cc: Kostya Serebryany <kcc@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Kees Cook <keescook@google.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: David Drysdale <drysdale@google.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5c9a8750
    • A
      drivers/firmware/efi/efivars.c: use in_compat_syscall() to check for compat callers · 4f01ed22
      Andy Lutomirski 提交于
      This should make no difference on any architecture, as x86's historical
      is_compat_task behavior really did check whether the calling syscall was
      a compat syscall.  x86's is_compat_task is going away, though.
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Reviewed-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4f01ed22
  6. 18 3月, 2016 1 次提交
  7. 14 3月, 2016 1 次提交
  8. 29 2月, 2016 1 次提交
    • J
      objtool: Mark non-standard object files and directories · c0dd6716
      Josh Poimboeuf 提交于
      Code which runs outside the kernel's normal mode of operation often does
      unusual things which can cause a static analysis tool like objtool to
      emit false positive warnings:
      
       - boot image
       - vdso image
       - relocation
       - realmode
       - efi
       - head
       - purgatory
       - modpost
      
      Set OBJECT_FILES_NON_STANDARD for their related files and directories,
      which will tell objtool to skip checking them.  It's ok to skip them
      because they don't affect runtime stack traces.
      
      Also skip the following code which does the right thing with respect to
      frame pointers, but is too "special" to be validated by a tool:
      
       - entry
       - mcount
      
      Also skip the test_nx module because it modifies its exception handling
      table at runtime, which objtool can't understand.  Fortunately it's
      just a test module so it doesn't matter much.
      
      Currently objtool is the only user of OBJECT_FILES_NON_STANDARD, but it
      might eventually be useful for other tools.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Chris J Arges <chris.j.arges@canonical.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Pedro Alves <palves@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Link: http://lkml.kernel.org/r/366c080e3844e8a5b6a0327dc7e8c2b90ca3baeb.1456719558.git.jpoimboe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c0dd6716
  9. 24 2月, 2016 4 次提交
  10. 22 2月, 2016 7 次提交
  11. 16 2月, 2016 4 次提交
    • M
      efi: Add pstore variables to the deletion whitelist · e246eb56
      Matt Fleming 提交于
      Laszlo explains why this is a good idea,
      
       'This is because the pstore filesystem can be backed by UEFI variables,
        and (for example) a crash might dump the last kilobytes of the dmesg
        into a number of pstore entries, each entry backed by a separate UEFI
        variable in the above GUID namespace, and with a variable name
        according to the above pattern.
      
        Please see "drivers/firmware/efi/efi-pstore.c".
      
        While this patch series will not prevent the user from deleting those
        UEFI variables via the pstore filesystem (i.e., deleting a pstore fs
        entry will continue to delete the backing UEFI variable), I think it
        would be nice to preserve the possibility for the sysadmin to delete
        Linux-created UEFI variables that carry portions of the crash log,
        *without* having to mount the pstore filesystem.'
      
      There's also no chance of causing machines to become bricked by
      deleting these variables, which is the whole purpose of excluding
      things from the whitelist.
      
      Use the LINUX_EFI_CRASH_GUID guid and a wildcard '*' for the match so
      that we don't have to update the string in the future if new variable
      name formats are created for crash dump variables.
      Reported-by: NLaszlo Ersek <lersek@redhat.com>
      Acked-by: NPeter Jones <pjones@redhat.com>
      Tested-by: NPeter Jones <pjones@redhat.com>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: "Lee, Chun-Yi" <jlee@suse.com>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      e246eb56
    • S
      firmware: arm_scpi: add support for 64-bit sensor values · 2e874159
      Sudeep Holla 提交于
      SCPI specification version 1.1 extended the sensor from 32-bit to 64-bit
      values in order to accommodate new sensor class with 64-bit requirements
      
      Since the SCPI driver sets the higher 32-bit for older protocol version
      to zeros, there's no need to explicitly check the SCPI protocol version
      and the backward compatibility is maintainted.
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: NPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      2e874159
    • S
      firmware: arm_scpi: decrease Tx timeout to 20ms · 3bdd8843
      Sudeep Holla 提交于
      Currently we have Tx timeout of 50ms while Rx timeout of 20 ms. Tx state
      machine is maintained by the mailbox framework and Rx by SCPI driver.
      
      It is possible that before msg_submit call tx_prepare(because of other
      message in the queue and the channel being active), wait for completion
      in scpi_send_message times out and the buffers are freed. In that case
      when Tx state machine timer goes off later, poll_txdone calls
      scpi_tx_prepare on that message, which adds it to the rx_pending list,
      corrupting link pointers.
      
      This patch reduces the Tx timeout to 20ms and increases Rx timeout to
      30ms to avoid the above mentioned issue.
      Reported-by: NJon Medhurst (Tixy) <tixy@linaro.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      3bdd8843
    • S
      firmware: arm_scpi: fix send_message and sensor_get_value for big-endian · dd9a1d69
      Sudeep Holla 提交于
      scpi_process_cmd converts the status word from little endian to cpu
      endianness. However scpi_send_message again does the conversion which is
      wrong and shows up as a bug only when running in big-endian kernel.
      
      Similarly scpi_sensor_get_value passes the sensor index in the cpu
      endianness to SCP which results in SCPI_ERR_RANGE in big-endian mode.
      
      This patch fixes the above mentioned issue for big-endian kernel.
      Acked-by: NPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      dd9a1d69
  12. 12 2月, 2016 2 次提交
  13. 11 2月, 2016 3 次提交
  14. 10 2月, 2016 4 次提交
  15. 03 2月, 2016 1 次提交