13 Apr, 2010

2 commits

  • When we move the boundaries between two vma's due to things like
    mprotect, we need to make sure that the anon_vma of the pages that got
    moved from one vma to another gets properly copied around. And that was
    not always the case, in this rather hard-to-follow code sequence.

    Clarify the code, and fix it so that it copies the anon_vma from the
    right source.

    Reviewed-by: Rik van Riel
    Acked-by: Johannes Weiner
    Tested-by: Borislav Petkov [ "Yeah, not so much this one either" ]
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • This changes the anon_vma reuse case to require that we only reuse
    simple anon_vma's - ie the case when the vma only has a single anon_vma
    associated with it.

    This means that a reuse of an anon_vma from an adjacent vma will always
    guarantee that both vma's are associated not only with the same
    anon_vma, they will also have the same anon_vma chain (of just a single
    entry in this case).

    And since anon_vma re-use was the only case where the same anon_vma
    might be associated with different chains of anon_vma's, we now have the
    case that every vma that shares the same anon_vma will always also have
    the same chain. That makes it much easier to think about merging vma's
    that share the same anon_vma's: you can always just drop the other
    anon_vma chain in anon_vma_merge() since you know that they are always
    identical.

    This also splits up the function to validate the anon_vma re-use, and
    adds a lot of commentary about the possible races.

    Reviewed-by: Rik van Riel
    Acked-by: Johannes Weiner
    Tested-by: Borislav Petkov [ "That didn't fix it" ]
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

10 Apr, 2010

9 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    IB/mlx4: Check correct variable for allocation failure
    RDMA/nes: Correct cap.max_inline_data assignment in nes_query_qp()
    RDMA/cm: Set num_paths when manually assigning path records
    IB/cm: Fix device_create() return value check

    Linus Torvalds
     
  • * 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
    [S390] Update default configuration.
    [S390] nss: add missing .previous statement to asm function
    [S390] increase default size of vmalloc area
    [S390] s390: disable change bit override
    [S390] fix io_return critical section cleanup
    [S390] sclp_async: potential buffer overflow
    [S390] arch/s390/kernel: Add missing unlock

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block: (34 commits)
    cfq-iosched: Fix the incorrect timeslice accounting with forced_dispatch
    loop: Update mtime when writing using aops
    block: expose the statistics in blkio.time and blkio.sectors for the root cgroup
    backing-dev: Handle class_create() failure
    Block: Fix block/elevator.c elevator_get() off-by-one error
    drbd: lc_element_by_index() never returns NULL
    cciss: unlock on error path
    cfq-iosched: Do not merge queues of BE and IDLE classes
    cfq-iosched: Add additional blktrace log messages in CFQ for easier debugging
    i2o: Remove the dangerous kobj_to_i2o_device macro
    block: remove 16 bytes of padding from struct request on 64bits
    cfq-iosched: fix a kbuild regression
    block: make CONFIG_BLK_CGROUP visible
    Remove GENHD_FL_DRIVERFS
    block: Export max number of segments and max segment size in sysfs
    block: Finalize conversion of block limits functions
    block: Fix overrun in lcm() and move it to lib
    vfs: improve writeback_inodes_wb()
    paride: fix off-by-one test
    drbd: fix al-to-on-disk-bitmap for 4k logical_block_size
    ...

    Linus Torvalds
     
  • * 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (29 commits)
    drm/nouveau: bail out of auxch transaction if we repeatedly recieve defers
    drm/nv50: implement gpio set/get routines
    drm/nv50: parse/use some more de-magiced parts of gpio table entries
    drm/nouveau: store raw gpio table entry in bios gpio structs
    drm/nv40: Init some tiling-related PGRAPH state.
    drm/nv50: Add NVA3 support in ctxprog/ctxvals generator.
    drm/nv50: another dodgy DP hack
    drm/nv50: punt hotplug irq handling out to workqueue
    drm/nv50: preserve an unknown SOR_MODECTRL value for DP encoders
    drm/nv50: Allow using the NVA3 new compute class.
    drm/nv50: cleanup properly if PDISPLAY init fails
    drm/nouveau: fixup the init failure paths some more
    drm/nv50: fix instmem init on IGPs if stolen mem crosses 4GiB mark
    drm/nv40: add LVDS table quirk for Dell Latitude D620
    drm/nv40: rework lvds table parsing
    drm/nouveau: detect vram amount once, and save the value
    drm/nouveau: remove some unused members from drm_nouveau_private
    drm/nouveau: Make use of TTM busy_placements.
    drm/nv50: add more 0x100c80 flushy magic
    drm/nv50: fix fbcon when framebuffer above 4GiB mark
    ...

    Linus Torvalds
     
  • radix_tree_tag_get() is not safe to use concurrently with radix_tree_tag_set()
    or radix_tree_tag_clear(). The problem is that the double tag_get() in
    radix_tree_tag_get():

    if (!tag_get(node, tag, offset))
    saw_unset_tag = 1;
    if (height == 1) {
    int ret = tag_get(node, tag, offset);

    may see the value change due to the action of set/clear. RCU is no protection
    against this as no pointers are being changed, no nodes are being replaced
    according to a COW protocol - set/clear alter the node directly.

    The documentation in linux/radix-tree.h, however, says that
    radix_tree_tag_get() is an exception to the rule that "any function modifying
    the tree or tags (...) must exclude other modifications, and exclude any
    functions reading the tree".

    The problem is that the next statement in radix_tree_tag_get() checks that the
    tag doesn't vary over time:

    BUG_ON(ret && saw_unset_tag);

    This has been seen happening in FS-Cache:

    https://www.redhat.com/archives/linux-cachefs/2010-April/msg00013.html

    To this end, remove the BUG_ON() from radix_tree_tag_get() and note in various
    comments that the value of the tag may change whilst the RCU read lock is held,
    and thus that the return value of radix_tree_tag_get() may not be relied upon
    unless radix_tree_tag_set/clear() and radix_tree_delete() are excluded from
    running concurrently with it.

    Reported-by: Romain DEGEZ
    Signed-off-by: David Howells
    Acked-by: Nick Piggin
    Signed-off-by: Linus Torvalds

    David Howells
     
  • As suggested by Linus, fix up kmem_ptr_validate() to handle non-kernel pointers
    more graciously. The patch changes kmem_ptr_validate() to use the newly
    introduced kern_ptr_validate() helper to check that a pointer is a valid kernel
    pointer before we attempt to convert it into a 'struct page'.

    Cc: Andrew Morton
    Cc: Ingo Molnar
    Cc: Matt Mackall
    Cc: Nick Piggin
    Signed-off-by: Pekka Enberg
    Acked-by: Christoph Lameter
    Acked-by: David Rientjes
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • As suggested by Linus, introduce a kern_ptr_validate() helper that does some
    sanity checks to make sure a pointer is a valid kernel pointer. This is a
    preparational step for fixing SLUB kmem_ptr_validate().

    Cc: Andrew Morton
    Cc: Christoph Lameter
    Cc: David Rientjes
    Cc: Ingo Molnar
    Cc: Matt Mackall
    Cc: Nick Piggin
    Signed-off-by: Pekka Enberg
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • This reverts commit ba168fc37dea145deeb8fa9e7e71c748d2e00d74.

    It changes user-visible sysfs interfaces, and breaks some existing user
    space applications which apparently rely on the fact that the output
    does not contain the "0x" prefix.

    Requested-by: Heiko Carstens
    Acked-by: KOSAKI Motohiro
    Acked-by: Wu Fengguang
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Roland Dreier
     

09 Apr, 2010

29 commits