02 Sep, 2013

2 commits

  • For performance reasons, when SMAP is in use, SMAP is left open for an
    entire put_user_try { ... } put_user_catch(); block, however, calling
    __put_user() in the middle of that block will close SMAP as the
    STAC..CLAC constructs intentionally do not nest.

    Furthermore, using __put_user() rather than put_user_ex() here is bad
    for performance.

    Thus, introduce new [compat_]save_altstack_ex() helpers that replace
    __[compat_]save_altstack() for x86, being currently the only
    architecture which supports put_user_try { ... } put_user_catch().

    Reported-by: H. Peter Anvin
    Signed-off-by: Al Viro
    Signed-off-by: H. Peter Anvin
    Cc: # v3.8+
    Link: http://lkml.kernel.org/n/tip-es5p6y64if71k8p5u08agv9n@git.kernel.org

    Al Viro
     
  • Add SMAP annotations to csum_partial_copy_to/from_user(). These
    functions legitimately access user space and thus need to set the AC
    flag.

    TODO: add explicit checks that the side with the kernel space pointer
    really points into kernel space.

    Signed-off-by: H. Peter Anvin
    Link: http://lkml.kernel.org/n/tip-2aps0u00eer658fd5xyanan7@git.kernel.org
    Cc: # v3.7+

    H. Peter Anvin
     

26 Aug, 2013

5 commits


25 Aug, 2013

8 commits

  • Pull ACPI fix from Rafael Wysocki:
    "I really hoped that it wouldn't be necessary to change anything in
    ACPI at this point, but it turns out that we need to revert one more
    ACPI video commit causing trouble.

    This reverts a change in the ACPI video driver that caused the ACPI
    backlight initialization to be carried out even if acpi_backlight=vendor
    is passed in the kernel command line which turns out to break things
    at least on one system"

    * tag 'acpi-3.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    Revert "ACPI / video: Always call acpi_video_init_brightness() on init"

    Linus Torvalds
     
  • Pull SCSI fixes from James Bottomley:
    "This is a set of small bug fixes for lpfc and zfcp and a fix for a
    fairly nasty bug in sg where a process which cancels I/O completes in
    a kernel thread which would then try to write back to the now gone
    userspace and end up writing to a random kernel address instead"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    [SCSI] zfcp: remove access control tables interface (keep sysfs files)
    [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops
    [SCSI] zfcp: fix lock imbalance by reworking request queue locking
    [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal
    [SCSI] lpfc: Don't force CONFIG_GENERIC_CSUM on

    Linus Torvalds
     
  • For a search buffer, 2 byte aligned, strchr() was returning pointer
    outside of buffer (buf - 1)

    ------------->8----------------
    // Input buffer (default 4 byte aigned)
    char *buffer = "1AA_";

    // actual search start (to mimick 2 byte alignment)
    char *current_line = &(buffer[2]);

    // Character to search for
    char c = 'A';

    char *c_pos = strchr(current_line, c);

    printf("%s\n", c_pos) --> 'AA_' as oppose to 'A_'
    ------------->8----------------

    Reported-by: Anton Kolesov
    Debugged-by: Anton Kolesov
    Cc: # [3.9 and 3.10]
    Cc: Noam Camus
    Signed-off-by: Joern Rennecke
    Signed-off-by: Vineet Gupta
    Signed-off-by: Linus Torvalds

    Joern Rennecke
     
  • This should actually be returning an ERR_PTR on error instead of NULL.
    That was how it was designed and all the callers expect it.

    [AV: actually, that's what "VFS: Make clone_mnt()/copy_tree()/collect_mounts()
    return errors" missed - originally collect_mounts() was expected to return
    NULL on failure]

    Cc: # 3.10+
    Signed-off-by: Dan Carpenter
    Signed-off-by: Al Viro

    Dan Carpenter
     
  • iget_locked() returns a NULL on error, it doesn't return an ERR_PTR.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Al Viro

    Dan Carpenter
     
  • The iget_locked() function returns NULL on error and never an ERR_PTR.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Al Viro

    Dan Carpenter
     
  • proc_readfd_common() does dir_emit_dots() twice in a row,
    we need to do this only once.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Al Viro

    Oleg Nesterov
     
  • dynamic_dname() is both too much and too little for those - the
    output may be well in excess of 64 bytes dynamic_dname() assumes
    to be enough (thanks to ashmem feeding really long names to
    shmem_file_setup()) and vsnprintf() is an overkill for those
    guys.

    Signed-off-by: Al Viro

    Al Viro
     

24 Aug, 2013

13 commits

  • Pull libata fixes from Tejun Heo:
    "This contains three commits all of which are updates for specific
    devices which aren't too widespread. Pretty limited scope and nothing
    too interesting or dangerous"

    * 'for-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    sata_fsl: save irqs while coalescing
    libata: apply behavioral quirks to sil3826 PMP
    sata, highbank: fix ordering of SGPIO signals

    Linus Torvalds
     
  • Pull cgroup fix from Tejun Heo:
    "A late fix for cgroup.

    This fixes a behavior regression visible to userland which was created
    by a commit merged during -rc1. While the behavior change isn't too
    likely to be noticeable, the fix is relatively low risk and we'll need
    to backport it through -stable anyway if the bug gets released"

    * 'for-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
    cpuset: fix a regression in validating config change

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "Ben was on holidays for a week so a few nouveau regression fixes
    backed up, but they all seem necessary.

    Otherwise one i915 and one gma500 fix"

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    gma500: Fix SDVO turning off randomly
    drm/nv04/disp: fix framebuffer pin refcounting
    drm/nouveau/mc: fix race condition between constructor and request_irq()
    drm/nouveau: fix reclocking on nv40
    drm/nouveau/ltcg: fix allocating memory as free
    drm/nouveau/ltcg: fix ltcg memory initialization after suspend
    drm/nouveau/fb: fix null derefs in nv49 and nv4e init
    drm/i915: Invalidate TLBs for the rings after a reset

    Linus Torvalds
     
  • Commit 94ae9843 (usb: phy: rename all phy drivers to phy-$name-usb.c)
    renamed drivers/usb/phy/otg_fsm.h to drivers/usb/phy/phy-fsm-usb.h
    but changed drivers/usb/phy/phy-fsm-usb.c to include not existing
    "phy-otg-fsm.h" instead of new "phy-fsm-usb.h". This breaks building:
    ...
    drivers/usb/phy/phy-fsm-usb.c:32:25: fatal error: phy-otg-fsm.h: No such file or directory
    compilation terminated.
    make[3]: *** [drivers/usb/phy/phy-fsm-usb.o] Error 1

    This commit also missed to modify drivers/usb/phy/phy-fsl-usb.h
    to include new "phy-fsm-usb.h" instead of "otg_fsm.h" resulting
    in another build breakage:
    ...
    In file included from drivers/usb/phy/phy-fsl-usb.c:46:0:
    drivers/usb/phy/phy-fsl-usb.h:18:21: fatal error: otg_fsm.h: No such file or directory
    compilation terminated.
    make[3]: *** [drivers/usb/phy/phy-fsl-usb.o] Error 1

    Fix both issues.

    Signed-off-by: Anatolij Gustschin
    Cc: stable # 3.10+
    Signed-off-by: Greg Kroah-Hartman

    Anatolij Gustschin
     
  • Commit c1117afb8589 (USB: OHCI: make ohci-pci a separate driver)
    neglected to preserve the entries for the pci_suspend and pci_resume
    driver callbacks. As a result, OHCI controllers don't work properly
    during suspend and after hibernation.

    This patch adds the missing callbacks to the driver.

    Signed-off-by: Alan Stern
    Reported-and-tested-by: Steve Cotton
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Commit dcd7b8bd63cb81c5b973bf86510ca3c80bbbd162 ("staging: comedi: put
    module _after_ detach" by myself) reversed a couple of calls in
    `comedi_device_attach()` when recovering from an error returned by the
    low-level driver's 'attach' handler. Unfortunately, that introduced a
    NULL pointer dereference bug as `dev->driver` is NULL after the call to
    `comedi_device_detach()`. We still have a pointer to the low-level
    comedi driver structure in the `driv` variable, so use that instead.

    Signed-off-by: Ian Abbott
    Cc: # 3.10+
    Signed-off-by: Greg Kroah-Hartman

    Ian Abbott
     
  • Merge networking fixes from David Miller:

    1) Revert Johannes Berg's genetlink locking fix, because it causes
    regressions.

    Johannes and Pravin Shelar are working on fixing things properly.

    2) Do not drop ipv6 ICMP messages without a redirected header option,
    they are legal. From Duan Jiong.

    3) Missing error return propagation in probing of via-ircc driver.
    From Alexey Khoroshilov.

    4) Do not clear out broadcast/multicast/unicast/WOL bits in r8169 when
    initializing, from Peter Wu.

    5) realtek phy driver programs wrong interrupt status bit, from
    Giuseppe CAVALLARO.

    6) Fix statistics regression in AF_PACKET code, from Willem de Bruijn.

    7) Bridge code uses wrong bitmap length, from Toshiaki Makita.

    8) SFC driver uses wrong indexes to look up MAC filters, from Ben
    Hutchings.

    9) Don't pass stack buffers into usb control operations in hso driver,
    from Daniel Gimpelevich.

    10) Multiple ipv6 fragmentation headers in one packet is illegal and
    such packets should be dropped, from Hannes Frederic Sowa.

    11) When TCP sockets are "repaired" as part of checkpoint/restart, the
    timestamp field of SKBs need to be refreshed otherwise RTOs can be
    wildly off. From Andrey Vagin.

    12) Fix memcpy args (uses 'address of pointer' instead of 'pointer') in
    hostp driver. From Dan Carpenter.

    13) nl80211hdr_put() doesn't return an ERR_PTR, but some code believes
    it does. From Dan Carpenter.

    14) Fix regression in wireless SME disconnects, from Johannes Berg.

    15) Don't use a stack buffer for DMA in zd1201 USB wireless driver, from
    Jussi Kivilinna.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
    ipv4: expose IPV4_DEVCONF
    ipv6: handle Redirect ICMP Message with no Redirected Header option
    be2net: fix disabling TX in be_close()
    Revert "genetlink: fix family dump race"
    hso: Fix stack corruption on some architectures
    hso: Earlier catch of error condition
    sfc: Fix lookup of default RX MAC filters when steered using ethtool
    bridge: Use the correct bit length for bitmap functions in the VLAN code
    packet: restore packet statistics tp_packets to include drops
    net: phy: rtl8211: fix interrupt on status link change
    r8169: remember WOL preferences on driver load
    via-ircc: don't return zero if via_ircc_open() failed
    macvtap: Ignore tap features when VNET_HDR is off
    macvtap: Correctly set tap features when IFF_VNET_HDR is disabled.
    macvtap: simplify usage of tap_features
    tcp: set timestamps for restored skb-s
    bnx2x: set VF DMAE when first function has 0 supported VFs
    bnx2x: Protect against VFs' ndos when SR-IOV is disabled
    bnx2x: prevent VF benign attentions
    bnx2x: Consider DCBX remote error
    ...

    Linus Torvalds
     
  • Merge fixes from Andrew Morton:
    "A few fixes. One is a licensing change and I don't do licensing, so
    please eyeball that one"

    Licensing eye-balled.

    * emailed patches from Andrew Morton :
    lib/lz4: correct the LZ4 license
    memcg: get rid of swapaccount leftovers
    nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection
    nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error
    drivers/platform/olpc/olpc-ec.c: initialise earlier

    Linus Torvalds
     
  • The LZ4 code is listed as using the "BSD 2-Clause License".

    Signed-off-by: Richard Laager
    Acked-by: Kyungsik Lee
    Cc: Chanho Min
    Cc: Richard Yao
    Signed-off-by: Andrew Morton
    [ The 2-clause BSD can be just converted into GPL, but that's rude and
    pointless, so don't do it - Linus ]
    Signed-off-by: Linus Torvalds

    Richard Laager
     
  • The swapaccount kernel parameter without any values has been removed by
    commit a2c8990aed5a ("memsw: remove noswapaccount kernel parameter") but
    it seems that we didn't get rid of all the left overs.

    Make sure that menuconfig help text and kernel-parameters.txt are clear
    about value for the paramter and remove the stalled comment which is not
    very much useful on its own.

    Signed-off-by: Michal Hocko
    Reported-by: Gergely Risko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     
  • Fix the issue with improper counting number of flying bio requests for
    BIO_EOPNOTSUPP error detection case.

    The sb_nbio must be incremented exactly the same number of times as
    complete() function was called (or will be called) because
    nilfs_segbuf_wait() will call wail_for_completion() for the number of
    times set to sb_nbio:

    do {
    wait_for_completion(&segbuf->sb_bio_event);
    } while (--segbuf->sb_nbio > 0);

    Two functions complete() and wait_for_completion() must be called the
    same number of times for the same sb_bio_event. Otherwise,
    wait_for_completion() will hang or leak.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Dan Carpenter
    Acked-by: Ryusuke Konishi
    Tested-by: Ryusuke Konishi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • Remove double call of bio_put() in nilfs_end_bio_write() for the case of
    BIO_EOPNOTSUPP error detection. The issue was found by Dan Carpenter
    and he suggests first version of the fix too.

    Signed-off-by: Vyacheslav Dubeyko
    Reported-by: Dan Carpenter
    Acked-by: Ryusuke Konishi
    Tested-by: Ryusuke Konishi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • Being a low-level component, various drivers (e.g. olpc-battery) assume
    that it is ok to communicate with the OLPC Embedded Controller during
    probe. Therefore the OLPC EC driver must be initialised before other
    drivers try to use it. This was the case until it was recently moved
    out of arch/x86 and restructured around commits ac2504151f5a ("Platform:
    OLPC: turn EC driver into a platform_driver") and 85f90cf6ca56 ("x86:
    OLPC: switch over to using new EC driver on x86").

    Use arch_initcall so that olpc-ec is readied earlier, matching the
    previous behaviour.

    Fixes a regression introduced in Linux-3.6 where various drivers such as
    olpc-battery and olpc-xo1-sci failed to load due to an inability to
    communicate with the EC. The user-visible effect was a lack of battery
    monitoring, missing ebook/lid switch input devices, etc.

    Signed-off-by: Daniel Drake
    Cc: Andres Salomon
    Cc: Paul Fox
    Cc: Thomas Gleixner
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Drake
     

23 Aug, 2013

12 commits

  • …rm-intel into drm-fixes

    Just one patch that soaked for quite a bit to fix a resume issue,
    resulting in gpu hangs (or worse) due to tlb containing garbage.

    * tag 'drm-intel-fixes-2013-08-23' of git://people.freedesktop.org/~danvet/drm-intel:
    drm/i915: Invalidate TLBs for the rings after a reset

    Dave Airlie
     
  • IP sends device configuration (see inet_fill_link_af) as an array
    in the netlink information, but the indices in that array are not
    exposed to userspace through any current santized header file.

    It was available back in 2.6.32 (in /usr/include/linux/sysctl.h)
    but was broken by:
    commit 02291680ffba92e5b5865bc0c5e7d1f3056b80ec
    Author: Eric W. Biederman
    Date: Sun Feb 14 03:25:51 2010 +0000

    net ipv4: Decouple ipv4 interface parameters from binary sysctl numbers

    Eric was solving the sysctl problem but then the indices were re-exposed
    by a later addition of devconf support for IPV4

    commit 9f0f7272ac9506f4c8c05cc597b7e376b0b9f3e4
    Author: Thomas Graf
    Date: Tue Nov 16 04:32:48 2010 +0000

    ipv4: AF_INET link address family

    Putting them in /usr/include/linux/ip.h seemed the logical match
    for the DEVCONF_ definitions for IPV6 in /usr/include/linux/ip6.h

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • rfc 4861 says the Redirected Header option is optional, so
    the kernel should not drop the Redirect Message that has no
    Redirected Header option. In this patch, the function
    ip6_redirect_no_header() is introduced to deal with that
    condition.

    Signed-off-by: Duan Jiong
    Acked-by: Hannes Frederic Sowa

    Duan Jiong
     
  • commit fba875591 ("disable TX in be_close()") disabled TX in be_close()
    to protect be_xmit() from touching freed up queues in the AER recovery
    flow. But, TX must be disabled *before* cleaning up TX completions in
    the close() path, not after. This allows be_tx_compl_clean() to free up
    all TX-req skbs that were notified to the HW.

    Signed-off-by: Sathya Perla
    Signed-off-by: David S. Miller

    Sathya Perla
     
  • Revert commit c04c697 (ACPI / video: Always call acpi_video_init_brightness()
    on init), because it breaks eDP backlight at 1920x1080 on Acer Aspire S3
    for Trevor Bortins.

    References: https://bugs.freedesktop.org/show_bug.cgi?id=68355
    Reported-and-bisected-by: Trevor Bortins
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Merge in a fix for RX MAC address filter programming bug in the sfc
    driver.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This reverts commit 58ad436fcf49810aa006016107f494c9ac9013db.

    It turns out that the change introduced a potential deadlock
    by causing a locking dependency with netlink's cb_mutex. I
    can't seem to find a way to resolve this without doing major
    changes to the locking, so revert this.

    Signed-off-by: Johannes Berg
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • Pull x86 platform driver fixes from Matthew Garrett:
    "Three trivial fixes - the first reverts a patch that's broken some
    other devices (again - I'm trying to figure out a clean way to
    implement this), the other two fix minor issues in the sony-laptop
    driver"

    * 'linux-next' of git://cavan.codon.org.uk/platform-drivers-x86:
    Revert "hp-wmi: Enable hotkeys on some systems"
    sony-laptop: Fix reporting of gfx_switch_status
    sony-laptop: return a negative error code in sonypi_compat_init()

    Linus Torvalds
     
  • Pull ARM SoC fixes from Olof Johansson:
    "A handful of fixes for 3.11 are still trickling in. These are:
    - A couple of fixes for older OMAP platforms
    - Another few fixes for at91 (lateish due to European summer
    vacations)
    - A late-found problem with USB on Tegra, fix is to keep VBUS
    regulator on at all times
    - One fix for Exynos 5440 dealing with CPU detection
    - One MAINTAINERS update"

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: tegra: always enable USB VBUS regulators
    ARM: davinci: nand: specify ecc strength
    ARM: OMAP: rx51: change musb mode to OTG
    ARM: OMAP2: fix musb usage for n8x0
    MAINTAINERS: Update email address for Benoit Cousson
    ARM: at91/DT: fix at91sam9n12ek memory node
    ARM: at91: add missing uart clocks DT entries
    ARM: SAMSUNG: fix to support for missing cpu specific map_io
    ARM: at91/DT: at91sam9x5ek: fix USB host property to enable port C

    Linus Torvalds
     
  • Pull device tree fix from Rob Herring:
    "For DT unflattening, add missing memory initialization.

    This is needed for arches like PPC that use memblock_alloc. This
    appears to have been an issue for some time, but is a somewhat limited
    usecase of OF_DYNAMIC"

    * tag 'devicetree-fixes-for-3.11' of git://sources.calxeda.com/kernel/linux:
    of: fdt: fix memory initialization for expanded DT

    Linus Torvalds
     
  • Pull device mapper fix from Mike Snitzer:
    "A patch to fix dm-cache-policy-mq's remove_mapping() conflict with
    sparc32"

    * tag 'dm-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm cache: avoid conflicting remove_mapping() in mq policy

    Linus Torvalds
     
  • This is the updated version of df54d6fa5427 ("x86 get_unmapped_area():
    use proper mmap base for bottom-up direction") that only randomizes the
    mmap base address once.

    Signed-off-by: Radu Caragea
    Reported-and-tested-by: Jeff Shorey
    Cc: Andrew Morton
    Cc: Michel Lespinasse
    Cc: Oleg Nesterov
    Cc: Rik van Riel
    Cc: Ingo Molnar
    Cc: Adrian Sendroiu
    Cc: Greg KH
    Cc: Kamal Mostafa
    Signed-off-by: Linus Torvalds

    Radu Caragea