09 Aug, 2013

1 commit

  • This reverts commit 318df36e57c0ca9f2146660d41ff28e8650af423.

    This commit caused Steven Rostedt's hackbench runs to run out of memory
    due to a leak. As noted by Joonsoo Kim, it is buggy in the following
    scenario:

    "I guess, you may set 0 to all kmem caches's cpu_partial via sysfs,
    doesn't it?

    In this case, memory leak is possible in following case. Code flow of
    possible leak is follwing case.

    * in __slab_free()
    1. (!new.inuse || !prior) && !was_frozen
    2. !kmem_cache_debug && !prior
    3. new.frozen = 1
    4. after cmpxchg_double_slab, run the (!n) case with new.frozen=1
    5. with this patch, put_cpu_partial() doesn't do anything,
    because this cache's cpu_partial is 0
    6. return

    In step 5, leak occur"

    And Steven does indeed have cpu_partial set to 0 due to RT testing.

    Joonsoo is cooking up a patch, but everybody agrees that reverting this
    for now is the right thing to do.

    Reported-and-bisected-by: Steven Rostedt
    Acked-by: Joonsoo Kim
    Acked-by: Pekka Enberg
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

08 Aug, 2013

2 commits

  • …t/rostedt/linux-trace

    Pull tracing fixes from Steven Rostedt:
    "Oleg Nesterov has been working hard in closing all the holes that can
    lead to race conditions between deleting an event and accessing an
    event debugfs file. This included a fix to the debugfs system (acked
    by Greg Kroah-Hartman). We think that all the holes have been patched
    and hopefully we don't find more. I haven't marked all of them for
    stable because I need to examine them more to figure out how far back
    some of the changes need to go.

    Along the way, some other fixes have been made. Alexander Z Lam fixed
    some logic where the wrong buffer was being modifed.

    Andrew Vagin found a possible corruption for machines that actually
    allocate cpumask, as a reference to one was being zeroed out by
    mistake.

    Dhaval Giani found a bad prototype when tracing is not configured.

    And I not only had some changes to help Oleg, but also finally fixed a
    long standing bug that Dave Jones and others have been hitting, where
    a module unload and reload can cause the function tracing accounting
    to get screwed up"

    * tag 'trace-fixes-3.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing: Fix reset of time stamps during trace_clock changes
    tracing: Make TRACE_ITER_STOP_ON_FREE stop the correct buffer
    tracing: Fix trace_dump_stack() proto when CONFIG_TRACING is not set
    tracing: Fix fields of struct trace_iterator that are zeroed by mistake
    tracing/uprobes: Fail to unregister if probe event files are in use
    tracing/kprobes: Fail to unregister if probe event files are in use
    tracing: Add comment to describe special break case in probe_remove_event_call()
    tracing: trace_remove_event_call() should fail if call/file is in use
    debugfs: debugfs_remove_recursive() must not rely on list_empty(d_subdirs)
    ftrace: Check module functions being traced on reload
    ftrace: Consolidate some duplicate code for updating ftrace ops
    tracing: Change remove_event_file_dir() to clear "d_subdirs"->i_private
    tracing: Introduce remove_event_file_dir()
    tracing: Change f_start() to take event_mutex and verify i_private != NULL
    tracing: Change event_filter_read/write to verify i_private != NULL
    tracing: Change event_enable/disable_read() to verify i_private != NULL
    tracing: Turn event/id->i_private into call->event.type

    Linus Torvalds
     
  • Pull vfs fixes from Al Viro.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    vfs: add missing check for __O_TMPFILE in fcntl_init()
    fs: Allow unprivileged linkat(..., AT_EMPTY_PATH) aka flink
    fs: Fix file mode for O_TMPFILE
    reiserfs: fix deadlock in umount

    Linus Torvalds
     

07 Aug, 2013

9 commits

  • Pull libata fix from Tejun Heo:
    "Just the addition of MODULE_DEVICE_TABLE() for a platform driver"

    * 'for-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    pata_imx: expose module alias for loading from device-tree

    Linus Torvalds
     
  • Pull cgroup fix from Tejun Heo:
    "Fix for a minor memory leak bug in the cgroup init failure path"

    * 'for-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
    cgroup: fix a leak when percpu_ref_init() fails

    Linus Torvalds
     
  • Pull two workqueue fixes from Tejun Heo:
    "A lockdep notation update so that nested work_on_cpu() invocations
    don't lead to spurious lockdep warnings and fix for an unbound attr
    bug which made what's shown in sysfs deviate from the actual ones.
    Both patches have pretty limited scope"

    * 'for-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
    workqueue: copy workqueue_attrs with all fields
    workqueue: allow work_on_cpu() to be called recursively

    Linus Torvalds
     
  • Pull misc x86 fixes from Peter Anvin.

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, amd, microcode: Fix error path in apply_microcode_amd()
    x86, fpu: correct the asm constraints for fxsave, unbreak mxcsr.daz
    x86, efi: correct call to free_pages
    x86/iommu/vt-d: Expand interrupt remapping quirk to cover x58 chipset

    Linus Torvalds
     
  • Some of my configs I test with have CONFIG_A11Y_BRAILLE_CONSOLE set.
    When I started testing against v3.11-rc4 my console went bonkers. Using
    ktest to bisect the issue, it came down to:

    commit bbeddf52a "printk: move braille console support into separate
    braille.[ch] files"

    Looking into the patch I found the problem. It's with the return of
    braille_register_console(). As anything other than NULL is considered a
    failure.

    But for those of us that have CONFIG_A11Y_BRAILLE_CONSOLE set but do not
    define a "brl" or "brl=" on the command line, we still may want a
    console that those with sight can still use.

    Return NULL (success) if "brl" or "brl=" is not on the console line.

    Signed-off-by: Steven Rostedt
    Acked-by: Joe Perches
    Cc: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven Rostedt
     
  • This reverts commit fab840fc2d542fabcab903db8e03589a6702ba5f.

    This commit even has the test-case to prove that the tracee
    can be killed by SIGTRAP if the debugger does not remove the
    breakpoints before PTRACE_DETACH.

    However, this is exactly what wineserver deliberately does,
    set_thread_context() calls PTRACE_ATTACH + PTRACE_DETACH just
    for PTRACE_POKEUSER(DR*) in between.

    So we should revert this fix and document that PTRACE_DETACH
    should keep the breakpoints.

    Reported-by: Felipe Contreras
    Signed-off-by: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Pull MIPS fixes from Ralf Baechle:
    "Two platform-specific fixes plus a fix for oprofile which was calling
    smp_processor_id() in preemptible code"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
    MIPS: BMIPS: fix hardware interrupt routing for boot CPU != 0
    MIPS: oprofile: Fix BUG due to smp_processor_id() in preemptible code.
    MIPS: PNX833x: PNX8335_PCI_ETHERNET_INT depends on CONFIG_SOC_PNX8335

    Linus Torvalds
     
  • Pull s390 fixes from Martin Schwidefsky:
    "Enable LZ4 compression for the kernel image, add the machine id for
    the new zBC12 model, fix an issue with hanging dasd devices, correct a
    Kconfig dependency, fix a compile error in the perf module with
    CONFIG_KVM=n and fix the find_next_bit_left primitive for the PCI base
    layer"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390/dasd: fix hanging devices after path events
    s390/perf: fix compile error (undefined reference sie_exit)
    s390/bitops: fix find_next_bit_left
    s390: add support for IBM zBC12 machine
    s390/Kconfig: select 'TTY' when 'S390_GUEST' is enabled
    s390: add support for LZ4-compressed kernel

    Linus Torvalds
     
  • unshare_userns(new_cred) does *new_cred = prepare_creds() before
    create_user_ns() which can fail. However, the caller expects that
    it doesn't need to take care of new_cred if unshare_userns() fails.

    We could change the single caller, sys_unshare(), but I think it
    would be more clean to avoid the side effects on failure, so with
    this patch unshare_userns() does put_cred() itself and initializes
    *new_cred only if create_user_ns() succeeeds.

    Cc: stable@vger.kernel.org
    Signed-off-by: Oleg Nesterov
    Reviewed-by: Andy Lutomirski
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

05 Aug, 2013

12 commits

  • As comment in include/uapi/asm-generic/fcntl.h described, when
    introducing new O_* bits, we need to check its uniqueness in
    fcntl_init(). But __O_TMPFILE bit is missing. So fix it.

    Signed-off-by: Zheng Liu
    Signed-off-by: Al Viro

    Zheng Liu
     
  • Every now and then someone proposes a new flink syscall, and this spawns
    a long discussion of whether it would be a security problem. I think
    that this is missing the point: flink is *already* allowed without
    privilege as long as /proc is mounted -- it's called AT_SYMLINK_FOLLOW.

    Now that O_TMPFILE is here, the ability to create a file with O_TMPFILE,
    write it, and link it in is very convenient. The only problem is that
    it requires that /proc be mounted so that you can do:

    linkat(AT_FDCWD, "/proc/self/fd/", dfd, path, AT_SYMLINK_NOFOLLOW)

    This sucks -- it's much nicer to do:

    linkat(tmpfd, "", dfd, path, AT_EMPTY_PATH)

    Let's allow it.

    If this turns out to be excessively scary, it we could instead require
    that the inode in question be I_LINKABLE, but this seems pointless given
    the /proc situation

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Al Viro

    Andy Lutomirski
     
  • O_TMPFILE, like O_CREAT, should respect the requested mode and should
    create regular files.

    This fixes two bugs: O_TMPFILE required privilege (because the mode
    ended up as 000) and it produced bogus inodes with no type.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Al Viro

    Andy Lutomirski
     
  • Since remove_proc_entry() started to wait for IO in progress (i.e.
    since 2007 or so), the locking in fs/reiserfs/proc.c became wrong;
    if procfs read happens between the moment when umount() locks the
    victim superblock and removal of /proc/fs/reiserfs//*,
    we'll get a deadlock - read will wait for s_umount (in sget(),
    called by r_start()), while umount will wait in remove_proc_entry()
    for that read to finish, holding s_umount all along.

    Fortunately, the same change allows a much simpler race avoidance -
    all we need to do is remove the procfs entries in the very beginning
    of reiserfs ->kill_sb(); that'll guarantee that pointer to superblock
    will remain valid for the duration for procfs IO, so we don't need
    sget() to keep the sucker alive. As the matter of fact, we can
    get rid of the home-grown iterator completely, and use single_open()
    instead.

    Signed-off-by: Al Viro

    Al Viro
     
  • The hardware interrupt routing for boot CPU != 0 is wrong because it
    will route all the hardware interrupts to TP0 which is not the one we
    booted from. Fix this by properly checking which boot CPU we are booting
    from and updating the right interrupt mask for the boot CPU. This fixes
    booting on BCM3368 with bmips_smp_emabled = 0.

    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Cc: blogic@openwrt.org
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Patchwork: https://patchwork.linux-mips.org/patch/5650/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • current_cpu_type() is not preemption-safe.
    If CONFIG_PREEMPT is enabled then mipsxx_reg_setup() can be called from preemptible state.
    Added get_cpu()/put_cpu() pair to make it preemption-safe.

    This was found while testing oprofile with CONFIG_DEBUG_PREEMPT enable.

    /usr/zntestsuite # opcontrol --init
    /usr/zntestsuite # opcontrol --setup --event=L2_CACHE_ACCESSES:500 --event=L2_CACHE_MISSES:500 --no-vmlinux
    /usr/zntestsuite # opcontrol --start
    Using 2.6+ OProfile kernel interface.
    BUG: using smp_processor_id() in preemptible [00000000] code: oprofiled/1362
    caller is mipsxx_reg_setup+0x11c/0x164
    CPU: 0 PID: 1362 Comm: oprofiled Not tainted 3.10.4 #18
    Stack : 00000006 70757465 00000000 00000000 00000000 00000000 80b173f6 00000037
    80b10000 00000000 80b21614 88f5a220 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 89c49c00 89c49c2c 80721254 807b7927 8012c1d0
    80b10000 80721254 00000000 00000552 88f5a220 80b1335c 807b78e6 89c49ba8
    ...
    Call Trace:
    [] show_stack+0x64/0x7c
    [] dump_stack+0x20/0x2c
    [] debug_smp_processor_id+0xe0/0xf0
    [] mipsxx_reg_setup+0x11c/0x164
    [] op_mips_setup+0x24/0x4c
    [] oprofile_setup+0x5c/0x12c
    [] event_buffer_open+0x78/0xf8
    [] do_dentry_open.isra.15+0x2b8/0x3b0
    [] finish_open+0x28/0x4c
    [] do_last.isra.41+0x2cc/0xd00
    [] path_openat+0xb4/0x4c4
    [] do_filp_open+0x3c/0xac
    [] do_sys_open+0x110/0x1f4
    [] stack_done+0x20/0x44

    Bug reported and original patch by Jerin Jacob .

    Signed-off-by: Ralf Baechle
    Acked-by: Jerin Jacob

    Ralf Baechle
     
  • The PNX8335_PCI_ETHERNET_INT macro is defined in
    arch/mips/include/asm/mach-pnx833x/irq-mapping.h
    only if CONFIG_SOC_PNX8335 is selected.

    Fixes the following randconfig problem:
    arch/mips/pnx833x/common/platform.c:210:12:
    error: 'PNX8335_PIC_ETHERNET_INT' undeclared here
    (not in a function)

    Signed-off-by: Markos Chandras
    Acked-by: Steven J. Hill
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/5585/
    Signed-off-by: Ralf Baechle

    Markos Chandras
     
  • Linus Torvalds
     
  • Pull dmaengine fixes from Vinod Koul:
    "Two fixes for slave dmaengine. The first fixes cyclic dma transfers
    for pl330 and the second one makes us return the correct error code on
    probe"

    * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
    dma: pl330: Fix cyclic transfers
    pch_dma: fix error return code in pch_dma_probe()

    Linus Torvalds
     
  • Pull drm fix from Dave Airlie:
    "Just a quick fix that a few people have reported, be nice to have in
    asap"

    The drm tree seems to be very confused about 64-bit divides. Here it
    uses a slow 64-by-64 bit divide to divide by a small constant. Oh well.
    Doesn't look performance-critical, just stupid.

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/radeon: fix 64 bit divide in SI spm code

    Linus Torvalds
     
  • Commit 46a1c2c7ae53 ("vfs: export lseek_execute() to modules") broke the
    tmpfs SEEK_DATA/SEEK_HOLE implementation, because vfs_setpos() converts
    the carefully prepared -ENXIO to -EINVAL. Other filesystems avoid it in
    error cases: do the same in tmpfs.

    Signed-off-by: Hugh Dickins
    Cc: Jie Liu
    Cc: Al Viro
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Pull sound fixes from Takashi Iwai:
    "All small regression or small fixes, nothing surprising at this stage.

    - regression fix for intel Mac Mini quirk
    - compress ioctl error fix
    - ASoC fixes for control change notifications, some UI fixes,
    driver-specific fixes (resource leak, build errors, etc)"

    * tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: hda - Fix missing fixup for Mac Mini with STAC9221
    ASoC: wm0010: Fix resource leak
    ASoC: au1x: Fix build
    ASoC: bf5xx-ac97: Fix compile error with SND_BF5XX_HAVE_COLD_RESET
    ASoC: bfin-ac97: Fix prototype error following AC'97 refactoring
    ALSA: compress: fix the return value for SNDRV_COMPRESS_VERSION
    ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw,enum_virt}()

    Linus Torvalds
     

04 Aug, 2013

14 commits

  • Forgot to use the appropriate math64 function.

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • Pull networking fixes from David Miller:

    1) Don't ignore user initiated wireless regulatory settings on cards
    with custom regulatory domains, from Arik Nemtsov.

    2) Fix length check of bluetooth information responses, from Jaganath
    Kanakkassery.

    3) Fix misuse of PTR_ERR in btusb, from Adam Lee.

    4) Handle rfkill properly while iwlwifi devices are offline, from
    Emmanuel Grumbach.

    5) Fix r815x devices DMA'ing to stack buffers, from Hayes Wang.

    6) Kernel info leak in ATM packet scheduler, from Dan Carpenter.

    7) 8139cp doesn't check for DMA mapping errors, from Neil Horman.

    8) Fix bridge multicast code to not snoop when no querier exists,
    otherwise mutlicast traffic is lost. From Linus Lüssing.

    9) Avoid soft lockups in fib6_run_gc(), from Michal Kubecek.

    10) Fix races in automatic address asignment on ipv6, which can result
    in incorrect lifetime assignments. From Jiri Benc.

    11) Cure build bustage when CONFIG_NET_LL_RX_POLL is not set and rename
    it CONFIG_NET_RX_BUSY_POLL to eliminate the last reference to the
    original naming of this feature. From Cong Wang.

    12) Fix crash in TIPC when server socket creation fails, from Ying Xue.

    13) macvlan_changelink() silently succeeds when it shouldn't, from
    Michael S Tsirkin.

    14) HTB packet scheduler can crash due to sign extension, fix from
    Stephen Hemminger.

    15) With the cable unplugged, r8169 prints out a message every 10
    seconds, make it netif_dbg() instead of netif_warn(). From Peter
    Wu.

    16) Fix memory leak in rtm_to_ifaddr(), from Daniel Borkmann.

    17) sis900 gets spurious TX queue timeouts due to mismanagement of link
    carrier state, from Denis Kirjanov.

    18) Validate somaxconn sysctl to make sure it fits inside of a u16.
    From Roman Gushchin.

    19) Fix MAC address filtering on qlcnic, from Shahed Shaikh.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (68 commits)
    qlcnic: Fix for flash update failure on 83xx adapter
    qlcnic: Fix link speed and duplex display for 83xx adapter
    qlcnic: Fix link speed display for 82xx adapter
    qlcnic: Fix external loopback test.
    qlcnic: Removed adapter series name from warning messages.
    qlcnic: Free up memory in error path.
    qlcnic: Fix ingress MAC learning
    qlcnic: Fix MAC address filter issue on 82xx adapter
    net: ethernet: davinci_emac: drop IRQF_DISABLED
    netlabel: use domain based selectors when address based selectors are not available
    net: check net.core.somaxconn sysctl values
    sis900: Fix the tx queue timeout issue
    net: rtm_to_ifaddr: free ifa if ifa_cacheinfo processing fails
    r8169: remove "PHY reset until link up" log spam
    net: ethernet: cpsw: drop IRQF_DISABLED
    htb: fix sign extension bug
    macvlan: handle set_promiscuity failures
    macvlan: better mode validation
    tipc: fix oops when creating server socket fails
    net: rename CONFIG_NET_LL_RX_POLL to CONFIG_NET_RX_BUSY_POLL
    ...

    Linus Torvalds
     
  • Flash update routine was improperly checking register read API return value.
    Modify register read API and perform proper error check.

    Signed-off-by: Himanshu Madhani
    Signed-off-by: David S. Miller

    Himanshu Madhani
     
  • o Set link speed and duplex to unknown when link is not up.

    Signed-off-by: Rajesh Borundia
    Signed-off-by: Shahed Shaikh
    Signed-off-by: David S. Miller

    Rajesh Borundia
     
  • o Do not obtain link speed from register when adapter
    link is down.

    Signed-off-by: Rajesh Borundia
    Signed-off-by: Shahed Shaikh
    Signed-off-by: David S. Miller

    Rajesh Borundia
     
  • Driver was not handling external loopback diagnostic
    test request.

    Signed-off-by: Shahed Shaikh
    Signed-off-by: David S. Miller

    Shahed Shaikh
     
  • Signed-off-by: Pratik Pujar
    Signed-off-by: Shahed Shaikh
    Signed-off-by: David S. Miller

    Pratik Pujar
     
  • Signed-off-by: Himanshu Madhani
    Signed-off-by: Shahed Shaikh
    Signed-off-by: David S. Miller

    Himanshu Madhani
     
  • o Delete MAC address from the adapter's filter table
    if the source MAC address of ingress packet matches.

    Signed-off-by: Shahed Shaikh
    Signed-off-by: David S. Miller

    Shahed Shaikh
     
  • Driver was passing the address of a pointer instead of
    the pointer itself.

    Signed-off-by: Shahed Shaikh
    Signed-off-by: David S. Miller

    Shahed Shaikh
     
  • IRQF_DISABLED is a no-op by now and should be removed.

    Signed-off-by: Mugunthan V N
    Signed-off-by: David S. Miller

    Mugunthan V N
     
  • Pull nfsd bugfixes from Bruce Fields:
    "Most of this is due to a screwup on my part -- some gss-proxy crashes
    got fixed before the merge window but somehow never made it out of a
    temporary git repo on my laptop...."

    * 'for-3.11' of git://linux-nfs.org/~bfields/linux:
    svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall
    svcrpc: fix kfree oops in gss-proxy code
    svcrpc: fix gss-proxy xdr decoding oops
    svcrpc: fix gss_rpc_upcall create error
    NFSD/sunrpc: avoid deadlock on TCP connection due to memory pressure.

    Linus Torvalds
     
  • Pull hwmon fix from Guenter Roeck:
    "Fix chip initialization/configuration in MAX6697 driver"

    * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
    hwmon: (max6697) fix MAX6581 ideality

    Linus Torvalds
     
  • Pull arm fixes fixes from Russell King:
    "This fixes a couple of problems with commit 48be69a026b2 ("ARM: move
    signal handlers into a vdso-like page"), one of which was originally
    discovered via my testing originally, but the fix for it was never
    actually committed.

    The other shows up on noMMU builds, and such platforms are extremely
    rare and as such are not part of my nightly testing"

    * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
    ARM: fix nommu builds with 48be69a02 (ARM: move signal handlers into a vdso-like page)
    ARM: fix a cockup in 48be69a02 (ARM: move signal handlers into a vdso-like page)

    Linus Torvalds
     

03 Aug, 2013

2 commits