Skip to content
  1. Apr 09, 2015
  2. Apr 07, 2015
    • Al Viro's avatar
      ioctx_alloc(): fix vma (and file) leak on failure · deeb8525
      Al Viro authored
      
      
      If we fail past the aio_setup_ring(), we need to destroy the
      mapping.  We don't need to care about anybody having found ctx,
      or added requests to it, since the last failure exit is exactly
      the failure to make ctx visible to lookups.
      
      Reproducer (based on one by Joe Mario <jmario@redhat.com>):
      
      void count(char *p)
      {
      	char s[80];
      	printf("%s: ", p);
      	fflush(stdout);
      	sprintf(s, "/bin/cat /proc/%d/maps|/bin/fgrep -c '/[aio] (deleted)'", getpid());
      	system(s);
      }
      
      int main()
      {
      	io_context_t *ctx;
      	int created, limit, i, destroyed;
      	FILE *f;
      
      	count("before");
      	if ((f = fopen("/proc/sys/fs/aio-max-nr", "r")) == NULL)
      		perror("opening aio-max-nr");
      	else if (fscanf(f, "%d", &limit) != 1)
      		fprintf(stderr, "can't parse aio-max-nr\n");
      	else if ((ctx = calloc(limit, sizeof(io_context_t))) == NULL)
      		perror("allocating aio_context_t array");
      	else {
      		for (i = 0, created = 0; i < limit; i++) {
      			if (io_setup(1000, ctx + created) == 0)
      				created++;
      		}
      		for (i = 0, destroyed = 0; i < created; i++)
      			if (io_destroy(ctx[i]) == 0)
      				destroyed++;
      		printf("created %d, failed %d, destroyed %d\n",
      			created, limit - created, destroyed);
      		count("after");
      	}
      }
      
      Found-by: default avatarJoe Mario <jmario@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      deeb8525
    • Al Viro's avatar
      fix mremap() vs. ioctx_kill() race · b2edffdd
      Al Viro authored
      
      
      teach ->mremap() method to return an error and have it fail for
      aio mappings in process of being killed
      
      Note that in case of ->mremap() failure we need to undo move_page_tables()
      we'd already done; we could call ->mremap() first, but then the failure of
      move_page_tables() would require undoing whatever _successful_ ->mremap()
      has done, which would be a lot more headache in general.
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      b2edffdd
  3. Apr 03, 2015
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 8f778bbc
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "One drm core fix, one exynos regression fix, two sets of radeon fixes
        (Alex was a bit behind last week), and two i915 fixes.
      
        Nothing too serious we seem to have calmed down i915 since last week"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/radeon: fix wait in radeon_mn_invalidate_range_start
        drm/radeon: add extra check in radeon_ttm_tt_unpin_userptr
        drm: Exynos: Respect framebuffer pitch for FIMD/Mixer
        drm/i915: Reject the colorkey ioctls for primary and cursor planes
        drm/i915: Skip allocating shadow batch for 0-length batches
        drm/radeon: programm the VCE fw BAR as well
        drm/radeon: always dump the ring content if it's available
        radeon: Do not directly dereference pointers to BIOS area.
        drm/radeon/dpm: fix 120hz handling harder
        drm/edid: set ELD for firmware and debugfs override EDIDs
      8f778bbc
    • Linus Torvalds's avatar
      Merge tag 'irqchip-fixes-4.0-2' of git://git.infradead.org/users/jcooper/linux · 4e8a4830
      Linus Torvalds authored
      Pull irqchip fixes from Jason Cooper:
       "This is the second round of fixes for irqchip.  It contains some fixes
        found while the arm64 guys were writing the kvm gicv3 its emulation.
      
        GICv3 ITS:
          - Small batch of fixes discovered while writing the kvm ITS emulation"
      
      * tag 'irqchip-fixes-4.0-2' of git://git.infradead.org/users/jcooper/linux:
        irqchip: gicv3-its: Use non-cacheable accesses when no shareability
        irqchip: gicv3-its: Fix PROP/PEND and BASE/CBASE confusion
        irqchip: gicv3-its: Fix device ID encoding
        irqchip: gicv3-its: Fix encoding of collection's target redistributor
      4e8a4830
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 51b52fac
      Dave Airlie authored
      Just two small fixes for radeon, both destined for stable.
      
      * 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux:
        drm/radeon: fix wait in radeon_mn_invalidate_range_start
        drm/radeon: add extra check in radeon_ttm_tt_unpin_userptr
      51b52fac
    • Dave Airlie's avatar
      Merge branch 'exynos-drm-fixes' of... · 165b11bf
      Dave Airlie authored
      Merge branch 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes
      
      Fix display on issue to Exynos5250 based Snow(1366x768) board.
      
      * 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
        drm: Exynos: Respect framebuffer pitch for FIMD/Mixer
      165b11bf
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2015-04-02' of git://anongit.freedesktop.org/drm-intel into drm-fixes · 3fa50dc3
      Dave Airlie authored
      one oops fixes and a 0-length allocation fix from next backported.
      
      * tag 'drm-intel-fixes-2015-04-02' of git://anongit.freedesktop.org/drm-intel:
        drm/i915: Reject the colorkey ioctls for primary and cursor planes
        drm/i915: Skip allocating shadow batch for 0-length batches
      3fa50dc3
    • Dave Airlie's avatar
      Merge tag 'topic/drm-fixes-2015-04-02' of git://anongit.freedesktop.org/drm-intel into drm-fixes · c7d74874
      Dave Airlie authored
      Here's a single drm core fix, cc: stable, that affects i915
      users.
      
      * tag 'topic/drm-fixes-2015-04-02' of git://anongit.freedesktop.org/drm-intel:
        drm/edid: set ELD for firmware and debugfs override EDIDs
      c7d74874
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-4.0-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · b0838b15
      Linus Torvalds authored
      Pull xen regression fixes from David Vrabel:
       "Fix two regressions in the balloon driver's use of memory hotplug when
        used in a PV guest"
      
      * tag 'stable/for-linus-4.0-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/balloon: before adding hotplugged memory, set frames to invalid
        x86/xen: prepare p2m list for memory hotplug
      b0838b15
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.0-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux · 1d514333
      Linus Torvalds authored
      Pull powerpc fix from Michael Ellerman:
       "Fix memory corruption by pnv_alloc_idle_core_states"
      
      * tag 'powerpc-4.0-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
        powerpc: fix memory corruption by pnv_alloc_idle_core_states
      1d514333
    • Linus Torvalds's avatar
      Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband · 06459fc0
      Linus Torvalds authored
      Pull infiniband/rdma fix from Roland Dreier:
       "Fix for exploitable integer overflow in uverbs interface"
      
      * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
        IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic
      06459fc0
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · 0a481279
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "This time we have addition of caps for jz4740 which fixes intentional
        warning at boot.  Then we have memory leak issues in drivers using
        virt-dma by Peter on few drive"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: moxart-dma: Fix memory leak when stopping a running transfer
        dmaengine: bcm2835-dma: Fix memory leak when stopping a running transfer
        dmaengine: omap-dma: Fix memory leak when terminating running transfer
        dmaengine: edma: fix memory leak when terminating running transfers
        dmaengine: jz4740: Define capabilities
      0a481279
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 8172ba51
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix use-after-free with mac80211 RX A-MPDU reorder timer, from
          Johannes Berg.
      
       2) iwlwifi leaks memory every module load/unload cycles, fix from Larry
          Finger.
      
       3) Need to use for_each_netdev_safe() in rtnl_group_changelink()
          otherwise we can crash, from WANG Cong.
      
       4) mlx4 driver does register_netdev() too early in the probe sequence,
          from Ido Shamay.
      
       5) Don't allow router discovery hop limit to decrease the interface's
          hop limit, from D.S. Ljungmark.
      
       6) tx_packets and tx_bytes improperly accounted for certain classes of
          USB network devices, fix from Ben Hutchings.
      
       7) ip{6}mr_rules_init() mistakenly use plain kfree to release the ipmr
          tables in the error path, they must instead use ip{6}mr_free_table().
          Fix from WANG Cong.
      
       8) cxgb4 doesn't properly quiesce all RX activity before unregistering
          the netdevice.  Fix from Hariprasad Shenai.
      
       9) Fix hash corruptions in ipvlan driver, from Jiri Benc.
      
      10) nla_memcpy(), like a real memcpy, should fully initialize the
          destination buffer, even if the source attribute is smaller.  Fix
          from Jiri Benc.
      
      11) Fix wrong error code returned from iucv_sock_sendmsg().  We should
          use whatever sock_alloc_send_skb() put into 'err'.  From Eugene
          Crosser.
      
      12) Fix slab object leak on module unload in TIPC, from Ying Xue.
      
      13) Need a READ_ONCE() when reading the cached RX socket route in
          tcp_v{4,6}_early_demux().  From Michal Kubecek.
      
      14) Still too many problems with TPC support in the ath9k driver, so
          disable it for now.  From Felix Fietkau.
      
      15) When in AP mode the rtlwifi driver can leak DMA mappings, fix from
          Larry Finger.
      
      16) Missing kzalloc() failure check in gs_usb CAN driver, from Colin Ian
          King.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
        cxgb4: Fix to dump devlog, even if FW is crashed
        cxgb4: Firmware macro changes for fw verison 1.13.32.0
        bnx2x: Fix kdump when iommu=on
        bnx2x: Fix kdump on 4-port device
        mac80211: fix RX A-MPDU session reorder timer deletion
        MAINTAINERS: Update Intel Wired Ethernet Driver info
        tipc: fix a slab object leak
        net/usb/r8152: add device id for Lenovo TP USB 3.0 Ethernet
        af_iucv: fix AF_IUCV sendmsg() errno
        openvswitch: Return vport module ref before destruction
        netlink: pad nla_memcpy dest buffer with zeroes
        bonding: Bonding Overriding Configuration logic restored.
        ipvlan: fix check for IP addresses in control path
        ipvlan: do not use rcu operations for address list
        ipvlan: protect against concurrent link removal
        ipvlan: fix addr hash list corruption
        net: fec: setup right value for mdio hold time
        net: tcp6: fix double call of tcp_v6_fill_cb()
        cxgb4vf: Fix sparse warnings
        netns: don't clear nsid too early on removal
        ...
      8172ba51
    • Shachar Raindel's avatar
      IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic · 8494057a
      Shachar Raindel authored
      
      
      Properly verify that the resulting page aligned end address is larger
      than both the start address and the length of the memory area requested.
      
      Both the start and length arguments for ib_umem_get are controlled by
      the user. A misbehaving user can provide values which will cause an
      integer overflow when calculating the page aligned end address.
      
      This overflow can cause also miscalculation of the number of pages
      mapped, and additional logic issues.
      
      Addresses: CVE-2014-8159
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarShachar Raindel <raindel@mellanox.com>
      Signed-off-by: default avatarJack Morgenstein <jackm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      8494057a
  4. Apr 02, 2015
  5. Apr 01, 2015
    • Johannes Berg's avatar
      mac80211: fix RX A-MPDU session reorder timer deletion · 788211d8
      Johannes Berg authored
      
      
      There's an issue with the way the RX A-MPDU reorder timer is
      deleted that can cause a kernel crash like this:
      
       * tid_rx is removed - call_rcu(ieee80211_free_tid_rx)
       * station is destroyed
       * reorder timer fires before ieee80211_free_tid_rx() runs,
         accessing the station, thus potentially crashing due to
         the use-after-free
      
      The station deletion is protected by synchronize_net(), but
      that isn't enough -- ieee80211_free_tid_rx() need not have
      run when that returns (it deletes the timer.) We could use
      rcu_barrier() instead of synchronize_net(), but that's much
      more expensive.
      
      Instead, to fix this, add a field tracking that the session
      is being deleted. In this case, the only re-arming of the
      timer happens with the reorder spinlock held, so make that
      code not rearm it if the session is being deleted and also
      delete the timer after setting that field. This ensures the
      timer cannot fire after ___ieee80211_stop_rx_ba_session()
      returns, which fixes the problem.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      788211d8
    • Jeff Kirsher's avatar
      MAINTAINERS: Update Intel Wired Ethernet Driver info · 2f302324
      Jeff Kirsher authored
      
      
      Update the git tree info with a recent change in tree names.  Also
      add our new mailing list created solely for Linux kernel patches
      and kernel development, as well as the new patchwork project for
      tracking patches.  Lastly update the list of "reviewers" since a
      couple of developers have moved on to different projects.
      
      Made an update to the section header so that it is more manageable
      going forward as we add new drivers.
      
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      2f302324
    • Ying Xue's avatar
      tipc: fix a slab object leak · 7e436905
      Ying Xue authored
      When remove TIPC module, there is a warning to remind us that a slab
      object is leaked like:
      
      root@localhost:~# rmmod tipc
      [   19.056226] =============================================================================
      [   19.057549] BUG TIPC (Not tainted): Objects remaining in TIPC on kmem_cache_close()
      [   19.058736] -----------------------------------------------------------------------------
      [   19.058736]
      [   19.060287] INFO: Slab 0xffffea0000519a00 objects=23 used=1 fp=0xffff880014668b00 flags=0x100000000004080
      [   19.061915] INFO: Object 0xffff880014668000 @offset=0
      [   19.062717] kmem_cache_destroy TIPC: Slab cache still has objects
      
      This is because the listening socket of TIPC topology server is not
      closed before TIPC proto handler is unregistered with proto_unregister().
      However, as the socket is closed in tipc_exit_net() which is called by
      unregister_pernet_subsys() during unregistering TIPC namespace operation,
      the warning can be eliminated if calling unregister_pernet_subsys() is
      moved before calling proto_unregister().
      
      Fixes: e05b31f4
      
       ("tipc: make tipc socket support net namespace")
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e436905
    • Jan Stancek's avatar
      powerpc: fix memory corruption by pnv_alloc_idle_core_states · d52356e7
      Jan Stancek authored
      Space allocated for paca is based off nr_cpu_ids,
      but pnv_alloc_idle_core_states() iterates paca with
      cpu_nr_cores()*threads_per_core, which is using NR_CPUS.
      
      This causes pnv_alloc_idle_core_states() to write over memory,
      which is outside of paca array and may later lead to various panics.
      
      Fixes: 7cba160a
      
       (powernv/cpuidle: Redesign idle states management)
      Signed-off-by: default avatarJan Stancek <jstancek@redhat.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      d52356e7
    • Christian Hesse's avatar
      net/usb/r8152: add device id for Lenovo TP USB 3.0 Ethernet · 347eec34
      Christian Hesse authored
      
      
      This device is sold as 'Lenovo Tinkpad USB 3.0 Ethernet 4X90E51405'.
      Chipset is RTL8153 and works with r8152.
      
      Signed-off-by: default avatarChristian Hesse <mail@eworm.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      347eec34
    • Eugene Crosser's avatar
      af_iucv: fix AF_IUCV sendmsg() errno · ed4ac422
      Eugene Crosser authored
      
      
      When sending over AF_IUCV socket, errno was incorrectly set to
      ENOMEM even when other values where appropriate, notably EAGAIN.
      With this patch, error indicator returned by sock_alloc_send_skb()
      is passed to the caller, rather than being overwritten with ENOMEM.
      
      Signed-off-by: default avatarEugene Crosser <Eugene.Crosser@ru.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ed4ac422
    • Thomas Graf's avatar
      openvswitch: Return vport module ref before destruction · fa2d8ff4
      Thomas Graf authored
      Return module reference before invoking the respective vport
      ->destroy() function. This is needed as ovs_vport_del() is not
      invoked inside an RCU read side critical section so the kfree
      can occur immediately before returning to ovs_vport_del().
      
      Returning the module reference before ->destroy() is safe because
      the module unregistration is blocked on ovs_lock which we hold
      while destroying the datapath.
      
      Fixes: 62b9c8d0
      
       ("ovs: Turn vports with dependencies into separate modules")
      Reported-by: default avatarPravin Shelar <pshelar@nicira.com>
      Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
      Acked-by: default avatarPravin B Shelar <pshelar@nicira.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa2d8ff4
    • Jeff Layton's avatar
      sunrpc: make debugfs file creation failure non-fatal · f9c72d10
      Jeff Layton authored
      We currently have a problem that SELinux policy is being enforced when
      creating debugfs files. If a debugfs file is created as a side effect of
      doing some syscall, then that creation can fail if the SELinux policy
      for that process prevents it.
      
      This seems wrong. We don't do that for files under /proc, for instance,
      so Bruce has proposed a patch to fix that.
      
      While discussing that patch however, Greg K.H. stated:
      
          "No kernel code should care / fail if a debugfs function fails, so
           please fix up the sunrpc code first."
      
      This patch converts all of the sunrpc debugfs setup code to be void
      return functins, and the callers to not look for errors from those
      functions.
      
      This should allow rpc_clnt and rpc_xprt creation to work, even if the
      kernel fails to create debugfs files for some reason.
      
      Symptoms were failing krb5 mounts on systems using gss-proxy and
      selinux.
      
      Fixes: 388f0c77
      
       "sunrpc: add a debugfs rpc_xprt directory..."
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJeff Layton <jeff.layton@primarydata.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      f9c72d10