1. 24 1月, 2012 19 次提交
    • L
      Merge branch 'akpm' · 4f57d865
      Linus Torvalds 提交于
      Quoth Andrew:
        "Random fixes.  And a simple new LED driver which I'm trying to sneak
         in while you're not looking."
      
      Sneaking successful.
      
      * akpm:
        score: fix off-by-one index into syscall table
        mm: fix rss count leakage during migration
        SHM_UNLOCK: fix Unevictable pages stranded after swap
        SHM_UNLOCK: fix long unpreemptible section
        kdump: define KEXEC_NOTE_BYTES arch specific for s390x
        mm/hugetlb.c: undo change to page mapcount in fault handler
        mm: memcg: update the correct soft limit tree during migration
        proc: clear_refs: do not clear reserved pages
        drivers/video/backlight/l4f00242t03.c: return proper error in l4f00242t03_probe if regulator_get() fails
        drivers/video/backlight/adp88x0_bl.c: fix bit testing logic
        kprobes: initialize before using a hlist
        ipc/mqueue: simplify reading msgqueue limit
        leds: add led driver for Bachmann's ot200
        mm: __count_immobile_pages(): make sure the node is online
        mm: fix NULL ptr dereference in __count_immobile_pages
        mm: fix warnings regarding enum migrate_mode
      4f57d865
    • L
      Merge branch 'for-linus-3.3' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf · 46c5b83b
      Linus Torvalds 提交于
      * 'for-linus-3.3' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf:
        MAINTAINERS: Add dma-buf sharing framework maintainer
      46c5b83b
    • L
      Merge git://git.samba.org/sfrench/cifs-2.6 · 7908b3ef
      Linus Torvalds 提交于
      * git://git.samba.org/sfrench/cifs-2.6:
        CIFS: Rename *UCS* functions to *UTF16*
        [CIFS] ACL and FSCACHE support no longer EXPERIMENTAL
        [CIFS] Fix build break with multiuser patch when LANMAN disabled
        cifs: warn about impending deprecation of legacy MultiuserMount code
        cifs: fetch credentials out of keyring for non-krb5 auth multiuser mounts
        cifs: sanitize username handling
        keys: add a "logon" key type
        cifs: lower default wsize when unix extensions are not used
        cifs: better instrumentation for coalesce_t2
        cifs: integer overflow in parse_dacl()
        cifs: Fix sparse warning when calling cifs_strtoUCS
        CIFS: Add descriptions to the brlock cache functions
      7908b3ef
    • D
      score: fix off-by-one index into syscall table · c25a785d
      Dan Rosenberg 提交于
      If the provided system call number is equal to __NR_syscalls, the
      current check will pass and a function pointer just after the system
      call table may be called, since sys_call_table is an array with total
      size __NR_syscalls.
      
      Whether or not this is a security bug depends on what the compiler puts
      immediately after the system call table.  It's likely that this won't do
      anything bad because there is an additional NULL check on the syscall
      entry, but if there happens to be a non-NULL value immediately after the
      system call table, this may result in local privilege escalation.
      Signed-off-by: NDan Rosenberg <drosenberg@vsecurity.com>
      Cc: <stable@vger.kernel.org>
      Cc: Chen Liqin <liqin.chen@sunplusct.com>
      Cc: Lennox Wu <lennox.wu@gmail.com>
      Cc: Eugene Teo <eugeneteo@kernel.sg>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c25a785d
    • K
      mm: fix rss count leakage during migration · 9f9f1acd
      Konstantin Khlebnikov 提交于
      Memory migration fills a pte with a migration entry and it doesn't
      update the rss counters.  Then it replaces the migration entry with the
      new page (or the old one if migration failed).  But between these two
      passes this pte can be unmaped, or a task can fork a child and it will
      get a copy of this migration entry.  Nobody accounts for this in the rss
      counters.
      
      This patch properly adjust rss counters for migration entries in
      zap_pte_range() and copy_one_pte().  Thus we avoid extra atomic
      operations on the migration fast-path.
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9f9f1acd
    • H
      SHM_UNLOCK: fix Unevictable pages stranded after swap · 24513264
      Hugh Dickins 提交于
      Commit cc39c6a9 ("mm: account skipped entries to avoid looping in
      find_get_pages") correctly fixed an infinite loop; but left a problem
      that find_get_pages() on shmem would return 0 (appearing to callers to
      mean end of tree) when it meets a run of nr_pages swap entries.
      
      The only uses of find_get_pages() on shmem are via pagevec_lookup(),
      called from invalidate_mapping_pages(), and from shmctl SHM_UNLOCK's
      scan_mapping_unevictable_pages().  The first is already commented, and
      not worth worrying about; but the second can leave pages on the
      Unevictable list after an unusual sequence of swapping and locking.
      
      Fix that by using shmem_find_get_pages_and_swap() (then ignoring the
      swap) instead of pagevec_lookup().
      
      But I don't want to contaminate vmscan.c with shmem internals, nor
      shmem.c with LRU locking.  So move scan_mapping_unevictable_pages() into
      shmem.c, renaming it shmem_unlock_mapping(); and rename
      check_move_unevictable_page() to check_move_unevictable_pages(), looping
      down an array of pages, oftentimes under the same lock.
      
      Leave out the "rotate unevictable list" block: that's a leftover from
      when this was used for /proc/sys/vm/scan_unevictable_pages, whose flawed
      handling involved looking at pages at tail of LRU.
      
      Was there significance to the sequence first ClearPageUnevictable, then
      test page_evictable, then SetPageUnevictable here? I think not, we're
      under LRU lock, and have no barriers between those.
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Shaohua Li <shaohua.li@intel.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: <stable@vger.kernel.org> [back to 3.1 but will need respins]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      24513264
    • H
      SHM_UNLOCK: fix long unpreemptible section · 85046579
      Hugh Dickins 提交于
      scan_mapping_unevictable_pages() is used to make SysV SHM_LOCKed pages
      evictable again once the shared memory is unlocked.  It does this with
      pagevec_lookup()s across the whole object (which might occupy most of
      memory), and takes 300ms to unlock 7GB here.  A cond_resched() every
      PAGEVEC_SIZE pages would be good.
      
      However, KOSAKI-san points out that this is called under shmem.c's
      info->lock, and it's also under shm.c's shm_lock(), both spinlocks.
      There is no strong reason for that: we need to take these pages off the
      unevictable list soonish, but those locks are not required for it.
      
      So move the call to scan_mapping_unevictable_pages() from shmem.c's
      unlock handling up to shm.c's unlock handling.  Remove the recently
      added barrier, not needed now we have spin_unlock() before the scan.
      
      Use get_file(), with subsequent fput(), to make sure we have a reference
      to mapping throughout scan_mapping_unevictable_pages(): that's something
      that was previously guaranteed by the shm_lock().
      
      Remove shmctl's lru_add_drain_all(): we don't fault in pages at SHM_LOCK
      time, and we lazily discover them to be Unevictable later, so it serves
      no purpose for SHM_LOCK; and serves no purpose for SHM_UNLOCK, since
      pages still on pagevec are not marked Unevictable.
      
      The original code avoided redundant rescans by checking VM_LOCKED flag
      at its level: now avoid them by checking shp's SHM_LOCKED.
      
      The original code called scan_mapping_unevictable_pages() on a locked
      area at shm_destroy() time: perhaps we once had accounting cross-checks
      which required that, but not now, so skip the overhead and just let
      inode eviction deal with them.
      
      Put check_move_unevictable_page() and scan_mapping_unevictable_pages()
      under CONFIG_SHMEM (with stub for the TINY case when ramfs is used),
      more as comment than to save space; comment them used for SHM_UNLOCK.
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Shaohua Li <shaohua.li@intel.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michel Lespinasse <walken@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      85046579
    • M
      kdump: define KEXEC_NOTE_BYTES arch specific for s390x · cb78edfd
      Michael Holzheu 提交于
      kdump only allocates memory for the prstatus ELF note.  For s390x,
      besides of prstatus multiple ELF notes for various different register
      types are stored.  Therefore the currently allocated memory is not
      sufficient.  With this patch the KEXEC_NOTE_BYTES macro can be defined
      by architecture code and for s390x it is set to the correct size now.
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Reviewed-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cb78edfd
    • H
      mm/hugetlb.c: undo change to page mapcount in fault handler · 409eb8c2
      Hillf Danton 提交于
      Page mapcount should be updated only if we are sure that the page ends
      up in the page table otherwise we would leak if we couldn't COW due to
      reservations or if idx is out of bounds.
      Signed-off-by: NHillf Danton <dhillf@gmail.com>
      Reviewed-by: NMichal Hocko <mhocko@suse.cz>
      Acked-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      409eb8c2
    • J
      mm: memcg: update the correct soft limit tree during migration · 6568d4a9
      Johannes Weiner 提交于
      end_migration() passes the old page instead of the new page to commit
      the charge.  This page descriptor is not used for committing itself,
      though, since we also pass the (correct) page_cgroup descriptor.  But
      it's used to find the soft limit tree through the page's zone, so the
      soft limit tree of the old page's zone is updated instead of that of the
      new page's, which might get slightly out of date until the next charge
      reaches the ratelimit point.
      
      This glitch has been present since 5564e88b ("memcg: condense
      page_cgroup-to-page lookup points").
      
      This fixes a bug that I introduced in 2.6.38.  It's benign enough (to my
      knowledge) that we probably don't want this for stable.
      Reported-by: NHugh Dickins <hughd@google.com>
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Acked-by: NMichal Hocko <mhocko@suse.cz>
      Acked-by: NKirill A. Shutemov <kirill@shutemov.name>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6568d4a9
    • W
      proc: clear_refs: do not clear reserved pages · 85e72aa5
      Will Deacon 提交于
      /proc/pid/clear_refs is used to clear the Referenced and YOUNG bits for
      pages and corresponding page table entries of the task with PID pid, which
      includes any special mappings inserted into the page tables in order to
      provide things like vDSOs and user helper functions.
      
      On ARM this causes a problem because the vectors page is mapped as a
      global mapping and since ec706dab ("ARM: add a vma entry for the user
      accessible vector page"), a VMA is also inserted into each task for this
      page to aid unwinding through signals and syscall restarts.  Since the
      vectors page is required for handling faults, clearing the YOUNG bit (and
      subsequently writing a faulting pte) means that we lose the vectors page
      *globally* and cannot fault it back in.  This results in a system deadlock
      on the next exception.
      
      To see this problem in action, just run:
      
      	$ echo 1 > /proc/self/clear_refs
      
      on an ARM platform (as any user) and watch your system hang.  I think this
      has been the case since 2.6.37
      
      This patch avoids clearing the aforementioned bits for reserved pages,
      therefore leaving the vectors page intact on ARM.  Since reserved pages
      are not candidates for swap, this change should not have any impact on the
      usefulness of clear_refs.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Reported-by: NMoussa Ba <moussaba@micron.com>
      Acked-by: NHugh Dickins <hughd@google.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: <stable@vger.kernel.org>		[2.6.37+]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      85e72aa5
    • A
      drivers/video/backlight/l4f00242t03.c: return proper error in... · d59d9eba
      Axel Lin 提交于
      drivers/video/backlight/l4f00242t03.c: return proper error in l4f00242t03_probe if regulator_get() fails
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Acked-by: NAlberto Panizzo <alberto@amarulasolutions.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d59d9eba
    • A
      drivers/video/backlight/adp88x0_bl.c: fix bit testing logic · 36c3e759
      Axel Lin 提交于
      We need to write new value if the bit mask fields of new value is not
      equal to old value.  It does not make sense to write new value only when
      all the bit_mask bits are zero.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Cc: Michael Hennerich <michael.hennerich@analog.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      36c3e759
    • A
      kprobes: initialize before using a hlist · d496aab5
      Ananth N Mavinakayanahalli 提交于
      Commit ef53d9c5 ("kprobes: improve kretprobe scalability with hashed
      locking") introduced a bug where we can potentially leak
      kretprobe_instances since we initialize a hlist head after having used
      it.
      
      Initialize the hlist head before using it.
      
      Reported by: Jim Keniston <jkenisto@us.ibm.com>
      Acked-by: NJim Keniston <jkenisto@us.ibm.com>
      Signed-off-by: NAnanth N Mavinakayanahalli <ananth@in.ibm.com>
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Srinivasa D S <srinivasa@in.ibm.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d496aab5
    • D
      ipc/mqueue: simplify reading msgqueue limit · 2a4e64b8
      Davidlohr Bueso 提交于
      Because the current task is being used to get the limit, we can simply
      use rlimit() instead of task_rlimit().
      Signed-off-by: NDavidlohr Bueso <dave@gnu.org>
      Acked-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2a4e64b8
    • S
      leds: add led driver for Bachmann's ot200 · e9a4593c
      Sebastian Andrzej Siewior 提交于
      Add support for leds on Bachmann's ot200 visualisation device.  The
      device has three leds on the back panel (led_err, led_init and led_run)
      and can handle up to seven leds on the front panel.
      
      The driver was written by Linutronix on behalf of Bachmann electronic
      GmbH.  It incorporates feedback from Lars-Peter Clausen
      
      [akpm@linux-foundation.org: add dependency on HAS_IOMEM]
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NChristian Gmeiner <christian.gmeiner@gmail.com>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e9a4593c
    • M
      mm: __count_immobile_pages(): make sure the node is online · 656a0706
      Michal Hocko 提交于
      page_zone() requires an online node otherwise we are accessing NULL
      NODE_DATA.  This is not an issue at the moment because node_zones are
      located at the structure beginning but this might change in the future
      so better be careful about that.
      Signed-off-by: NMichal Hocko <mhocko@suse.cz>
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      656a0706
    • M
      mm: fix NULL ptr dereference in __count_immobile_pages · 687875fb
      Michal Hocko 提交于
      Fix the following NULL ptr dereference caused by
      
        cat /sys/devices/system/memory/memory0/removable
      
      Pid: 13979, comm: sed Not tainted 3.0.13-0.5-default #1 IBM BladeCenter LS21 -[7971PAM]-/Server Blade
      RIP: __count_immobile_pages+0x4/0x100
      Process sed (pid: 13979, threadinfo ffff880221c36000, task ffff88022e788480)
      Call Trace:
        is_pageblock_removable_nolock+0x34/0x40
        is_mem_section_removable+0x74/0xf0
        show_mem_removable+0x41/0x70
        sysfs_read_file+0xfe/0x1c0
        vfs_read+0xc7/0x130
        sys_read+0x53/0xa0
        system_call_fastpath+0x16/0x1b
      
      We are crashing because we are trying to dereference NULL zone which
      came from pfn=0 (struct page ffffea0000000000). According to the boot
      log this page is marked reserved:
      e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
      
      and early_node_map confirms that:
      early_node_map[3] active PFN ranges
          1: 0x00000010 -> 0x0000009c
          1: 0x00000100 -> 0x000bffa3
          1: 0x00100000 -> 0x00240000
      
      The problem is that memory_present works in PAGE_SECTION_MASK aligned
      blocks so the reserved range sneaks into the the section as well.  This
      also means that free_area_init_node will not take care of those reserved
      pages and they stay uninitialized.
      
      When we try to read the removable status we walk through all available
      sections and hope that the zone is valid for all pages in the section.
      But this is not true in this case as the zone and nid are not initialized.
      
      We have only one node in this particular case and it is marked as node=1
      (rather than 0) and that made the problem visible because page_to_nid will
      return 0 and there are no zones on the node.
      
      Let's check that the zone is valid and that the given pfn falls into its
      boundaries and mark the section not removable.  This might cause some
      false positives, probably, but we do not have any sane way to find out
      whether the page is reserved by the platform or it is just not used for
      whatever other reasons.
      Signed-off-by: NMichal Hocko <mhocko@suse.cz>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      687875fb
    • A
      mm: fix warnings regarding enum migrate_mode · 6536e312
      Andrew Morton 提交于
      sparc64 allmodconfig:
      
      In file included from include/linux/compat.h:15,
                       from /usr/src/25/arch/sparc/include/asm/siginfo.h:19,
                       from include/linux/signal.h:5,
                       from include/linux/sched.h:73,
                       from arch/sparc/kernel/asm-offsets.c:13:
      include/linux/fs.h:618: warning: parameter has incomplete type
      
      It seems that my sparc64 compiler (gcc-3.4.5) doesn't like the forward
      declaration of enums.
      
      Fix this by moving the "enum migrate_mode" definition into its own header
      file.
      Acked-by: NMel Gorman <mgorman@suse.de>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Andy Isaacson <adi@hexapodia.org>
      Cc: Nai Xia <nai.xia@gmail.com>
      Cc: Johannes Weiner <jweiner@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6536e312
  2. 21 1月, 2012 1 次提交
  3. 20 1月, 2012 10 次提交
  4. 19 1月, 2012 10 次提交