13 Feb, 2013

5 commits

  • We're forgetting to reenable local interrupts on an error path.

    Signed-off-by: "Eric W. Biederman"
    Reported-by: Josh Boyer
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • The designed workflow for the caches in kmemcg is: register it with
    memcg_register_cache() if kmemcg is already available or later on when a
    new kmemcg appears at memcg_update_cache_sizes() which will handle all
    caches in the system. The caches created at boot time will be handled
    by the later, and the memcg-caches as well as any system caches that are
    registered later on by the former.

    There is a bug, however, in memcg_register_cache: we correctly set up
    the array size, but do not mark the cache as a root cache.

    This means that allocations for any cache appearing late in the game
    will see memcg->memcg_params->is_root_cache == false, and in particular,
    trigger VM_BUG_ON(!cachep->memcg_params->is_root_cache) in
    __memcg_kmem_cache_get.

    The obvious fix is to include the missing assignment.

    Signed-off-by: Glauber Costa
    Cc: Michal Hocko
    Cc: Johannes Weiner
    Cc: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Glauber Costa
     
  • With commit 8e72033f2a48 ("thp: make MADV_HUGEPAGE check for
    mm->def_flags") the VM_NOHUGEPAGE flag may be set on s390 in
    mm->def_flags for certain processes, to prevent future thp mappings.
    This would be overwritten by do_mlockall(), which sets it back to 0 with
    an optional VM_LOCKED flag set.

    To fix this, instead of overwriting mm->def_flags in do_mlockall(), only
    the VM_LOCKED flag should be set or cleared.

    Signed-off-by: Gerald Schaefer
    Reported-by: Vivek Goyal
    Cc: Andrea Arcangeli
    Cc: Hugh Dickins
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerald Schaefer
     
  • Commit e7e034e18a0a ("drivers/rtc/rtc-pl031.c: fix the missing operation
    on enable") accidentally broke the ST variants of PL031.

    The bit that is being poked as "clockwatch" enable bit for the ST
    variants does the work of bit 0 on this variant. Bit 0 is used for a
    clock divider on the ST variants, and setting it to 1 will affect
    timekeeping in a very bad way.

    Signed-off-by: Linus Walleij
    Acked-by: Haojian Zhuang
    Cc: Mian Yousaf KAUKAB
    Cc: Srinidhi Kasagar
    Cc: Alessandro Zummo
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Walleij
     
  • Pull drm fixes from Dave Airlie:
    "Three nouveau fixes, all user visible issues, and one radeon
    regression fix"

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/radeon: enforce use of radeon_get_ib_value when reading user cmd
    drm/nouveau: add lockdep annotations
    drm/nv50/fb: Fix nullptr-deref on IGPs
    drm/nouveau: use different register to wait for secret scrubber

    Linus Torvalds
     

12 Feb, 2013

1 commit

  • When ever parsing cmd buffer supplied by userspace we need to use
    radeon_get_ib_value rather than directly accessing the ib as the user
    cmd might not yet be copied into the ib thus the parser might read
    value that does not correspond to what user is sending and possibly
    allowing user to send malicious command undected.

    Signed-off-by: Jerome Glisse
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Jerome Glisse
     

11 Feb, 2013

1 commit


09 Feb, 2013

8 commits

  • 1) Lockdep thinks all nouveau subdevs belong to the same class and can be
    locked in arbitrary order, which is not true (at least in general case).
    Tell it to distinguish subdevs by (o)class type.
    2) DRM client can be locked under user client lock - tell lockdep to put
    DRM client lock in a separate class.

    Reported-by: Arend van Spriel
    Reported-by: Peter Hurley
    Reported-by: Maarten Lankhorst
    Reported-by: Daniel J Blueman
    Signed-off-by: Marcin Slusarz
    Cc: stable@vger.kernel.org [3.7, but needs s/const ofuncs/ofuncs/ to build]
    Signed-off-by: Ben Skeggs

    Marcin Slusarz
     
  • Linus Torvalds
     
  • Pull ARM fixes from Russell King:
    "I was going to hold these off until v3.8 was out, and send them with a
    stable tag, but as everyone else is pushing much bigger fixes which
    Linus is accepting, let's save people from the hastle of having to
    patch v3.8 back into working or use a stable kernel.

    Looking at the diffstat, this really is high value for its size; this
    is miniscule compared to how the -rc6 to tip diffstat currently looks.

    So, four patches in this set:
    - Punit Agrawal reports that the kernel no longer boots on MPCore due
    to a new assumption made in the GIC code which isn't true of
    earlier GIC designs. This is the biggest change in this set.
    - Punit's boot log also revealed a bunch of WARN_ON() dumps caused by
    the DT-ification of the GIC support without fixing up non-DT
    Realview - which now sees a greater number of interrupts than it
    did before.
    - A fix for the DMA coherent code from Marek which uses the wrong
    check for atomic allocations; this can result in spinlock lockups
    or other nasty effects.
    - A fix from Will, which will affect all Android based platforms if
    not applied (which use the 2G:2G VM split) - this causes
    particularly 'make' to misbehave unless this bug is fixed."

    * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
    ARM: 7641/1: memory: fix broken mmap by ensuring TASK_UNMAPPED_BASE is aligned
    ARM: DMA mapping: fix bad atomic test
    ARM: realview: ensure that we have sufficient IRQs available
    ARM: GIC: fix GIC cpumask initialization

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Revert iwlwifi reclaimed packet tracking, it causes problems for a
    bunch of folks. From Emmanuel Grumbach.

    2) Work limiting code in brcmsmac wifi driver can clear tx status
    without processing the event. From Arend van Spriel.

    3) rtlwifi USB driver processes wrong SKB, fix from Larry Finger.

    4) l2tp tunnel delete can race with close, fix from Tom Parkin.

    5) pktgen_add_device() failures are not checked at all, fix from Cong
    Wang.

    6) Fix unintentional removal of carrier off from tun_detach(),
    otherwise we confuse userspace, from Michael S. Tsirkin.

    7) Don't leak socket reference counts and ubufs in vhost-net driver,
    from Jason Wang.

    8) vmxnet3 driver gets it's initial carrier state wrong, fix from Neil
    Horman.

    9) Protect against USB networking devices which spam the host with 0
    length frames, from Bjørn Mork.

    10) Prevent neighbour overflows in ipv6 for locally destined routes,
    from Marcelo Ricardo. This is the best short-term fix for this, a
    longer term fix has been implemented in net-next.

    11) L2TP uses ipv4 datagram routines in it's ipv6 code, whoops. This
    mistake is largely because the ipv6 functions don't even have some
    kind of prefix in their names to suggest they are ipv6 specific.
    From Tom Parkin.

    12) Check SYN packet drops properly in tcp_rcv_fastopen_synack(), from
    Yuchung Cheng.

    13) Fix races and TX skb freeing bugs in via-rhine's NAPI support, from
    Francois Romieu and your's truly.

    14) Fix infinite loops and divides by zero in TCP congestion window
    handling, from Eric Dumazet, Neal Cardwell, and Ilpo Järvinen.

    15) AF_PACKET tx ring handling can leak kernel memory to userspace, fix
    from Phil Sutter.

    16) Fix error handling in ipv6 GRE tunnel transmit, from Tommi Rantala.

    17) Protect XEN netback driver against hostile frontend putting garbage
    into the rings, don't leak pages in TX GOP checking, and add proper
    resource releasing in error path of xen_netbk_get_requests(). From
    Ian Campbell.

    18) SCTP authentication keys should be cleared out and released with
    kzfree(), from Daniel Borkmann.

    19) L2TP is a bit too clever trying to maintain skb->truesize, and ends
    up corrupting socket memory accounting to the point where packet
    sending is halted indefinitely. Just remove the adjustments
    entirely, they aren't really needed. From Eric Dumazet.

    20) ATM Iphase driver uses a data type with the same name as the S390
    headers, rename to fix the build. From Heiko Carstens.

    21) Fix a typo in copying the inner network header offset from one SKB
    to another, from Pravin B Shelar.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (56 commits)
    net: sctp: sctp_endpoint_free: zero out secret key data
    net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
    atm/iphase: rename fregt_t -> ffreg_t
    net: usb: fix regression from FLAG_NOARP code
    l2tp: dont play with skb->truesize
    net: sctp: sctp_auth_key_put: use kzfree instead of kfree
    netback: correct netbk_tx_err to handle wrap around.
    xen/netback: free already allocated memory on failure in xen_netbk_get_requests
    xen/netback: don't leak pages on failure in xen_netbk_tx_check_gop.
    xen/netback: shutdown the ring if it contains garbage.
    net: qmi_wwan: add more Huawei devices, including E320
    net: cdc_ncm: add another Huawei vendor specific device
    ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
    tcp: fix for zero packets_in_flight was too broad
    brcmsmac: rework of mac80211 .flush() callback operation
    ssb: unregister gpios before unloading ssb
    bcma: unregister gpios before unloading bcma
    rtlwifi: Fix scheduling while atomic bug
    net: usbnet: fix tx_dropped statistics
    tcp: ipv6: Update MIB counters for drops
    ...

    Linus Torvalds
     
  • Daniel Borkmann says:

    ====================
    Cryptographically used keys should be zeroed out when our session
    ends resp. memory is freed, thus do not leave them somewhere in the
    memory.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • On sctp_endpoint_destroy, previously used sensitive keying material
    should be zeroed out before the memory is returned, as we already do
    with e.g. auth keys when released.

    Signed-off-by: Daniel Borkmann
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Daniel Borkmann
     
  • In sctp_setsockopt_auth_key, we create a temporary copy of the user
    passed shared auth key for the endpoint or association and after
    internal setup, we free it right away. Since it's sensitive data, we
    should zero out the key before returning the memory back to the
    allocator. Thus, use kzfree instead of kfree, just as we do in
    sctp_auth_key_put().

    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     
  • We have conflicting type qualifiers for "freg_t" in s390's ptrace.h and the
    iphase atm device driver, which causes the compile error below.
    Unfortunately the s390 typedef can't be renamed, since it's a user visible api,
    nor can I change the include order in s390 code to avoid the conflict.

    So simply rename the iphase typedef to a new name. Fixes this compile error:

    In file included from drivers/atm/iphase.c:66:0:
    drivers/atm/iphase.h:639:25: error: conflicting type qualifiers for 'freg_t'
    In file included from next/arch/s390/include/asm/ptrace.h:9:0,
    from next/arch/s390/include/asm/lowcore.h:12,
    from next/arch/s390/include/asm/thread_info.h:30,
    from include/linux/thread_info.h:54,
    from include/linux/preempt.h:9,
    from include/linux/spinlock.h:50,
    from include/linux/seqlock.h:29,
    from include/linux/time.h:5,
    from include/linux/stat.h:18,
    from include/linux/module.h:10,
    from drivers/atm/iphase.c:43:
    next/arch/s390/include/uapi/asm/ptrace.h:197:3: note: previous declaration of 'freg_t' was here

    Signed-off-by: Heiko Carstens
    Acked-by: chas williams - CONTRACTOR
    Signed-off-by: David S. Miller

    Heiko Carstens
     

08 Feb, 2013

21 commits

  • We have received multiple reports of mmap failures when running with a
    2:2 vm split. These manifest as either -EINVAL with a non page-aligned
    address (ending 0xaaa) or a SEGV, depending on the application. The
    issue is commonly observed in children of make, which appears to use
    bottom-up mmap (assumedly because it changes the stack rlimit).

    Further investigation reveals that this regression was triggered by
    394ef6403abc ("mm: use vm_unmapped_area() on arm architecture"), whereby
    TASK_UNMAPPED_BASE is no longer page-aligned for bottom-up mmap, causing
    get_unmapped_area to choke on misaligned addressed.

    This patch fixes the problem by defining TASK_UNMAPPED_BASE in terms of
    TASK_SIZE and explicitly aligns the result to 16M, matching the other
    end of the heap.

    Acked-by: Nicolas Pitre
    Reported-by: Steve Capper
    Reported-by: Jean-Francois Moine
    Reported-by: Christoffer Dall
    Signed-off-by: Will Deacon
    Signed-off-by: Russell King

    Will Deacon
     
  • Realview fails to boot with this warning:
    BUG: spinlock lockup suspected on CPU#0, init/1
    lock: 0xcf8bde10, .magic: dead4ead, .owner: init/1, .owner_cpu: 0
    Backtrace:
    [] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c) r6:cf8bde10 r5:cf83d1c0 r4:cf8bde10 r3:cf83d1c0
    [] (dump_stack+0x0/0x1c) from [] (spin_dump+0x84/0x98)
    [] (spin_dump+0x0/0x98) from [] (do_raw_spin_lock+0x100/0x198)
    [] (do_raw_spin_lock+0x0/0x198) from [] (_raw_spin_lock+0x3c/0x44)
    [] (_raw_spin_lock+0x0/0x44) from [] (pl011_console_write+0xe8/0x11c)
    [] (pl011_console_write+0x0/0x11c) from [] (call_console_drivers.clone.7+0xdc/0x104)
    [] (call_console_drivers.clone.7+0x0/0x104) from [] (console_unlock+0x2e8/0x454)
    [] (console_unlock+0x0/0x454) from [] (vprintk_emit+0x2d8/0x594)
    [] (vprintk_emit+0x0/0x594) from [] (printk+0x3c/0x44)
    [] (printk+0x0/0x44) from [] (warn_slowpath_common+0x28/0x6c)
    [] (warn_slowpath_common+0x0/0x6c) from [] (warn_slowpath_null+0x24/0x2c)
    [] (warn_slowpath_null+0x0/0x2c) from [] (lockdep_trace_alloc+0xd8/0xf0)
    [] (lockdep_trace_alloc+0x0/0xf0) from [] (kmem_cache_alloc+0x24/0x11c)
    [] (kmem_cache_alloc+0x0/0x11c) from [] (__get_vm_area_node.clone.24+0x7c/0x16c)
    [] (__get_vm_area_node.clone.24+0x0/0x16c) from [] (get_vm_area_caller+0x48/0x54)
    [] (get_vm_area_caller+0x0/0x54) from [] (__alloc_remap_buffer.clone.15+0x38/0xb8)
    [] (__alloc_remap_buffer.clone.15+0x0/0xb8) from [] (__dma_alloc+0x160/0x2c8)
    [] (__dma_alloc+0x0/0x2c8) from [] (arm_dma_alloc+0x88/0xa0)[] (arm_dma_alloc+0x0/0xa0) from [] (dma_pool_alloc+0xcc/0x1a8)
    [] (dma_pool_alloc+0x0/0x1a8) from [] (pl08x_fill_llis_for_desc+0x28/0x568)
    [] (pl08x_fill_llis_for_desc+0x0/0x568) from [] (pl08x_prep_slave_sg+0x258/0x3b0)
    [] (pl08x_prep_slave_sg+0x0/0x3b0) from [] (pl011_dma_tx_refill+0x140/0x288)
    [] (pl011_dma_tx_refill+0x0/0x288) from [] (pl011_start_tx+0xe4/0x120)
    [] (pl011_start_tx+0x0/0x120) from [] (__uart_start+0x48/0x4c)
    [] (__uart_start+0x0/0x4c) from [] (uart_start+0x2c/0x3c)
    [] (uart_start+0x0/0x3c) from [] (uart_write+0xcc/0xf4)
    [] (uart_write+0x0/0xf4) from [] (n_tty_write+0x1c0/0x3e4)
    [] (n_tty_write+0x0/0x3e4) from [] (tty_write+0x144/0x240)
    [] (tty_write+0x0/0x240) from [] (redirected_tty_write+0x98/0xac)
    [] (redirected_tty_write+0x0/0xac) from [] (vfs_write+0xbc/0x150)
    [] (vfs_write+0x0/0x150) from [] (sys_write+0x4c/0x78)
    [] (sys_write+0x0/0x78) from [] (ret_fast_syscall+0x0/0x3c)

    This happens because the DMA allocation code is not respecting atomic
    allocations correctly.

    GFP flags should not be tested for GFP_ATOMIC to determine if an
    atomic allocation is being requested. GFP_ATOMIC is not a flag but
    a value. The GFP bitmask flags are all prefixed with __GFP_.

    The rest of the kernel tests for __GFP_WAIT not being set to indicate
    an atomic allocation. We need to do the same.

    Signed-off-by: Russell King

    Russell King
     
  • Realview EB with a rev B MPcore tile results in lots of warnings at
    boot because it can't allocate enough IRQs. Fix this by increasing
    the number of available IRQs.

    WARNING: at /home/rmk/git/linux-rmk/arch/arm/common/gic.c:757 gic_init_bases+0x12c/0x2ec()
    Cannot allocate irq_descs @ IRQ96, assuming pre-allocated
    Modules linked in:
    Backtrace:
    [] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c) r6:000002f5 r5:c042c62c r4:c044ff40 r3:c045f240
    [] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x54/0x6c)
    [] (warn_slowpath_common+0x0/0x6c) from [] (warn_slowpath_fmt+0x38/0x40)
    [] (warn_slowpath_fmt+0x0/0x40) from [] (gic_init_bases+0x12c/0x2ec)
    [] (gic_init_bases+0x0/0x2ec) from [] (gic_init_irq+0x8c/0xd8)
    [] (gic_init_irq+0x0/0xd8) from [] (init_IRQ+0x1c/0x24)
    [] (init_IRQ+0x0/0x24) from [] (start_kernel+0x1a4/0x300)
    [] (start_kernel+0x0/0x300) from [] (0x70008070)
    ---[ end trace 1b75b31a2719ed1c ]---
    ------------[ cut here ]------------
    WARNING: at /home/rmk/git/linux-rmk/kernel/irq/irqdomain.c:234 irq_domain_add_legacy+0x80/0x140()
    Modules linked in:
    Backtrace:
    [] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c) r6:000000ea r5:c0081a38 r4:00000000 r3:c045f240
    [] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x54/0x6c)
    [] (warn_slowpath_common+0x0/0x6c) from [] (warn_slowpath_null+0x24/0x2c)
    [] (warn_slowpath_null+0x0/0x2c) from [] (irq_domain_add_legacy+0x80/0x140)
    [] (irq_domain_add_legacy+0x0/0x140) from [] (gic_init_bases+0x14c/0x2ec)
    [] (gic_init_bases+0x0/0x2ec) from [] (gic_init_irq+0x8c/0xd8)
    [] (gic_init_irq+0x0/0xd8) from [] (init_IRQ+0x1c/0x24)
    [] (init_IRQ+0x0/0x24) from [] (start_kernel+0x1a4/0x300)
    [] (start_kernel+0x0/0x300) from [] (0x70008070)
    ---[ end trace 1b75b31a2719ed1d ]---
    ------------[ cut here ]------------
    WARNING: at /home/rmk/git/linux-rmk/arch/arm/common/gic.c:762 gic_init_bases+0x170/0x2ec()
    Modules linked in:
    Backtrace:
    [] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c) r6:000002fa r5:c042c670 r4:00000000 r3:c045f240
    [] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x54/0x6c)
    [] (warn_slowpath_common+0x0/0x6c) from [] (warn_slowpath_null+0x24/0x2c)
    [] (warn_slowpath_null+0x0/0x2c) from [] (gic_init_bases+0x170/0x2ec)
    [] (gic_init_bases+0x0/0x2ec) from [] (gic_init_irq+0x8c/0xd8)
    [] (gic_init_irq+0x0/0xd8) from [] (init_IRQ+0x1c/0x24)
    [] (init_IRQ+0x0/0x24) from [] (start_kernel+0x1a4/0x300)
    [] (start_kernel+0x0/0x300) from [] (0x70008070)
    ---[ end trace 1b75b31a2719ed1e ]---

    Signed-off-by: Russell King

    Russell King
     
  • Punit Agrawal reports:
    > I was trying to boot 3.8-rc5 on Realview EB 11MPCore using
    > realview-smp_defconfig as a starting point but the kernel failed to
    > progress past the log below (config attached).
    >
    > Pawel suggested I try reverting 384a290283f - "ARM: gic: use a private
    > mapping for CPU target interfaces" that you've authored. With this
    > commit reverted the kernel boots.
    >
    > I am not quite sure why the commit breaks 11MPCore but Pawel (cc'd)
    > might be able to shed light on that.

    Some early GIC implementations return zero for the first distributor
    CPU routing register. This means we can't rely on that telling us
    which CPU interface we're connected to. We know that these platforms
    implement PPIs for IRQs 29-31 - but we shouldn't assume that these
    will always be populated.

    So, instead, scan for a non-zero CPU routing register in the first
    32 IRQs and use that as our CPU mask.

    Reported-by: Punit Agrawal
    Reviewed-by: Nicolas Pitre
    Signed-off-by: Russell King

    Russell King
     
  • Pull drm regression fix from Dave Airlie:
    "This one fixes a sleep while locked regression that was introduced
    earlier in 3.8."

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/ttm: fix fence locking in ttm_buffer_object_transfer, 2nd try

    Linus Torvalds
     
  • In commit 6509141f9c2ba74df6cc72ec35cd1865276ae3a4 ("usbnet: add new
    flag FLAG_NOARP for usb net devices"), the newly added flag NOARP was
    using an already defined value, which broke drivers using flag
    MULTI_PACKET.

    Signed-off-by: Lucas Stach
    Signed-off-by: David S. Miller

    Lucas Stach
     
  • Andrew Savchenko reported a DNS failure and we diagnosed that
    some UDP sockets were unable to send more packets because their
    sk_wmem_alloc was corrupted after a while (tx_queue column in
    following trace)

    $ cat /proc/net/udp
    sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops
    ...
    459: 00000000:0270 00000000:0000 07 00000000:00000000 00:00000000 00000000 0 0 4507 2 ffff88003d612380 0
    466: 00000000:0277 00000000:0000 07 00000000:00000000 00:00000000 00000000 0 0 4802 2 ffff88003d613180 0
    470: 076A070A:007B 00000000:0000 07 FFFF4600:00000000 00:00000000 00000000 123 0 5552 2 ffff880039974380 0
    470: 010213AC:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000 0 0 4986 2 ffff88003dbd3180 0
    470: 010013AC:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000 0 0 4985 2 ffff88003dbd2e00 0
    470: 00FCA8C0:007B 00000000:0000 07 FFFFFB00:00000000 00:00000000 00000000 0 0 4984 2 ffff88003dbd2a80 0
    ...

    Playing with skb->truesize is tricky, especially when
    skb is attached to a socket, as we can fool memory charging.

    Just remove this code, its not worth trying to be ultra
    precise in xmit path.

    Reported-by: Andrew Savchenko
    Tested-by: Andrew Savchenko
    Signed-off-by: Eric Dumazet
    Cc: James Chapman
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • For sensitive data like keying material, it is common practice to zero
    out keys before returning the memory back to the allocator. Thus, use
    kzfree instead of kfree.

    Signed-off-by: Daniel Borkmann
    Acked-by: Neil Horman
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Daniel Borkmann
     
  • …vswitch into openvswitch

    Jesse Gross says:

    ====================
    One bug fix for net/3.8 for a long standing problem that was reported a few
    times recently.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     
  • Ian Campbell says:

    ====================
    The Xen netback implementation contains a couple of flaws which can
    allow a guest to cause a DoS in the backend domain, potentially
    affecting other domains in the system.

    CVE-2013-0216 is a failure to sanity check the ring producer/consumer
    pointers which can allow a guest to cause netback to loop for an
    extended period preventing other work from occurring.

    CVE-2013-0217 is a memory leak on an error path which is guest
    triggerable.

    The following series contains the fixes for these issues, as previously
    included in Xen Security Advisory 39:
    http://lists.xen.org/archives/html/xen-announce/2013-02/msg00001.html

    Changes in v2:
    - Typo and block comment format fixes
    - Added stable Cc
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: Ian Campbell
    Acked-by: Jan Beulich
    Signed-off-by: David S. Miller

    Ian Campbell
     
  • Signed-off-by: Ian Campbell
    Signed-off-by: David S. Miller

    Ian Campbell
     
  • Signed-off-by: Matthew Daley
    Reviewed-by: Konrad Rzeszutek Wilk
    Acked-by: Ian Campbell
    Acked-by: Jan Beulich
    Signed-off-by: David S. Miller

    Matthew Daley
     
  • A buggy or malicious frontend should not be able to confuse netback.
    If we spot anything which is not as it should be then shutdown the
    device and don't try to continue with the ring in a potentially
    hostile state. Well behaved and non-hostile frontends will not be
    penalised.

    As well as making the existing checks for such errors fatal also add a
    new check that ensures that there isn't an insane number of requests
    on the ring (i.e. more than would fit in the ring). If the ring
    contains garbage then previously is was possible to loop over this
    insane number, getting an error each time and therefore not generating
    any more pending requests and therefore not exiting the loop in
    xen_netbk_tx_build_gops for an externded period.

    Also turn various netdev_dbg calls which no precipitate a fatal error
    into netdev_err, they are rate limited because the device is shutdown
    afterwards.

    This fixes at least one known DoS/softlockup of the backend domain.

    Signed-off-by: Ian Campbell
    Reviewed-by: Konrad Rzeszutek Wilk
    Acked-by: Jan Beulich
    Signed-off-by: David S. Miller

    Ian Campbell
     
  • Pull virtio fix from Rusty Russell:
    "Obviously I forgot to push this before linux.conf.au..."

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    virtio_console: Don't access uninitialized data.

    Linus Torvalds
     
  • Pull IB regression fixes from Roland Dreier:

    - Fix mlx4 VFs not working on old guests because of 64B CQE changes

    - Fix ill-considered sparse fix for qib

    - Fix IPoIB crash due to skb double destruct introduced in 3.8-rc1

    * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    IB/qib: Fix for broken sparse warning fix
    mlx4_core: Fix advertisement of wrong PF context behaviour
    IPoIB: Fix crash due to skb double destruct

    Linus Torvalds
     
  • Pull btrfs fixes from Chris Mason:
    "We've got corner cases for updating i_size that ceph was hitting,
    error handling for quotas when we run out of space, a very subtle
    snapshot deletion race, a crash while removing devices, and one
    deadlock between subvolume creation and the sb_internal code (thanks
    lockdep)."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: move d_instantiate outside the transaction during mksubvol
    Btrfs: fix EDQUOT handling in btrfs_delalloc_reserve_metadata
    Btrfs: fix possible stale data exposure
    Btrfs: fix missing i_size update
    Btrfs: fix race between snapshot deletion and getting inode
    Btrfs: fix missing release of the space/qgroup reservation in start_transaction()
    Btrfs: fix wrong sync_writers decrement in btrfs_file_aio_write()
    Btrfs: do not merge logged extents if we've removed them from the tree
    btrfs: don't try to notify udev about missing devices

    Linus Torvalds
     
  • …it/linusw/linux-pinctrl

    Pull late pinctrl fixes from Linus Walleij:
    "Two patches appeared as of late, one was completely news to me, the
    other one was rotated in -next for the next merge window but turned
    out to be a showstopper.

    - Exynos Kconfig fixup
    - SIRF DT translation bug"

    * tag 'pinctrl-for-v3.8-late' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
    pinctrl: sirf: replace of_gpio_simple_xlate by sirf specific of_xlate
    pinctrl: exynos: change PINCTRL_EXYNOS option

    Linus Torvalds
     
  • Pull Xen fixes from Konrad Rzeszutek Wilk:
    "This has two fixes. One is a security fix wherein we would spam the
    kernel printk buffer if one of the guests was misbehaving. The other
    is much tamer and it was us only checking for one type of error from
    the IRQ subsystem (when allocating new IRQs) instead of for all of
    them.

    - Fix an IRQ allocation where we only check for a specific error (-1).
    - CVE-2013-0231 / XSA-43. Make xen-pciback rate limit error messages
    from xen_pcibk_enable_msi{,x}()"

    * tag 'stable/for-linus-3.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen: fix error handling path if xen_allocate_irq_dynamic fails
    xen-pciback: rate limit error messages from xen_pcibk_enable_msi{,x}()

    Linus Torvalds
     
  • Pull regulator fixes from Mark Brown:
    "Mostly driver specific fixes here, though one of them uncovered the
    issue Stephen Warren fixed with multiple OF matches getting upset due
    to a lack of cleanup."

    * tag 'regulator-v3.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
    regulator: s2mps11: fix incorrect register for buck10
    regulator: clear state each invocation of of_regulator_match
    regulator: max8997: Fix using wrong dev argument at various places
    regulator: max77686: Fix using wrong dev argument at various places
    regulator: max8907: Fix using wrong dev argument for calling of_regulator_match
    regulator: max8998: fix incorrect min_uV value for ldo10
    regulator: tps65910: Fix using wrong dev argument for calling of_regulator_match
    regulator: tps65217: Fix using wrong dev argument for calling of_regulator_match

    Linus Torvalds
     
  • This fixes up

    commit e8e89622ed361c46bf90ba4828e685a8b603f7e5
    Author: Daniel Vetter
    Date: Tue Dec 18 22:25:11 2012 +0100

    drm/ttm: fix fence locking in ttm_buffer_object_transfer

    which leaves behind a might_sleep in atomic context, since the
    fence_lock spinlock is held over a kmalloc(GFP_KERNEL) call. The fix
    is to revert the above commit and only take the lock where we need it,
    around the call to ->sync_obj_ref.

    v2: Fixup things noticed by Maarten Lankhorst:
    - Brown paper bag locking bug.
    - No need for kzalloc if we clear the entire thing on the next line.
    - check for bo->sync_obj (totally unlikely race, but still someone
    else could have snuck in) and clear fbo->sync_obj if it's cleared
    already.

    Reported-by: Dave Airlie
    Cc: Jerome Glisse
    Cc: Maarten Lankhorst
    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     

07 Feb, 2013

4 commits

  • Don't access uninitialized work-queue when removing device.
    The work queue is initialized only if the device multi-queue.
    So don't call cancel_work unless this is a multi-queue device.

    This fixes the following panic:

    Kernel panic - not syncing: BUG!
    Call Trace:
    62031b28: [] panic+0x16b/0x2d3
    62031b30: [] flush_work+0x0/0x1d7
    62031b60: [] panic+0x0/0x2d3
    62031b68: [] memcpy+0x0/0x140
    62031b80: [] unblock_signals+0x0/0x84
    62031ba0: [] printk+0x0/0xa0
    62031bd8: [] __mutex_unlock_slowpath+0x13d/0x148
    62031c10: [] flush_work+0x0/0x1d7
    62031c18: [] try_to_grab_pending+0x0/0x17e
    62031c38: [] get_work_gcwq+0x71/0x8f
    62031c48: [] __cancel_work_timer+0x5b/0x115
    62031c78: [] unplug_port+0x0/0x191 [virtio_console]
    62031c98: [] cancel_work_sync+0x12/0x14
    62031ca8: [] virtcons_remove+0x80/0x15c [virtio_console]
    62031ce8: [] virtio_dev_remove+0x1e/0x7e [virtio]
    62031d08: [] __device_release_driver+0x75/0xe4
    62031d28: [] device_release_driver+0x2c/0x40
    62031d48: [] driver_unbind+0x7d/0xc6
    62031d88: [] drv_attr_store+0x27/0x29
    62031d98: [] sysfs_write_file+0x100/0x14d
    62031df8: [] vfs_write+0xcb/0x184
    62031e08: [] filp_close+0x88/0x94
    62031e38: [] sys_write+0x59/0x88
    62031e88: [] handle_syscall+0x5d/0x80
    62031ea8: [] userspace+0x405/0x531
    62031f08: [] sys_dup+0x0/0x5e
    62031f28: [] strcpy+0x0/0x18
    62031f38: [] do_execve+0x10/0x12
    62031f48: [] run_init_process+0x43/0x45
    62031fd8: [] new_thread_handler+0xba/0xbc

    Signed-off-by: Sjur Brændeland
    Cc: stable@kernel.org
    Signed-off-by: Rusty Russell

    Sjur Brændeland
     
  • Pull sound fixes from Takashi Iwai:
    "Just a couple of build regression fixes for ASoC fsl stuff. It
    doesn't look too trivial, but neither intrusive, so hopefully I can
    avoid your curse..."

    Hey, Takashi has a good track record, I think he gets a pass..

    * tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ASoC: fsl: fix snd-soc-imx-pcm module build
    Revert "ASoC: fsl: fix multiple definition of init_module"

    Linus Torvalds
     
  • Pull block layer updates from Jens Axboe:
    "I've got a few bits pending for 3.8 final, that I better get sent out.
    It's all been sitting for a while, I consider it safe.

    It contains:

    - Two bug fixes for mtip32xx, fixing a driver hang and a crash.

    - A few-liner protocol error fix for drbd.

    - A few fixes for the xen block front/back driver, fixing a potential
    data corruption issue.

    - A race fix for disk_clear_events(), causing spurious warnings. Out
    of the Chrome OS base.

    - A deadlock fix for disk_clear_events(), moving it to the a
    unfreezable workqueue. Also from the Chrome OS base."

    * 'for-linus' of git://git.kernel.dk/linux-block:
    drbd: fix potential protocol error and resulting disconnect/reconnect
    mtip32xx: fix for crash when the device surprise removed during rebuild
    mtip32xx: fix for driver hang after a command timeout
    block: prevent race/cleanup
    block: remove deadlock in disk_clear_events
    xen-blkfront: handle bvecs with partial data
    llist/xen-blkfront: implement safe version of llist_for_each_entry
    xen-blkback: implement safe iterator for the list of persistent grants

    Linus Torvalds
     
  • Adding new class/subclass/protocol combinations based on the GPLed
    out-of-tree Huawei driver. One of these has already appeared on a
    device labelled as "E320".

    Signed-off-by: Bjørn Mork
    Signed-off-by: David S. Miller

    Bjørn Mork