Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Feb 26, 2008
  1. @gregkh


    gregkh committed
  2. @gregkh

    x86_64: CPA, fix cache attribute inconsistency bug

    Ingo Molnar committed with gregkh
    no upstream git id as the code has been rewritten.
    fix CPA cache attribute bug in v2.6.23. When phys_base is nonzero
    (when CONFIG_RELOCATABLE=y) then change_page_attr_addr() miscalculates
    the secondary alias address by -14 MB (depending on the configured
    The default 64-bit kernels of Fedora and Ubuntu are affected:
       $ grep RELOCA /boot/config-
       $ grep RELOC /boot/config-2.6.22-14-generic
    and probably on many other distros as well.
    the bug affects all pages in the first 40 MB of physical RAM that
    are allocated by some subsystem that does ioremap_nocache() on them:
           if (__pa(address) < KERNEL_TEXT_SIZE) {
    Hence we might leave page table entries with inconsistent cache
    attributes around (pages mapped at both UnCacheable and Write-Back),
    and we can also set the wrong kernel text pages to UnCacheable.
    the effects of this bug can be random slowdowns and other misbehavior.
    If for example AGP allocates its aperture pages into the first 40 MB
    of physical RAM, then the -14 MB bug might mark random kernel texto
    pages as uncacheable, slowing down a random portion of the 64-bit
    kernel until the AGP driver is unloaded.
    Signed-off-by: Ingo Molnar <>
    Acked-by: Thomas Gleixner <>
    Signed-off-by: Greg Kroah-Hartman <>
  3. @gregkh

    Be more robust about bad arguments in get_user_pages()

    Jonathan Corbet committed with gregkh
    patch 900cf08 in mainline.
    So I spent a while pounding my head against my monitor trying to figure
    out the vmsplice() vulnerability - how could a failure to check for
    *read* access turn into a root exploit? It turns out that it's a buffer
    overflow problem which is made easy by the way get_user_pages() is
    In particular, "len" is a signed int, and it is only checked at the
    *end* of a do {} while() loop.  So, if it is passed in as zero, the loop
    will execute once and decrement len to -1.  At that point, the loop will
    proceed until the next invalid address is found; in the process, it will
    likely overflow the pages array passed in to get_user_pages().
    I think that, if get_user_pages() has been asked to grab zero pages,
    that's what it should do.  Thus this patch; it is, among other things,
    enough to block the (already fixed) root exploit and any others which
    might be lurking in similar code.  I also think that the number of pages
    should be unsigned, but changing the prototype of this function probably
    requires some more careful review.
    Signed-off-by: Jonathan Corbet <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  4. @ozbenh @gregkh

    Disable G5 NAP mode during SMU commands on U3

    ozbenh committed with gregkh
    patch 592a607 in mainline.
    It appears that with the U3 northbridge, if the processor is in NAP
    mode the whole time while waiting for an SMU command to complete,
    then the SMU will fail.  It could be related to the weird backward
    mechanism the SMU uses to get to system memory via i2c to the
    northbridge that doesn't operate properly when the said bridge is
    in napping along with the CPU.  That is on U3 at least, U4 doesn't
    seem to be affected.
    This didn't show before NO_HZ as the timer wakeup was enough to make
    it work it seems, but that is no longer the case.
    This fixes it by disabling NAP mode on those machines while
    an SMU command is in flight.
    Signed-off-by: Benjamin Herrenschmidt <>
    Signed-off-by: Paul Mackerras <>
    Signed-off-by: Greg Kroah-Hartman <>
  5. @gregkh

    genirq: do not leave interupts enabled on free_irq

    Thomas Gleixner committed with gregkh
    commit 89d694b
    The default_disable() function was changed in commit:
     genirq: do not mask interrupts by default
    It removed the mask function in favour of the default delayed
    interrupt disabling. Unfortunately this also broke the shutdown in
    free_irq() when the last handler is removed from the interrupt for
    those architectures which rely on the default implementations. Now we
    can end up with a enabled interrupt line after the last handler was
    removed, which can result in spurious interrupts.
    Fix this by adding a default_shutdown function, which is only
    installed, when the irqchip implementation does provide neither a
    shutdown nor a disable function.
    Pointed-out-by: Michael Hennerich <>
    Signed-off-by: Thomas Gleixner <>
    Acked-by: Ingo Molnar <>
    Tested-by: Michael Hennerich <>
    Signed-off-by: Greg Kroah-Hartman <>
  6. @gregkh

    hrtimer: check relative timeouts for overflow

    Thomas Gleixner committed with gregkh
    commit: 5a7780e
    Various user space callers ask for relative timeouts. While we fixed
    that overflow issue in hrtimer_start(), the sites which convert
    relative user space values to absolute timeouts themself were uncovered.
    Instead of putting overflow checks into each place add a function
    which does the sanity checking and convert all affected callers to use
    Thanks to Frans Pop, who reported the problem and tested the fixes.
    Signed-off-by: Thomas Gleixner <>
    Acked-by: Ingo Molnar <>
    Tested-by: Frans Pop <>
    Signed-off-by: Greg Kroah-Hartman <>
  7. @gregkh

    NETFILTER: nf_conntrack_tcp: conntrack reopening fix

    Jozsef Kadlecsik committed with gregkh
    [NETFILTER]: nf_conntrack_tcp: conntrack reopening fix
    [Upstream commits b2155e7 + d0c1fd7]
    TCP connection tracking in netfilter did not handle TCP reopening
    properly: active close was taken into account for one side only and
    not for any side, which is fixed now. The patch includes more comments
    to explain the logic how the different cases are handled.
    The bug was discovered by Jeff Chua.
    Signed-off-by: Jozsef Kadlecsik <>
    Signed-off-by: Patrick McHardy <>
    Signed-off-by: Greg Kroah-Hartman <>
  8. @gregkh

    NFS: Fix a potential file corruption issue when writing

    Trond Myklebust committed with gregkh
    patch 5d47a35 in mainline.
    If the inode is flagged as having an invalid mapping, then we can't rely on
    the PageUptodate() flag. Ensure that we don't use the "anti-fragmentation"
    write optimisation in nfs_updatepage(), since that will cause NFS to write
    out areas of the page that are no longer guaranteed to be up to date.
    A potential corruption could occur in the following scenario:
    client 1			client 2
    ===============			===============
    				write(fd,"fubar\n",6);	// cache last page
    The bug may lead to the file "f" reading 'fubar\n\0\0\0\nbar\n' because
    client 2 does not update the cached page after re-opening the file for
    write. Instead it keeps it marked as PageUptodate() until someone calls
    invaldate_inode_pages2() (typically by calling read()).
    Signed-off-by: Trond Myklebust <>
    Signed-off-by: Greg Kroah-Hartman <>
  9. @gregkh

    SCSI: sd: handle bad lba in sense information

    James Bottomley committed with gregkh
    patch 366c246 in mainline.
    Some devices report medium error locations incorrectly.  Add guards to
    make sure the reported bad lba is actually in the request that caused
    it.  Additionally remove the large case statment for sector sizes and
    replace it with the proper u64 divisions.
    Tested-by: Mike Snitzer <>
    Cc: Stable Tree <>
    Cc: Tony Battersby <>
    Signed-off-by: James Bottomley <>
    Signed-off-by: Greg Kroah-Hartman <>
Commits on Feb 11, 2008
  1. @gregkh


    gregkh committed
  2. @gregkh

    splice: fix user pointer access in get_iovec_page_array()

    Bastian Blank committed with gregkh
    patch 712a30e in mainline.
    Commit 8811930 ("splice: missing user
    pointer access verification") added the proper access_ok() calls to
    copy_from_user_mmap_sem() which ensures we can copy the struct iovecs
    from userspace to the kernel.
    But we also must check whether we can access the actual memory region
    pointed to by the struct iovec to fix the access checks properly.
    Signed-off-by: Bastian Blank <>
    Acked-by: Oliver Pinter <>
    Cc: Jens Axboe <>
    Cc: Andrew Morton <>
    Signed-off-by: Pekka Enberg <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
Commits on Feb 8, 2008
  1. @gregkh


    gregkh committed
  2. @gregkh

    splice: missing user pointer access verification (CVE-2008-0009/10)

    Jens Axboe committed with gregkh
    patch 8811930 in mainline.
    vmsplice_to_user() must always check the user pointer and length
    with access_ok() before copying. Likewise, for the slow path of
    copy_from_user_mmap_sem() we need to check that we may read from
    the user region.
    Signed-off-by: Jens Axboe <>
    Cc: Wojciech Purczynski <>
    Signed-off-by: Greg Kroah-Hartman <>
    Signed-off-by: Linus Torvalds <>
  3. @ian-abbott @gregkh

    PCI: Fix fakephp deadlock

    ian-abbott committed with gregkh
    This patch works around a problem in the fakephp driver when a process
    writing "0" to a "power" sysfs file to fake removal of a PCI device ends
    up deadlocking itself in the sysfs code.
    The patch is functionally identical to the one in Linus' tree post 2.6.24:;a=commitdiff;h=5c796ae7a7ebe56967ed9b9963d7c16d733635ff
    I have tested it on a 2.6.23 kernel.
    Signed-off-by: Ian Abbott <>
    Signed-off-by: Greg Kroah-Hartman <>
  4. @lenb @gregkh

    ACPI: sync blacklist w/ latest

    lenb committed with gregkh
    This patch is appropriate for supporting a 2.6.23-based products.
    Signed-off-by: Len Brown <>
    Signed-off-by: Greg Kroah-Hartman <>
  5. @gregkh

    atl1: fix frame length bug

    Jay Cliburn committed with gregkh
    Upstream commit: 2a49128
    The driver sets up the hardware to accept a frame with max length
    equal to MTU + Ethernet header + FCS + VLAN tag, but we neglect to
    add the VLAN tag size to the ingress buffer.  When a VLAN-tagged
    frame arrives, the hardware passes it, but bad things happen
    because the buffer is too small.  This patch fixes that.
    Thanks to David Harris for reporting the bug and testing the fix.
    Signed-off-by: Jay Cliburn <>
    Tested-by: David Harris <>
    Signed-off-by: Jeff Garzik <>
    Signed-off-by: Greg Kroah-Hartman <>
  6. @gregkh

    forcedeth: mac address mcp77/79

    Ayaz Abdulla committed with gregkh
    patch 2b91213 in mainline.
    This patch is a critical fix for MCP77 and MCP79 devices. The feature
    flags were missing the define for correct mac address
    Signed-off-by: Ayaz Abdulla <>
    Signed-off-by: Jeff Garzik <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Greg Kroah-Hartman <>
  7. @dotdash @gregkh

    Fix dirty page accounting leak with ext3 data=journal

    dotdash committed with gregkh
    patch a2b3456 in mainline.
    In 46d2277, try_to_free_buffers was
    changed to bail out if the page was dirty. That caused
    truncate_complete_page to leak massive amounts of memory, because the
    dirty bit was only cleared after the call to try_to_free_buffers. So the
    call to cancel_dirty_page was moved up to have the dirty bit cleared
    early in 3e67c09.
    The problem with that fix is, that the page can be redirtied after
    cancel_dirty_page was called, eg. like this:
      cancel_dirty_page() // PG_dirty cleared, decr. dirty pages
                    mark_buffer_dirty(); // PG_dirty set, incr. dirty pages
    And then we end up with dirty pages being wrongly accounted.
    In ecdfc97 the changes to
    try_to_free_buffers were reverted, so the original reason for the
    massive memory leak is gone, so we can also revert the move of
    the call to cancel_dirty_page from truncate_complete_page and get the
    accounting right again.
    Signed-off-by: Björn Steinbrink <>
    Tested-by: Krzysztof Piotr Oledzki <>
    Tested-by: Zaid D. <>
    Cc: Jan Kara <>
    Cc: Nick Piggin <>
    Cc: Peter Zijlstra <>
    Cc: Thomas Osterried <>
    Cc: Kerin Millar <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  8. @kaber @gregkh

    Netfilter: bridge-netfilter: fix net_device refcnt leaks

    kaber committed with gregkh
    [NETFILTER]: bridge-netfilter: fix net_device refcnt leaks
    Upstream commit 2dc2f20
    When packets are flood-forwarded to multiple output devices, the
    bridge-netfilter code reuses skb->nf_bridge for each clone to store
    the bridge port. When queueing packets using NFQUEUE netfilter takes
    a reference to skb->nf_bridge->physoutdev, which is overwritten
    when the packet is forwarded to the second port. This causes
    refcount unterflows for the first device and refcount leaks for all
    others. Additionally this provides incorrect data to the iptables
    physdev match.
    Unshare skb->nf_bridge by copying it if it is shared before assigning
    the physoutdev device.
    Reported, tested and based on initial patch by
    Jan Christoph Nordholz <>.
    Signed-off-by: Patrick McHardy <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Greg Kroah-Hartman <>
  9. @kaber @gregkh

    Netfilter: bridge: fix double POST_ROUTING invocation

    kaber committed with gregkh
    [NETFILTER]: bridge: fix double POST_ROUTING invocation
    Upstream commit 2948d2e
    The bridge code incorrectly causes two POST_ROUTING hook invocations
    for DNATed packets that end up on the same bridge device. This
    happens because packets with a changed destination address are passed
    to dst_output() to make them go through the neighbour output function
    again to build a new destination MAC address, before they will continue
    through the IP hooks simulated by bridge netfilter.
    The resulting hook order is:
     PREROUTING (bridge netfilter)
     POSTROUTING        (dst_output -> ip_output)
     FORWARD    (bridge netfilter)
     POSTROUTING        (bridge netfilter)
    The deferred hooks used to abort the first POST_ROUTING invocation,
    but since the only thing bridge netfilter actually really wants is
    a new MAC address, we can avoid going through the IP stack completely
    by simply calling the neighbour output function directly.
    Tested, reported and lots of data provided by: Damien Thebault <>
    Signed-off-by: Patrick McHardy <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Greg Kroah-Hartman <>
  10. @gregkh

    fix oops on rmmod capidrv

    Karsten Keil committed with gregkh
    patch eb36f4f in mainline.
    Fix overwriting the stack with the version string
    (it is currently 10 bytes + zero) when unloading the
    capidrv module. Safeguard against overwriting it
    should the version string grow in the future.
    Should fix Kernel Bug Tracker Bug 9696.
    Signed-off-by: Gerd v. Egidy <>
    Acked-by: Karsten Keil <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  11. @htejun @gregkh

    libata: port and host should be stopped before hardware resources are…

    htejun committed with gregkh
    … released
    This is backport of 32ebbc0 and fixes
    oops on driver module unload.
    Port / host stop calls used to be made from ata_host_release() which
    is called after all hardware resources acquired after host allocation
    are released.  This is wrong as port and host stop routines often
    access the hardware.
    Add separate devres for port / host stop which is invoked right after
    IRQ is released but with all other hardware resources intact.  The
    devres is added iff ->host_stop and/or ->port_stop exist.
    This problem has been spotted by Mark Lord.
    Signed-off-by: Tejun Heo <>
    Cc: Mark Lord <>
    Signed-off-by: Jeff Garzik <>
    Signed-off-by: Greg Kroah-Hartman <>
  12. @gregkh

    spi: omap2_mcspi PIO RX fix

    Kalle Valo committed with gregkh
    patch feed9ba in mainline.
    Before transmission of the last word in PIO RX_ONLY mode rx+tx mode
    is enabled:
    	/* prevent last RX_ONLY read from triggering
    	 * more word i/o: switch to rx+tx
    	if (c == 0 && tx == NULL)
    				OMAP2_MCSPI_CHCONF0, l);
    But because c is decremented after the test, c will never be zero and
    rx+tx will not be enabled. This breaks RX_ONLY mode PIO transfers.
    Fix it by decrementing c in the beginning of the various I/O loops.
    Signed-off-by: Kalle Valo <>
    Signed-off-by: David Brownell <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  13. @gregkh

    Fix unbalanced helper_lock in kernel/kmod.c

    Nigel Cunningham committed with gregkh
    patch 7846803 in mainline.
    call_usermodehelper_exec() has an exit path that can leave the
    helper_lock() call at the top of the routine unbalanced.  The attached
    patch fixes this issue.
    Signed-off-by: Nigel Cunningham <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  14. @gregkh

    ia64: Fix unaligned handler for floating point instructions with base…

    Luck, Tony committed with gregkh
    … update
    commit 1a49915 in mainline.
    [IA64] Fix unaligned handler for floating point instructions with base update
    The compiler team did the hard work for this distilling a problem in
    large fortran application which showed up when applied to a 290MB input
    data set down to this instruction:
    	ldfd f34=[r17],-8
    Which they noticed incremented r17 by 0x10 rather than decrementing it
    by 8 when the value in r17 caused an unaligned data fault.  I tracked
    it down to some bad instruction decoding in unaligned.c. The code
    assumes that the 'x' bit can determine whether the instruction is
    an "ldf" or "ldfp" ... which it is for opcode=6 (see table 4-29 on
    page 3:302 of the SDM).  But for opcode=7 the 'x' bit is irrelevent,
    all variants are "ldf" instructions (see table 4-36 on page 3:306).
    Note also that interpreting the instruction as "ldfp" means that the
    "paired" floating point register (f35 in the example here) will also
    be corrupted.
    Signed-off-by: Tony Luck <>
    Signed-off-by: Greg Kroah-Hartman <>
  15. @gregkh

    sata_promise: ASIC PRD table bug workaround

    Mikael Pettersson committed with gregkh
    patch 03116d6 in mainline.
    Second-generation Promise SATA controllers have an ASIC bug
    which can trigger if the last PRD entry is larger than 164 bytes,
    resulting in intermittent errors and possible data corruption.
    Work around this by replacing calls to ata_qc_prep() with a
    private version that fills the PRD, checks the size of the
    last entry, and if necessary splits it to avoid the bug.
    Also reduce sg_tablesize by 1 to accommodate the new entry.
    Tested on the second-generation SATA300 TX4 and SATA300 TX2plus,
    and the first-generation PDC20378.
    Thanks to Alexander Sabourenkov for verifying the bug by
    studying the vendor driver, and for writing the initial patch
    upon which this one is based.
    Signed-off-by: Mikael Pettersson <>
    Signed-off-by: Greg Kroah-Hartman <>
  16. @gregkh

    vm audit: add VM_DONTEXPAND to mmap for drivers that need it (CVE-200…

    Nick Piggin committed with gregkh
    Drivers that register a ->fault handler, but do not range-check the
    offset argument, must set VM_DONTEXPAND in the vm_flags in order to
    prevent an expanding mremap from overflowing the resource.
    I've audited the tree and attempted to fix these problems (usually by
    adding VM_DONTEXPAND where it is not obvious).
    Signed-off-by: Nick Piggin <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  17. @neilbrown @gregkh

    knfsd: Allow NFSv2/3 WRITE calls to succeed when krb5i etc is used.

    neilbrown committed with gregkh
    patch ba67a39 in mainline.
    When RPCSEC/GSS and krb5i is used, requests are padded, typically to a multiple
    of 8 bytes.  This can make the request look slightly longer than it
    really is.
    As of
    	f34b956 "The NFSv2/NFSv3 server does not handle zero
    		length WRITE request correctly",
    the xdr decode routines for NFSv2 and NFSv3 reject requests that aren't
    the right length, so krb5i (for example) WRITE requests can get lost.
    This patch relaxes the appropriate test and enhances the related comment.
    Signed-off-by: Neil Brown <>
    Signed-off-by: J. Bruce Fields <>
    Cc: Peter Staubach <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  18. @djbw @gregkh

    md: fix data corruption when a degraded raid5 array is reshaped

    djbw committed with gregkh
    patch 0f94e87 in mainline.
    We currently do not wait for the block from the missing device to be
    computed from parity before copying data to the new stripe layout.
    The change in the raid6 code is not techincally needed as we don't delay
    data block recovery in the same way for raid6 yet.  But making the change
    now is safer long-term.
    This bug exists in 2.6.23 and 2.6.24-rc
    Signed-off-by: Dan Williams <>
    Acked-by: Neil Brown <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  19. @eparis @gregkh

    security: protect from stack expantion into low vm addresses

    eparis committed with gregkh
    patch 8869477 in mainline.
    Add security checks to make sure we are not attempting to expand the
    stack into memory protected by mmap_min_addr
    Signed-off-by: Eric Paris <>
    Signed-off-by: James Morris <>
    Signed-off-by: Greg Kroah-Hartman <>
  20. @eparis @gregkh

    VM/Security: add security hook to do_brk (CVE-2007-6434)

    eparis committed with gregkh
    patch ecaf18c in mainline.
    VM/Security: add security hook to do_brk
    Given a specifically crafted binary do_brk() can be used to get low pages
    available in userspace virtual memory and can thus be used to circumvent
    the mmap_min_addr low memory protection.  Add security checks in do_brk().
    Signed-off-by: Eric Paris <>
    Acked-by: Alan Cox <>
    Cc: Stephen Smalley <>
    Cc: James Morris <>
    Cc: Chris Wright <>
    Cc: maximilian attems <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  21. @gregkh

    m68k: Export cachectl.h

    Matthew Wilcox committed with gregkh
    patch e92042e in mainline.
    m68k: Export cachectl.h
    libffi in GCC 4.2 needs cachectl.h to do its cache flushing.  But we
    don't currently export it.  I believe this patch should do the trick.
    Signed-off-by: Matthew Wilcox <>
    Cc: maximilian attems <>
    Signed-off-by: Geert Uytterhoeven <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>
  22. @gregkh

    CIFS: Respect umask when using POSIX mkdir

    Steve French committed with gregkh
    patch a8cd925 in mainline.
    [CIFS] Respect umask when using POSIX mkdir
    When making a directory with POSIX mkdir calls, cifs_mkdir does not
    respect the umask.  This patch causes the new POSIX mkdir to create with
    the right mode
    Signed-off-by: Jeff Layton <>
    Signed-off-by: Steve French <>
    Cc: maximilian attems <>
    Signed-off-by: Greg Kroah-Hartman <>
  23. @gregkh

    Input: fix open count handling in input interfaces

    Oliver Neukum committed with gregkh
    patch 0644501 in mainline.
    If input_open_device() fails we should not leave interfaces marked
    as opened.
    Signed-off-by: Oliver Neukum <>
    Cc: Al Viro <>
    Signed-off-by: Dmitry Torokhov <>
    Signed-off-by: Greg Kroah-Hartman <>
  24. @dtor @gregkh

    Input: tsdev - implement proper locking

    dtor committed with gregkh
    patch b9d2d11 in mainline.
    Signed-off-by: Dmitry Torokhov <>
    Cc: Al Viro <>
    Signed-off-by: Greg Kroah-Hartman <>
Something went wrong with that request. Please try again.