1. 12 2月, 2013 2 次提交
    • M
      efivarfs: guid part of filenames are case-insensitive · da27a243
      Matt Fleming 提交于
      It makes no sense to treat the following filenames as unique,
      
      	VarName-abcdefab-abcd-abcd-abcd-abcdefabcdef
      	VarName-ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF
      	VarName-ABcDEfAB-ABcD-ABcD-ABcD-ABcDEfABcDEf
      	VarName-aBcDEfAB-aBcD-aBcD-aBcD-aBcDEfaBcDEf
      	... etc ...
      
      since the guid will be converted into a binary representation, which
      has no case.
      
      Roll our own dentry operations so that we can treat the variable name
      part of filenames ("VarName" in the above example) as case-sensitive,
      but the guid portion as case-insensitive. That way, efivarfs will
      refuse to create the above files if any one already exists.
      Reported-by: NLingzhu Xiang <lxiang@redhat.com>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      da27a243
    • M
      efivarfs: Validate filenames much more aggressively · 47f531e8
      Matt Fleming 提交于
      The only thing that efivarfs does to enforce a valid filename is
      ensure that the name isn't too short. We need to strongly sanitise any
      filenames, not least because variable creation is delayed until
      efivarfs_file_write(), which means we can't rely on the firmware to
      inform us of an invalid name, because if the file is never written to
      we'll never know it's invalid.
      
      Perform a couple of steps before agreeing to create a new file,
      
        * hex_to_bin() returns a value indicating whether or not it was able
          to convert its arguments to a binary representation - we should
          check it.
      
        * Ensure that the GUID portion of the filename is the correct length
          and format.
      
        * The variable name portion of the filename needs to be at least one
          character in size.
      Reported-by: NLingzhu Xiang <lxiang@redhat.com>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      47f531e8
  2. 31 1月, 2013 9 次提交
    • M
      efivarfs: Use sizeof() instead of magic number · 94a193fb
      Matt Fleming 提交于
      Instead of adding a magic 4 to the variable size, use sizeof() to make
      it explicitly clear what the quantity represents (the variable's
      attributes).
      
      CC: Jeremy Kerr <jeremy.kerr@canonical.com>
      Cc: Chun-Yi Lee <joeyli.kernel@gmail.com>
      Cc: Andy Whitcroft <apw@canonical.com>
      Reported-by: NLingzhu Xiang <lxiang@redhat.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      94a193fb
    • L
      x86, efi: Allow slash in file path of initrd · deb94101
      Lee, Chun-Yi 提交于
      When initrd file didn't put at the same place with stub kernel, we
      need give the file path of initrd, but need use backslash to separate
      directory and file. It's not friendly to unix/linux user, and not so
      intuitive for bootloader forward paramters to efi stub kernel by
      chainloading.
      
      This patch add support to handle_ramdisks for allow slash in file path
      of initrd, it convert slash to backlash when parsing path.
      
      In additional, this patch also separates print code of efi_char16_t from
      efi_printk, and print out the path/filename of initrd when failed to open
      initrd file. It's good for debug and discover typo.
      
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NLee, Chun-Yi <jlee@suse.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      deb94101
    • L
      Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 04c2eee5
      Linus Torvalds 提交于
      Pull x86 EFI fixes from Peter Anvin:
       "This is a collection of fixes for the EFI support.  The controversial
        bit here is a set of patches which bumps the boot protocol version as
        part of fixing some serious problems with the EFI handover protocol,
        used when booting under EFI using a bootloader as opposed to directly
        from EFI.  These changes should also make it a lot saner to support
        cross-mode 32/64-bit EFI booting in the future.  Getting these changes
        into 3.8 means we avoid presenting an inconsistent ABI to bootloaders.
      
        Other changes are display detection and fixing efivarfs."
      
      * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, efi: remove attribute check from setup_efi_pci
        x86, build: Dynamically find entry points in compressed startup code
        x86, efi: Fix PCI ROM handing in EFI boot stub, in 32-bit mode
        x86, efi: Fix 32-bit EFI handover protocol entry point
        x86, efi: Fix display detection in EFI boot stub
        x86, boot: Define the 2.12 bzImage boot protocol
        x86/boot: Fix minor fd leakage in tools/relocs.c
        x86, efi: Set runtime_version to the EFI spec revision
        x86, efi: fix 32-bit warnings in setup_efi_pci()
        efivarfs: Delete dentry from dcache in efivarfs_file_write()
        efivarfs: Never return ENOENT from firmware
        efi, x86: Pass a proper identity mapping in efi_call_phys_prelog
        efivarfs: Drop link count of the right inode
      04c2eee5
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · bdb0ae6a
      Linus Torvalds 提交于
      Pull x86 fixes from Peter Anvin:
       "This is a collection of miscellaneous fixes, the most important one is
        the fix for the Samsung laptop bricking issue (auto-blacklisting the
        samsung-laptop driver); the efi_enabled() changes you see below are
        prerequisites for that fix.
      
        The other issues fixed are booting on OLPC XO-1.5, an UV fix, NMI
        debugging, and requiring CAP_SYS_RAWIO for MSR references, just as
        with I/O port references."
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        samsung-laptop: Disable on EFI hardware
        efi: Make 'efi_enabled' a function to query EFI facilities
        smp: Fix SMP function call empty cpu mask race
        x86/msr: Add capabilities check
        x86/dma-debug: Bump PREALLOC_DMA_DEBUG_ENTRIES
        x86/olpc: Fix olpc-xo1-sci.c build errors
        arch/x86/platform/uv: Fix incorrect tlb flush all issue
        x86-64: Fix unwind annotations in recent NMI changes
        x86-32: Start out cr0 clean, disable paging before modifying cr3/4
      bdb0ae6a
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 0fe94b9e
      Linus Torvalds 提交于
      Pull console lockdep checking revert from Dave Airlie.
      
      The lockdep splat this showed was interesting, but it's very very old,
      and we won't be fixing it until 3.9.  In the meantime, undo the lockdep
      annotation so that we don't generate the (known) console lockdep issue,
      and then possibly hide any potential other (unknown) lockdep problems
      that got disabled by the first one that triggered.
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        Revert "console: implement lockdep support for console_lock"
      0fe94b9e
    • D
      Revert "console: implement lockdep support for console_lock" · ff0d05bf
      Dave Airlie 提交于
      This reverts commit daee7797.
      
      I'll requeue this after the console locking fixes, so lockdep
      is useful again for people until fbcon is fixed.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ff0d05bf
    • H
      Merge tag 'efi-for-3.8' into x86/efi · becbd660
      H. Peter Anvin 提交于
      Various urgent EFI fixes and some warning cleanups for v3.8
      
        * EFI boot stub fix for Macbook Pro's from Maarten Lankhorst
        * Fix an oops in efivarfs from Lingzhu Xiang
        * 32-bit warning cleanups from Jan Beulich
        * Patch to Boot on >512GB RAM systems from Nathan Zimmer
        * Set efi.runtime_version correctly
        * efivarfs updates
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      becbd660
    • M
      samsung-laptop: Disable on EFI hardware · e0094244
      Matt Fleming 提交于
      It has been reported that running this driver on some Samsung laptops
      with EFI can cause those machines to become bricked as detailed in the
      following report,
      
      	https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
      
      There have also been reports of this driver causing Machine Check
      Exceptions on recent EFI-enabled Samsung laptops,
      
      	https://bugzilla.kernel.org/show_bug.cgi?id=47121
      
      So disable it if booting from EFI since this driver relies on
      grovelling around in the BIOS memory map which isn't going to work.
      
      Cc: Corentin Chary <corentincj@iksaif.net>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Colin Ian King <colin.king@canonical.com>
      Cc: Steve Langasek <steve.langasek@canonical.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      e0094244
    • M
      efi: Make 'efi_enabled' a function to query EFI facilities · 83e68189
      Matt Fleming 提交于
      Originally 'efi_enabled' indicated whether a kernel was booted from
      EFI firmware. Over time its semantics have changed, and it now
      indicates whether or not we are booted on an EFI machine with
      bit-native firmware, e.g. 64-bit kernel with 64-bit firmware.
      
      The immediate motivation for this patch is the bug report at,
      
          https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
      
      which details how running a platform driver on an EFI machine that is
      designed to run under BIOS can cause the machine to become
      bricked. Also, the following report,
      
          https://bugzilla.kernel.org/show_bug.cgi?id=47121
      
      details how running said driver can also cause Machine Check
      Exceptions. Drivers need a new means of detecting whether they're
      running on an EFI machine, as sadly the expression,
      
          if (!efi_enabled)
      
      hasn't been a sufficient condition for quite some time.
      
      Users actually want to query 'efi_enabled' for different reasons -
      what they really want access to is the list of available EFI
      facilities.
      
      For instance, the x86 reboot code needs to know whether it can invoke
      the ResetSystem() function provided by the EFI runtime services, while
      the ACPI OSL code wants to know whether the EFI config tables were
      mapped successfully. There are also checks in some of the platform
      driver code to simply see if they're running on an EFI machine (which
      would make it a bad idea to do BIOS-y things).
      
      This patch is a prereq for the samsung-laptop fix patch.
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Corentin Chary <corentincj@iksaif.net>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: Colin Ian King <colin.king@canonical.com>
      Cc: Steve Langasek <steve.langasek@canonical.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      83e68189
  3. 30 1月, 2013 12 次提交
    • L
      Merge tag 'edac_for_3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · a56e1600
      Linus Torvalds 提交于
      Pull EDAC fixlets from Borislav Petkov:
       "Two minor correctness fixlets from Dan Carpenter and Joe Perches each."
      
      * tag 'edac_for_3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
        EDAC: Fix kcalloc argument order
        EDAC: Test correct variable in ->store function
      a56e1600
    • L
      Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 58ff603b
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
      
       - A collection of small ASoC driver fixes (error path fixes, register
         correction, regulator bypass mode fix, etc)
      
       - A few regression fixes and quirks of HD-audio (wrong page attributes
         for SG-buffer, Poulsbo/Oaktrail controller fix, digital mic fix for
         Acer, etc)
      
       - A fix for USB-audio UAC2 devices wrt FU length check
      
      * tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Fix non-snoop page handling
        ALSA: hda - Enable LPIB delay count for Poulsbo / Oaktrail
        ALSA: hda - fix inverted internal mic on Acer AOA150/ZG5
        ALSA: usb-audio: fix invalid length check for RME and other UAC 2 devices
        ALSA: hda - Add a fixup for Packard-Bell desktop with ALC880
        ASoC: wm_adsp: Release firmware on error
        ASoC: wm_adsp: Use GFP_DMA for things that may be DMAed
        ASoC: arizona: Use actual rather than desired BCLK when calculating LRCLK
        ASoC: wm2200: correct mixer values and text
        ASoC: MAINTAINERS: Update email address.
        ASoC: wm5110: Correct AEC loopback mask
        ASoC: wm5102: Correct AEC loopback mask
        ASoC: dapm: Fix sense of regulator bypass mode
        ASoC: fsl: fix multiple definition of init_module
        ASoC: arizona: Disable free-running mode on FLL1
      58ff603b
    • J
      EDAC: Fix kcalloc argument order · d3d09e18
      Joe Perches 提交于
      First number, then size.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      d3d09e18
    • D
      EDAC: Test correct variable in ->store function · 8024c4c0
      Dan Carpenter 提交于
      We're testing for ->show but calling ->store().
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      8024c4c0
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 2e51b231
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Intel, radeon and exynos fixes.  Nothing too major or wierd: one dmar
        fix and a radeon cursor corruption, along with misc exynos fixes."
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (21 commits)
        drm/exynos: add check for the device power status
        drm/exynos: Make 'drm_hdmi_get_edid' static
        drm/exynos: fimd and ipp are broken on multiplatform
        drm/exynos: don't include plat/gpio-cfg.h
        drm/exynos: Remove "internal" interrupt handling
        drm/exynos: Add missing static specifiers in exynos_drm_rotator.c
        drm/exynos: Replace mdelay with usleep_range
        drm/exynos: Make ipp_handle_cmd_work static
        drm/exynos: Make g2d_userptr_get_dma_addr static
        drm/exynos: consider DMA_NONE flag to dmabuf import
        drm/exynos: free sg object if dma_map_sg is failed
        drm/exynos: added validation of edid for vidi connection
        drm/exynos: let drm handle edid allocations
        drm/radeon: Enable DMA_IB_SWAP_ENABLE on big endian hosts.
        drm/radeon: fix a rare case of double kfree
        radeon_display: Use pointer return error codes
        drm/radeon: fix cursor corruption on DCE6 and newer
        drm/i915: dump UTS_RELEASE into the error_state
        iommu/intel: disable DMAR for g4x integrated gfx
        drm/i915: GFX_MODE Flush TLB Invalidate Mode must be '1' for scanline waits
        ...
      2e51b231
    • L
      Merge tag 'for-linus-v3.8-rc6' of git://oss.sgi.com/xfs/xfs · f96736e1
      Linus Torvalds 提交于
      Pull xfs bugfixes from Ben Myers:
       "Here are fixes for returning EFSCORRUPTED on probe of a non-xfs
        filesystem, the stack switch in xfs_bmapi_allocate, a crash in
        _xfs_buf_find, speculative preallocation as the filesystem nears
        ENOSPC, an unmount hang, a race with AIO, and a regression with
        xfs_fsr:
      
         - fix return value when filesystem probe finds no XFS magic, a
           regression introduced in 98021821.
      
         - fix stack switch in __xfs_bmapi_allocate by moving the check for
           stack switch up into xfs_bmapi_write.
      
         - fix oops in _xfs_buf_find by validating that the requested block is
           within the filesystem bounds.
      
         - limit speculative preallocation near ENOSPC.
      
         - fix an unmount hang in xfs_wait_buftarg by freeing the
           xfs_buf_log_item in xfs_buf_item_unlock.
      
         - fix a possible use after free with AIO.
      
         - fix xfs_swap_extents after removal of xfs_flushinval_pages, a
           regression introduced in commit fb595814."
      
      * tag 'for-linus-v3.8-rc6' of git://oss.sgi.com/xfs/xfs:
        xfs: Fix xfs_swap_extents() after removal of xfs_flushinval_pages()
        xfs: Fix possible use-after-free with AIO
        xfs: fix shutdown hang on invalid inode during create
        xfs: limit speculative prealloc near ENOSPC thresholds
        xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end
        xfs: pull up stack_switch check into xfs_bmapi_write
        xfs: Do not return EFSCORRUPTED when filesystem probe finds no XFS magic
      f96736e1
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 8e5d573a
      Linus Torvalds 提交于
      Pull one s390 fix from Martin Schwidefsky:
       "Another transparent huge page fix, we need to define a s390 variant
        for pmdp_set_wrprotect to flush the TLB for the huge page correctly."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/thp: implement pmdp_set_wrprotect()
      8e5d573a
    • L
      Merge tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · d6a3bf93
      Linus Torvalds 提交于
      Pull pinctrl fixes from Linus Walleij:
       "This is a late pinctrl fix pull request, we had to revert out the
        pinctrl-single GPIO backend, because of, well, design issues.  We're
        cooking a better thing for the next cycle.
      
         - Revert gpio request/free backend, new patch set in the works, will
           be for v3.9.  Get this old cruft out before anyone hurts himself on
           it.
         - Kconfig buzz
         - Various compile warnings
         - MPP6 value for the Kirkwood"
      
      * tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: nomadik: nmk_prcm_gpiocr_get_mode may be unused
        pinctrl: exynos: don't mark probing functions as __init
        Revert "pinctrl: single: support gpio request and free"
        pinctrl: mvebu: fix MPP6 value for kirkwood driver
        pinctrl: mvebu: Fix compiler warnings
        pinctrl: pinctrl-mxs: Fix variables' definition type
        pinctrl: samsung: removing duplicated condition for PINCTRL_SAMSUNG
      d6a3bf93
    • A
      pinctrl: nomadik: nmk_prcm_gpiocr_get_mode may be unused · 0fafd50e
      Arnd Bergmann 提交于
      nmk_prcm_gpiocr_get_mode is only needed for debugfs output at
      the moment, which can be compile-time disabled. Marking
      the function __maybe_unused still gives us compile-time
      coverage, but avoids a gcc warning.
      
      Without this patch, building nhk8815_defconfig results in:
      
      drivers/pinctrl/pinctrl-nomadik.c:676:12: warning: 'nmk_prcm_gpiocr_get_mode' defined but not used [-Wunused-function]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Jean-Nicolas Graux <jean-nicolas.graux@stericsson.com>
      Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      0fafd50e
    • A
      pinctrl: exynos: don't mark probing functions as __init · 312b00e5
      Arnd Bergmann 提交于
      Functions called from a driver probe() method must not be
      marked __init, because they may get called after the
      init phase is done, when the device shows up late, or
      because of deferred probing.
      
      Without this patch, building exynos_defconfig results in
      multiple warnings like:
      
      WARNING: drivers/pinctrl/built-in.o(.text+0x51bc): Section mismatch in reference from the function exynos5440_pinctrl_probe() to the function .init.text:exynos5440_gpiolib_register()
      The function exynos5440_pinctrl_probe() references
      the function __init exynos5440_gpiolib_register().
      This is often because exynos5440_pinctrl_probe lacks a __init
      annotation or the annotation of exynos5440_gpiolib_register is wrong.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Tomasz Figa <t.figa@samsung.com>
      Acked-by: NKukjin Kim <kgene.kim@samsung.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      312b00e5
    • M
      x86, efi: remove attribute check from setup_efi_pci · 73970188
      Maarten Lankhorst 提交于
      It looks like the original commit that copied the rom contents from
      efi always copied the rom, and the fixup in setup_efi_pci from commit
      886d751a ("x86, efi: correct precedence of operators in
      setup_efi_pci") broke that.
      
      This resulted in macbook pro's no longer finding the rom images, and
      thus not being able to use the radeon card any more.
      
      The solution is to just remove the check for now, and always copy the
      rom if available.
      Reported-by: NVitaly Budovski <vbudovski+news@gmail.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Seth Forshee <seth.forshee@canonical.com>
      Acked-by: NMatthew Garrett <mjg59@srcf.ucam.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      73970188
    • T
      ALSA: hda - Fix non-snoop page handling · 9ddf1aeb
      Takashi Iwai 提交于
      For non-snoop mode, we fiddle with the page attributes of CORB/RIRB
      and the position buffer, but also the ring buffers.  The problem is
      that the current code blindly assumes that the buffer is contiguous.
      However, the ring buffers may be SG-buffers, thus a wrong vmapped
      address is passed there, leading to Oops.
      
      This patch fixes the handling for SG-buffers.
      
      Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=800701
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9ddf1aeb
  4. 29 1月, 2013 17 次提交