Skip to content
  1. Feb 13, 2013
    • Mel Gorman's avatar
      x86/mm: Check if PUD is large when validating a kernel address · 0ee364eb
      Mel Gorman authored
      
      
      A user reported the following oops when a backup process reads
      /proc/kcore:
      
       BUG: unable to handle kernel paging request at ffffbb00ff33b000
       IP: [<ffffffff8103157e>] kern_addr_valid+0xbe/0x110
       [...]
      
       Call Trace:
        [<ffffffff811b8aaa>] read_kcore+0x17a/0x370
        [<ffffffff811ad847>] proc_reg_read+0x77/0xc0
        [<ffffffff81151687>] vfs_read+0xc7/0x130
        [<ffffffff811517f3>] sys_read+0x53/0xa0
        [<ffffffff81449692>] system_call_fastpath+0x16/0x1b
      
      Investigation determined that the bug triggered when reading
      system RAM at the 4G mark. On this system, that was the first
      address using 1G pages for the virt->phys direct mapping so the
      PUD is pointing to a physical address, not a PMD page.
      
      The problem is that the page table walker in kern_addr_valid() is
      not checking pud_large() and treats the physical address as if
      it was a PMD.  If it happens to look like pmd_none then it'll
      silently fail, probably returning zeros instead of real data. If
      the data happens to look like a present PMD though, it will be
      walked resulting in the oops above.
      
      This patch adds the necessary pud_large() check.
      
      Unfortunately the problem was not readily reproducible and now
      they are running the backup program without accessing
      /proc/kcore so the patch has not been validated but I think it
      makes sense.
      
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Reviewed-by: default avatarRik van Riel <riel@redhat.coM>
      Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: stable@vger.kernel.org
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20130211145236.GX21389@suse.de
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0ee364eb
  2. Feb 11, 2013
    • Stoney Wang's avatar
      x86/apic: Work around boot failure on HP ProLiant DL980 G7 Server systems · cb214ede
      Stoney Wang authored
      
      
      When a HP ProLiant DL980 G7 Server boots a regular kernel,
      there will be intermittent lost interrupts which could
      result in a hang or (in extreme cases) data loss.
      
      The reason is that this system only supports x2apic physical
      mode, while the kernel boots with a logical-cluster default
      setting.
      
      This bug can be worked around by specifying the "x2apic_phys" or
      "nox2apic" boot option, but we want to handle this system
      without requiring manual workarounds.
      
      The BIOS sets ACPI_FADT_APIC_PHYSICAL in FADT table.
      As all apicids are smaller than 255, BIOS need to pass the
      control to the OS with xapic mode, according to x2apic-spec,
      chapter 2.9.
      
      Current code handle x2apic when BIOS pass with xapic mode
      enabled:
      
      When user specifies x2apic_phys, or FADT indicates PHYSICAL:
      
      1. During madt oem check, apic driver is set with xapic logical
         or xapic phys driver at first.
      
      2. enable_IR_x2apic() will enable x2apic_mode.
      
      3. if user specifies x2apic_phys on the boot line, x2apic_phys_probe()
         will install the correct x2apic phys driver and use x2apic phys mode.
         Otherwise it will skip the driver will let x2apic_cluster_probe to
         take over to install x2apic cluster driver (wrong one) even though FADT
         indicates PHYSICAL, because x2apic_phys_probe does not check
         FADT PHYSICAL.
      
      Add checking x2apic_fadt_phys in x2apic_phys_probe() to fix the
      problem.
      
      Signed-off-by: default avatarStoney Wang <song-bo.wang@hp.com>
      [ updated the changelog and simplified the code ]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Cc: stable@kernel.org
      Link: http://lkml.kernel.org/r/1360263182-16226-1-git-send-email-yinghai@kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      cb214ede
  3. Feb 09, 2013
    • H. Peter Anvin's avatar
      x86, doc: Add a bootloader ID for OVMF · 686966d8
      H. Peter Anvin authored
      
      
      OVMF (an implementation of UEFI based on TianoCore used in virtual
      environments) now has the ability to boot Linux natively; this is used
      for "qemu -kernel" and similar things in a UEFI environment.
      
      Accordingly, assign it a bootloader ID.
      
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      686966d8
  4. Feb 08, 2013
    • Kees Cook's avatar
      x86: Do not leak kernel page mapping locations · e575a86f
      Kees Cook authored
      
      
      Without this patch, it is trivial to determine kernel page
      mappings by examining the error code reported to dmesg[1].
      Instead, declare the entire kernel memory space as a violation
      of a present page.
      
      Additionally, since show_unhandled_signals is enabled by
      default, switch branch hinting to the more realistic
      expectation, and unobfuscate the setting of the PF_PROT bit to
      improve readability.
      
      [1] http://vulnfactory.org/blog/2013/02/06/a-linux-memory-trick/
      
      Reported-by: default avatarDan Rosenberg <dan.j.rosenberg@gmail.com>
      Suggested-by: default avatarBrad Spengler <spender@grsecurity.net>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: stable@vger.kernel.org
      Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20130207174413.GA12485@www.outflux.net
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e575a86f
  5. Feb 07, 2013
  6. Feb 05, 2013
  7. Feb 04, 2013
    • Borislav Petkov's avatar
      x86/intel/cacheinfo: Shut up annoying warning · f76e39c5
      Borislav Petkov authored
      
      
      I've been getting the following warning when doing randbuilds
      since forever. Now it finally pissed me off just the perfect
      amount so that I can fix it.
      
        arch/x86/kernel/cpu/intel_cacheinfo.c:489:27: warning: ‘cache_disable_0’ defined but not used [-Wunused-variable]
        arch/x86/kernel/cpu/intel_cacheinfo.c:491:27: warning: ‘cache_disable_1’ defined but not used [-Wunused-variable] arch/x86/kernel/cpu/intel_cacheinfo.c:524:27: warning: ‘subcaches’ defined but not used [-Wunused-variable]
      
      It happens because in randconfigs where CONFIG_SYSFS is not set,
      the whole sysfs-interface to L3 cache index disabling is
      remaining unused and gcc correctly warns about it. Make it
      optional, depending on CONFIG_SYSFS too, as is the case with
      other sysfs-related machinery in this file.
      
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
      Link: http://lkml.kernel.org/r/1359969195-27362-1-git-send-email-bp@alien8.de
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f76e39c5
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 6edacf05
      Linus Torvalds authored
      Pull powerpc update from Benjamin Herrenschmidt:
       "Just so that you don't get too bored on your Island here's a patch for
        3.8 fixing a nasty bug that affects the new 64T support that was
        merged in 3.7.  Please apply whenever you have a chance (and an
        internet connection!)"
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/mm: Fix hash computation function
      6edacf05
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · f19637e7
      Linus Torvalds authored
      Pull radeon fixes from Dave Airlie:
       "I got these late last week, the main chunks of these fix a rendering
        regression since 3.7, and the settle ones all fix the issue where we
        don't wait long enough for the memory controller to settle after
        turning it off which causes bad memory reads, they all fix real users
        bugs, and most of them are destined for stable.
      
        Can't remember if you had net connection on that island :-)"
      
      I don't know if the "two tin-cans and a string" thing here on "that
      island" can really be considered internet, but I guess I can pull
      things.  Barely.
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/radeon: switch back to the CP ring for VM PT updates
        drm/radeon: prevent crash in the ring space allocation
        drm/radeon: Calling object_unrefer() when creating fb failure
        drm/radeon/r5xx-r7xx: wait for the MC to settle after MC blackout
        drm/radeon/evergreen+: wait for the MC to settle after MC blackout
        drm/radeon: protect against div by 0 in backend setup
        drm/radeon: fix backend map setup on 1 RB sumo boards
        drm/radeon: add quirk for RV100 board
        drm/radeon: add WAIT_UNTIL to the non-VM safe regs list for cayman/TN
        drm/radeon: fix MC blackout on evergreen+
      f19637e7
    • Aneesh Kumar K.V's avatar
      powerpc/mm: Fix hash computation function · eda8eebd
      Aneesh Kumar K.V authored
      
      
      The ASM version of hash computation function was truncating the upper bit.
      Make the ASM version similar to hpt_hash function. Remove masking vsid bits.
      Without this patch, we observed hang during bootup due to not satisfying page
      fault request correctly. The fault handler used wrong hash values to update
      the HPTE. Hence we kept looping with page fault.
      
      hash_page(ea=000001003e260008, access=203, trap=300 ip=3fff91787134 dsisr 42000000
      The computed value of hash 000000000f22f390
      update: avpnv=4003e46054003e00, hash=000000000722f390, f=80000006, psize: 2 ...
      
      BenH: The over-masking has been there for ever but only hurts with the
      new 64T support introduced in 3.7
      
      Reported-by: default avatarMike Qiu <qiudayu@linux.vnet.ibm.com>
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Tested-by: default avatarMike Qiu <qiudayu@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: <stable@vger.kernel.org> [v3.7]
      eda8eebd
  8. Feb 03, 2013
    • Jiri Olsa's avatar
      perf: Fix event group context move · 0231bb53
      Jiri Olsa authored
      
      
      When we have group with mixed events (hw/sw) we want to end up
      with group leader being in hw context. So if group leader is
      initialy sw event, we move all the events under hw context.
      
      The move is done for each event by removing it from its context
      and adding it back into proper one. As a part of the removal the
      event is automatically disabled, which is not what we want at
      this stage of creating groups.
      
      The fix is to initialize event state after removal from sw
      context.
      
      This fix resulted from the following discussion:
      
        http://thread.gmane.org/gmane.linux.kernel.perf.user/1144
      
      Reported-by: default avatarAndreas Hollmann <hollmann@in.tum.de>
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Vince Weaver <vince@deater.net>
      Link: http://lkml.kernel.org/r/1359714225-4231-1-git-send-email-jolsa@redhat.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0231bb53
  9. Feb 02, 2013
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 8b31849a
      Linus Torvalds authored
      Pull scsi target fixes from Nicholas Bellinger:
       "Here's the current set of v3.8-rc fixes in the target-pending.git
        queue.  Apologies in advance for these missing the -rc6 release, and
        having to be destined for -rc7 code.
      
        The majority of these patches are regression bugfixes specific to
        v3.8-rc code changes, namely the zero-length CDB handling breakage
        after the sense_reason_t conversion, and preventing configfs port
        linking for unconfigured devices after the recent struct
        se_subsystem_dev removal.  These is also one (the divide by zero bug
        for unconfigured devices) that is CC'ed to stable."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        target: Fix divide by zero bug in fabric_max_sectors for unconfigured devices
        target: Fix regression allowing unconfigured devices to fabric port link
        tcm_vhost: fix pr_err on early kick
        target: Fix zero-length READ_CAPACITY_16 regression
        target: Fix zero-length MODE_SENSE regression
        target: Fix zero-length INQUIRY additional sense code regression
      8b31849a
  10. Feb 01, 2013