1. 18 Jan, 2013 4 commits
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.8-rc3-tag' of... · 5c69bed2
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.8-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull Xen fixes from Konrad Rzeszutek Wilk:
       - CVE-2013-0190/XSA-40 (or stack corruption for 32-bit PV kernels)
       - Fix racy vma access spotted by Al Viro
       - Fix mmap batch ioctl potentially resulting in large O(n) page allcations.
       - Fix vcpu online/offline BUG:scheduling while atomic..
       - Fix unbound buffer scanning for more than 32 vCPUs.
       - Fix grant table being incorrectly initialized
       - Fix incorrect check in pciback
       - Allow privcmd in backend domains.
      
      Fix up whitespace conflict due to ugly merge resolution in Xen tree in
      arch/arm/xen/enlighten.c
      
      * tag 'stable/for-linus-3.8-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen: Fix stack corruption in xen_failsafe_callback for 32bit PVOPS guests.
        Revert "xen/smp: Fix CPU online/offline bug triggering a BUG: scheduling while atomic."
        xen/gntdev: remove erronous use of copy_to_user
        xen/gntdev: correctly unmap unlinked maps in mmu notifier
        xen/gntdev: fix unsafe vma access
        xen/privcmd: Fix mmap batch ioctl.
        Xen: properly bound buffer access when parsing cpu/*/availability
        xen/grant-table: correctly initialize grant table version 1
        x86/xen : Fix the wrong check in pciback
        xen/privcmd: Relax access control in privcmd_ioctl_mmap
      5c69bed2
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · b814469a
      Linus Torvalds authored
      Pull m68knommu arch fixes from Greg Ungerer:
       "This contains a couple of fixes, both affecting compilation of non-mmu
        m68k targets."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k: fix conditional use of init_pointer_table
        m68knommu: add KMAP definitions for non-MMU definitions
      b814469a
    • Kirill A. Shutemov's avatar
      asm-generic, mm: pgtable: convert my_zero_pfn() to macros to fix build · 2f91ec8c
      Kirill A. Shutemov authored
      Commit 816422ad ("asm-generic, mm: pgtable: consolidate zero page
      helpers") broke the compile on MIPS if SPARSEMEM is enabled.  We get
      this:
      
        In file included from arch/mips/include/asm/pgtable.h:552,
                         from include/linux/mm.h:44,
                         from arch/mips/kernel/asm-offsets.c:14:
        include/asm-generic/pgtable.h: In function 'my_zero_pfn':
        include/asm-generic/pgtable.h:466: error: implicit declaration of function 'page_to_section'
        In file included from arch/mips/kernel/asm-offsets.c:14:
        include/linux/mm.h: At top level:
        include/linux/mm.h:738: error: conflicting types for 'page_to_section'
        include/asm-generic/pgtable.h:466: note: previous implicit declaration of 'page_to_section' was here
      
      Due header files inter-dependencies, the only way I see to fix it is
      convert my_zero_pfn() for __HAVE_COLOR_ZERO_PAGE to macros.
      Signed-off-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
      Tested-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
      Acked-by: default avatarDavid Daney <david.daney@cavium.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2f91ec8c
    • Linus Torvalds's avatar
      Linux 3.8-rc4 · 7d1f9aef
      Linus Torvalds authored
      7d1f9aef
  2. 17 Jan, 2013 2 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 72ffaa48
      Linus Torvalds authored
      Pull more s390 patches from Martin Schwidefsky:
       "A couple of bug fixes: one of the transparent huge page primitives is
        broken, the sched_clock function overflows after 417 days, the XFS
        module has grown too large for -fpic and the new pci code has broken
        normal channel subsystem notifications."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/chsc: fix SEI usage
        s390/time: fix sched_clock() overflow
        s390: use -fPIC for module compile
        s390/mm: fix pmd_pfn() for thp
      72ffaa48
    • Linus Torvalds's avatar
      Merge tag 'for-linus-v3.8-rc4' of git://oss.sgi.com/xfs/xfs · dfdebc24
      Linus Torvalds authored
      Pull xfs bugfixes from Ben Myers:
      
       - fix(es) for compound buffers
      
       - fix for dquot soft timer asserts due to overflow of d_blk_softlimit
      
       - fix for regression in dir v2 code introduced in commit 20f7e9f3
         ("xfs: factor dir2 block read operations")
      
      * tag 'for-linus-v3.8-rc4' of git://oss.sgi.com/xfs/xfs:
        xfs: recalculate leaf entry pointer after compacting a dir2 block
        xfs: remove int casts from debug dquot soft limit timer asserts
        xfs: fix the multi-segment log buffer format
        xfs: fix segment in xfs_buf_item_format_segment
        xfs: rename bli_format to avoid confusion with bli_formats
        xfs: use b_maps[] for discontiguous buffers
      dfdebc24
  3. 16 Jan, 2013 26 commits
  4. 15 Jan, 2013 8 commits
    • Daniel De Graaf's avatar
      xen/gntdev: remove erronous use of copy_to_user · 1affa98d
      Daniel De Graaf authored
      Since there is now a mapping of granted pages in kernel address space in
      both PV and HVM, use it for UNMAP_NOTIFY_CLEAR_BYTE instead of accessing
      memory via copy_to_user and triggering sleep-in-atomic warnings.
      Signed-off-by: default avatarDaniel De Graaf <dgdegra@tycho.nsa.gov>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      1affa98d
    • Daniel De Graaf's avatar
      xen/gntdev: correctly unmap unlinked maps in mmu notifier · 16a1d022
      Daniel De Graaf authored
      If gntdev_ioctl_unmap_grant_ref is called on a range before unmapping
      it, the entry is removed from priv->maps and the later call to
      mn_invl_range_start won't find it to do the unmapping. Fix this by
      creating another list of freeable maps that the mmu notifier can search
      and use to unmap grants.
      Signed-off-by: default avatarDaniel De Graaf <dgdegra@tycho.nsa.gov>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      16a1d022
    • Daniel De Graaf's avatar
      xen/gntdev: fix unsafe vma access · 2512f298
      Daniel De Graaf authored
      In gntdev_ioctl_get_offset_for_vaddr, we need to hold mmap_sem while
      calling find_vma() to avoid potentially having the result freed out from
      under us.  Similarly, the MMU notifier functions need to synchronize with
      gntdev_vma_close to avoid map->vma being freed during their iteration.
      Signed-off-by: default avatarDaniel De Graaf <dgdegra@tycho.nsa.gov>
      Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      2512f298
    • Andres Lagar-Cavilla's avatar
      xen/privcmd: Fix mmap batch ioctl. · 99beae6c
      Andres Lagar-Cavilla authored
      1. If any individual mapping error happens, the V1 case will mark *all*
      operations as failed. Fixed.
      
      2. The err_array was allocated with kcalloc, resulting in potentially O(n) page
      allocations. Refactor code to not use this array.
      Signed-off-by: default avatarAndres Lagar-Cavilla <andres@lagarcavilla.org>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      99beae6c
    • Konrad Rzeszutek Wilk's avatar
      Merge tag 'v3.7' into stable/for-linus-3.8 · 7bcc1ec0
      Konrad Rzeszutek Wilk authored
      Linux 3.7
      
      * tag 'v3.7': (833 commits)
        Linux 3.7
        Input: matrix-keymap - provide proper module license
        Revert "revert "Revert "mm: remove __GFP_NO_KSWAPD""" and associated damage
        ipv4: ip_check_defrag must not modify skb before unsharing
        Revert "mm: avoid waking kswapd for THP allocations when compaction is deferred or contended"
        inet_diag: validate port comparison byte code to prevent unsafe reads
        inet_diag: avoid unsafe and nonsensical prefix matches in inet_diag_bc_run()
        inet_diag: validate byte code to prevent oops in inet_diag_bc_run()
        inet_diag: fix oops for IPv4 AF_INET6 TCP SYN-RECV state
        mm: vmscan: fix inappropriate zone congestion clearing
        vfs: fix O_DIRECT read past end of block device
        net: gro: fix possible panic in skb_gro_receive()
        tcp: bug fix Fast Open client retransmission
        tmpfs: fix shared mempolicy leak
        mm: vmscan: do not keep kswapd looping forever due to individual uncompactable zones
        mm: compaction: validate pfn range passed to isolate_freepages_block
        mmc: sh-mmcif: avoid oops on spurious interrupts (second try)
        Revert misapplied "mmc: sh-mmcif: avoid oops on spurious interrupts"
        mmc: sdhci-s3c: fix missing clock for gpio card-detect
        lib/Makefile: Fix oid_registry build dependency
        ...
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      
      Conflicts:
      	arch/arm/xen/enlighten.c
      	drivers/xen/Makefile
      
      [We need to have the v3.7 base as the 'for-3.8' was based off v3.7-rc3
      and there are some patches in v3.7-rc6 that we to have in our branch]
      7bcc1ec0
    • Jan Beulich's avatar
      Xen: properly bound buffer access when parsing cpu/*/availability · e5c702d3
      Jan Beulich authored
      At the same time reduce the local buffers to 16 bytes each.
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      e5c702d3
    • Matt Wilson's avatar
      xen/grant-table: correctly initialize grant table version 1 · d0b4d64a
      Matt Wilson authored
      Commit 85ff6acb (xen/granttable: Grant
      tables V2 implementation) changed the GREFS_PER_GRANT_FRAME macro from
      a constant to a conditional expression. The expression depends on
      grant_table_version being appropriately set. Unfortunately, at init
      time grant_table_version will be 0. The GREFS_PER_GRANT_FRAME
      conditional expression checks for "grant_table_version == 1", and
      therefore returns the number of grant references per frame for v2.
      
      This causes gnttab_init() to allocate fewer pages for gnttab_list, as
      a frame can old half the number of v2 entries than v1 entries. After
      gnttab_resume() is called, grant_table_version is appropriately
      set. nr_init_grefs will then be miscalculated and gnttab_free_count
      will hold a value larger than the actual number of free gref entries.
      
      If a guest is heavily utilizing improperly initialized v1 grant
      tables, memory corruption can occur. One common manifestation is
      corruption of the vmalloc list, resulting in a poisoned pointer
      derefrence when accessing /proc/meminfo or /proc/vmallocinfo:
      
      [   40.770064] BUG: unable to handle kernel paging request at 0000200200001407
      [   40.770083] IP: [<ffffffff811a6fb0>] get_vmalloc_info+0x70/0x110
      [   40.770102] PGD 0
      [   40.770107] Oops: 0000 [#1] SMP
      [   40.770114] CPU 10
      
      This patch introduces a static variable, grefs_per_grant_frame, to
      cache the calculated value. gnttab_init() now calls
      gnttab_request_version() early so that grant_table_version and
      grefs_per_grant_frame can be appropriately set. A few BUG_ON()s have
      been added to prevent this type of bug from reoccurring in the future.
      Signed-off-by: default avatarMatt Wilson <msw@amazon.com>
      Reviewed-and-Tested-by: default avatarSteven Noonan <snoonan@amazon.com>
      Acked-by: default avatarIan Campbell <Ian.Campbell@citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Annie Li <annie.li@oracle.com>
      Cc: xen-devel@lists.xen.org
      Cc: linux-kernel@vger.kernel.org
      Cc: stable@vger.kernel.org # v3.3 and newer
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      d0b4d64a
    • Yang Zhang's avatar
      x86/xen : Fix the wrong check in pciback · 6337a239
      Yang Zhang authored
      Fix the wrong check in pciback.
      Signed-off-by: default avatarYang Zhang <yang.z.zhang@Intel.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      6337a239