1. 26 Jun, 2014 7 commits
    • Al Viro's avatar
      Fix 32-bit regression in block device read(2) · 0b86dbf6
      Al Viro authored
      blkdev_read_iter() wants to cap the iov_iter by the amount of data
      remaining to the end of device.  That's what iov_iter_truncate() is for
      (trim iter->count if it's above the given limit).  So far, so good, but
      the argument of iov_iter_truncate() is size_t, so on 32bit boxen (in
      case of a large device) we end up with that upper limit truncated down
      to 32 bits *before* comparing it with iter->count.
      
      Easily fixed by making iov_iter_truncate() take 64bit argument - it does
      the right thing after such change (we only reach the assignment in there
      when the current value of iter->count is greater than the limit, i.e.
      for anything that would get truncated we don't reach the assignment at
      all) and that argument is not the new value of iter->count - it's an
      upper limit for such.
      
      The overhead of passing u64 is not an issue - the thing is inlined, so
      callers passing size_t won't pay any penalty.
      Reported-and-tested-by: default avatarTheodore Tso <tytso@mit.edu>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarAlan Cox <gnomes@lxorguk.ukuu.org.uk>
      Tested-by: default avatarBruno Wolff III <bruno@wolff.to>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0b86dbf6
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6 · d7933ab7
      Linus Torvalds authored
      Pull CIFS fixes from Steve French:
       "Small set of misc cifs/smb3 fixes"
      
      * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
        [CIFS] fix mount failure with broken pathnames when smb3 mount with mapchars option
        cifs: revalidate mapping prior to satisfying read_iter request with cache=loose
        fs/cifs: fix regression in cifs_create_mf_symlink()
      d7933ab7
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 2a80ff86
      Linus Torvalds authored
      Pull hwmon fixes from Guenter Roeck:
       "Various minor fixes"
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (gpio-fan) Change name used in hwmon_device_register_with_groups
        hwmon: (emc1403) Fix missing 'select REGMAP_I2C' in Kconfig
        hwmon: (ntc_thermistor) Use the manufacturer name properly
        devicetree: bindings: Document murata vendor prefix
        hwmon: (w83l786ng) Report correct minimum fan speed
      2a80ff86
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · f40ede39
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix crash in ipvs tot_stats estimator, from Julian Anastasov.
      
       2) Fix OOPS in nf_nat on netns removal, from Florian Westphal.
      
       3) Really really really fix locking issues in slip and slcan tty write
          wakeups, from Tyler Hall.
      
       4) Fix checksum offloading in fec driver, from Fugang Duan.
      
       5) Off by one in BPF instruction limit test, from Kees Cook.
      
       6) Need to clear all TSO capability flags when doing software TSO in
          tg3 driver, from Prashant Sreedharan.
      
       7) Fix memory leak in vlan_reorder_header() error path, from Li
          RongQing.
      
       8) Fix various bugs in xen-netfront and xen-netback multiqueue support,
          from David Vrabel and Wei Liu.
      
       9) Fix deadlock in cxgb4 driver, from Li RongQing.
      
      10) Prevent double free of no-cache DST entries, from Eric Dumazet.
      
      11) Bad csum_start handling in skb_segment() leads to crashes when
          forwarding, from Tom Herbert.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (76 commits)
        net: fix setting csum_start in skb_segment()
        ipv4: fix dst race in sk_dst_get()
        net: filter: Use kcalloc/kmalloc_array to allocate arrays
        trivial: net: filter: Change kerneldoc parameter order
        trivial: net: filter: Fix typo in comment
        net: allwinner: emac: Add missing free_irq
        cxgb4: use dev_port to identify ports
        xen-netback: bookkeep number of active queues in our own module
        tg3: Change nvram command timeout value to 50ms
        cxgb4: Not need to hold the adap_rcu_lock lock when read adap_rcu_list
        be2net: fix qnq mode detection on VFs
        of: mdio: fixup of_phy_register_fixed_link parsing of new bindings
        at86rf230: fix irq setup
        net: phy: at803x: fix coccinelle warnings
        net/mlx4_core: Fix the error flow when probing with invalid VF configuration
        tulip: Poll link status more frequently for Comet chips
        net: huawei_cdc_ncm: increase command buffer size
        drivers: net: cpsw: fix dual EMAC stall when connected to same switch
        xen-netfront: recreate queues correctly when reconnecting
        xen-netfront: fix oops when disconnected from backend
        ...
      f40ede39
    • Tom Herbert's avatar
      net: fix setting csum_start in skb_segment() · de843723
      Tom Herbert authored
      Dave Jones reported that a crash is occurring in
      
      csum_partial
      tcp_gso_segment
      inet_gso_segment
      ? update_dl_migration
      skb_mac_gso_segment
      __skb_gso_segment
      dev_hard_start_xmit
      sch_direct_xmit
      __dev_queue_xmit
      ? dev_hard_start_xmit
      dev_queue_xmit
      ip_finish_output
      ? ip_output
      ip_output
      ip_forward_finish
      ip_forward
      ip_rcv_finish
      ip_rcv
      __netif_receive_skb_core
      ? __netif_receive_skb_core
      ? trace_hardirqs_on
      __netif_receive_skb
      netif_receive_skb_internal
      napi_gro_complete
      ? napi_gro_complete
      dev_gro_receive
      ? dev_gro_receive
      napi_gro_receive
      
      It looks like a likely culprit is that SKB_GSO_CB()->csum_start is
      not set correctly when doing non-scatter gather. We are using
      offset as opposed to doffset.
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Tested-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Fixes: 7e2b10c1 ("net: Support for multiple checksums with gso")
      Acked-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de843723
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-3.16-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · ec71feae
      Linus Torvalds authored
      Pull NFS client fixes from Trond Myklebust:
       "Highlights include:
      
         - Stable fix for a data corruption case due to incorrect cache
           validation
         - Fix a couple of false positive cache invalidations
         - Fix NFSv4 security negotiation issues"
      
      * tag 'nfs-for-3.16-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: test SECINFO RPC_AUTH_GSS pseudoflavors for support
        NFS Return -EPERM if no supported or matching SECINFO flavor
        NFS check the return of nfs4_negotiate_security in nfs4_submount
        NFS: Don't mark the data cache as invalid if it has been flushed
        NFS: Clear NFS_INO_REVAL_PAGECACHE when we update the file size
        nfs: Fix cache_validity check in nfs_write_pageuptodate()
      ec71feae
    • Eric Dumazet's avatar
      ipv4: fix dst race in sk_dst_get() · f8864972
      Eric Dumazet authored
      When IP route cache had been removed in linux-3.6, we broke assumption
      that dst entries were all freed after rcu grace period. DST_NOCACHE
      dst were supposed to be freed from dst_release(). But it appears
      we want to keep such dst around, either in UDP sockets or tunnels.
      
      In sk_dst_get() we need to make sure dst refcount is not 0
      before incrementing it, or else we might end up freeing a dst
      twice.
      
      DST_NOCACHE set on a dst does not mean this dst can not be attached
      to a socket or a tunnel.
      
      Then, before actual freeing, we need to observe a rcu grace period
      to make sure all other cpus can catch the fact the dst is no longer
      usable.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarDormando <dormando@rydia.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8864972
  2. 25 Jun, 2014 28 commits
  3. 24 Jun, 2014 5 commits
    • Li RongQing's avatar
      cxgb4: Not need to hold the adap_rcu_lock lock when read adap_rcu_list · ee9a33b2
      Li RongQing authored
      cxgb4_netdev maybe lead to dead lock, since it uses a spin lock, and be called
      in both thread and softirq context, but not disable BH, the lockdep report is
      below; In fact, cxgb4_netdev only reads adap_rcu_list with RCU protection, so
      not need to hold spin lock again.
      	=================================
      	[ INFO: inconsistent lock state ]
      	3.14.7+ #24 Tainted: G         C O
      	---------------------------------
      	inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
      	radvd/3794 [HC0[0]:SC1[1]:HE1:SE0] takes:
      	 (adap_rcu_lock){+.?...}, at: [<ffffffffa09989ea>] clip_add+0x2c/0x116 [cxgb4]
      	{SOFTIRQ-ON-W} state was registered at:
      	  [<ffffffff810fca81>] __lock_acquire+0x34a/0xe48
      	  [<ffffffff810fd98b>] lock_acquire+0x82/0x9d
      	  [<ffffffff815d6ff8>] _raw_spin_lock+0x34/0x43
      	  [<ffffffffa09989ea>] clip_add+0x2c/0x116 [cxgb4]
      	  [<ffffffffa0998beb>] cxgb4_inet6addr_handler+0x117/0x12c [cxgb4]
      	  [<ffffffff815da98b>] notifier_call_chain+0x32/0x5c
      	  [<ffffffff815da9f9>] __atomic_notifier_call_chain+0x44/0x6e
      	  [<ffffffff815daa32>] atomic_notifier_call_chain+0xf/0x11
      	  [<ffffffff815b1356>] inet6addr_notifier_call_chain+0x16/0x18
      	  [<ffffffffa01f72e5>] ipv6_add_addr+0x404/0x46e [ipv6]
      	  [<ffffffffa01f8df0>] addrconf_add_linklocal+0x5f/0x95 [ipv6]
      	  [<ffffffffa01fc3e9>] addrconf_notify+0x632/0x841 [ipv6]
      	  [<ffffffff815da98b>] notifier_call_chain+0x32/0x5c
      	  [<ffffffff810e09a1>] __raw_notifier_call_chain+0x9/0xb
      	  [<ffffffff810e09b2>] raw_notifier_call_chain+0xf/0x11
      	  [<ffffffff8151b3b7>] call_netdevice_notifiers_info+0x4e/0x56
      	  [<ffffffff8151b3d0>] call_netdevice_notifiers+0x11/0x13
      	  [<ffffffff8151c0a6>] netdev_state_change+0x1f/0x38
      	  [<ffffffff8152f004>] linkwatch_do_dev+0x3b/0x49
      	  [<ffffffff8152f184>] __linkwatch_run_queue+0x10b/0x144
      	  [<ffffffff8152f1dd>] linkwatch_event+0x20/0x27
      	  [<ffffffff810d7bc0>] process_one_work+0x1cb/0x2ee
      	  [<ffffffff810d7e3b>] worker_thread+0x12e/0x1fc
      	  [<ffffffff810dd391>] kthread+0xc4/0xcc
      	  [<ffffffff815dc48c>] ret_from_fork+0x7c/0xb0
      	irq event stamp: 3388
      	hardirqs last  enabled at (3388): [<ffffffff810c6c85>]
      	__local_bh_enable_ip+0xaa/0xd9
      	hardirqs last disabled at (3387): [<ffffffff810c6c2d>]
      	__local_bh_enable_ip+0x52/0xd9
      	softirqs last  enabled at (3288): [<ffffffffa01f1d5b>]
      	rcu_read_unlock_bh+0x0/0x2f [ipv6]
      	softirqs last disabled at (3289): [<ffffffff815ddafc>]
      	do_softirq_own_stack+0x1c/0x30
      
      	other info that might help us debug this:
      	 Possible unsafe locking scenario:
      
      	       CPU0
      	       ----
      	  lock(adap_rcu_lock);
      	  <Interrupt>
      	    lock(adap_rcu_lock);
      
      	 *** DEADLOCK ***
      
      	5 locks held by radvd/3794:
      	 #0:  (sk_lock-AF_INET6){+.+.+.}, at: [<ffffffffa020b85a>]
      	rawv6_sendmsg+0x74b/0xa4d [ipv6]
      	 #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8151ac6b>]
      	rcu_lock_acquire+0x0/0x29
      	 #2:  (rcu_read_lock){.+.+..}, at: [<ffffffffa01f4cca>]
      	rcu_lock_acquire.constprop.16+0x0/0x30 [ipv6]
      	 #3:  (rcu_read_lock){.+.+..}, at: [<ffffffff810e09b4>]
      	rcu_lock_acquire+0x0/0x29
      	 #4:  (rcu_read_lock){.+.+..}, at: [<ffffffffa0998782>]
      	rcu_lock_acquire.constprop.40+0x0/0x30 [cxgb4]
      
      	stack backtrace:
      	CPU: 7 PID: 3794 Comm: radvd Tainted: G         C O 3.14.7+ #24
      	Hardware name: Supermicro X7DBU/X7DBU, BIOS 6.00 12/03/2007
      	 ffffffff81f15990 ffff88012fdc36a8 ffffffff815d0016 0000000000000006
      	 ffff8800c80dc2a0 ffff88012fdc3708 ffffffff815cc727 0000000000000001
      	 0000000000000001 ffff880100000000 ffffffff81015b02 ffff8800c80dcb58
      	Call Trace:
      	 <IRQ>  [<ffffffff815d0016>] dump_stack+0x4e/0x71
      	 [<ffffffff815cc727>] print_usage_bug+0x1ec/0x1fd
      	 [<ffffffff81015b02>] ? save_stack_trace+0x27/0x44
      	 [<ffffffff810fbfaa>] ? check_usage_backwards+0xa0/0xa0
      	 [<ffffffff810fc640>] mark_lock+0x11b/0x212
      	 [<ffffffff810fca0b>] __lock_acquire+0x2d4/0xe48
      	 [<ffffffff810fbfaa>] ? check_usage_backwards+0xa0/0xa0
      	 [<ffffffff810fbff6>] ? check_usage_forwards+0x4c/0xa6
      	 [<ffffffff810c6c8a>] ? __local_bh_enable_ip+0xaf/0xd9
      	 [<ffffffff810fd98b>] lock_acquire+0x82/0x9d
      	 [<ffffffffa09989ea>] ? clip_add+0x2c/0x116 [cxgb4]
      	 [<ffffffffa0998782>] ? rcu_read_unlock+0x23/0x23 [cxgb4]
      	 [<ffffffff815d6ff8>] _raw_spin_lock+0x34/0x43
      	 [<ffffffffa09989ea>] ? clip_add+0x2c/0x116 [cxgb4]
      	 [<ffffffffa09987b0>] ? rcu_lock_acquire.constprop.40+0x2e/0x30 [cxgb4]
      	 [<ffffffffa0998782>] ? rcu_read_unlock+0x23/0x23 [cxgb4]
      	 [<ffffffffa09989ea>] clip_add+0x2c/0x116 [cxgb4]
      	 [<ffffffffa0998beb>] cxgb4_inet6addr_handler+0x117/0x12c [cxgb4]
      	 [<ffffffff810fd99d>] ? lock_acquire+0x94/0x9d
      	 [<ffffffff810e09b4>] ? raw_notifier_call_chain+0x11/0x11
      	 [<ffffffff815da98b>] notifier_call_chain+0x32/0x5c
      	 [<ffffffff815da9f9>] __atomic_notifier_call_chain+0x44/0x6e
      	 [<ffffffff815daa32>] atomic_notifier_call_chain+0xf/0x11
      	 [<ffffffff815b1356>] inet6addr_notifier_call_chain+0x16/0x18
      	 [<ffffffffa01f72e5>] ipv6_add_addr+0x404/0x46e [ipv6]
      	 [<ffffffff810fde6a>] ? trace_hardirqs_on+0xd/0xf
      	 [<ffffffffa01fb634>] addrconf_prefix_rcv+0x385/0x6ea [ipv6]
      	 [<ffffffffa0207950>] ndisc_rcv+0x9d3/0xd76 [ipv6]
      	 [<ffffffffa020d536>] icmpv6_rcv+0x592/0x67b [ipv6]
      	 [<ffffffff810c6c85>] ? __local_bh_enable_ip+0xaa/0xd9
      	 [<ffffffff810c6c85>] ? __local_bh_enable_ip+0xaa/0xd9
      	 [<ffffffff810fd8dc>] ? lock_release+0x14e/0x17b
      	 [<ffffffffa020df97>] ? rcu_read_unlock+0x21/0x23 [ipv6]
      	 [<ffffffff8150df52>] ? rcu_read_unlock+0x23/0x23
      	 [<ffffffffa01f4ede>] ip6_input_finish+0x1e4/0x2fc [ipv6]
      	 [<ffffffffa01f540b>] ip6_input+0x33/0x38 [ipv6]
      	 [<ffffffffa01f5557>] ip6_mc_input+0x147/0x160 [ipv6]
      	 [<ffffffffa01f4ba3>] ip6_rcv_finish+0x7c/0x81 [ipv6]
      	 [<ffffffffa01f5397>] ipv6_rcv+0x3a1/0x3e2 [ipv6]
      	 [<ffffffff8151ef96>] __netif_receive_skb_core+0x4ab/0x511
      	 [<ffffffff810fdc94>] ? mark_held_locks+0x71/0x99
      	 [<ffffffff8151f0c0>] ? process_backlog+0x69/0x15e
      	 [<ffffffff8151f045>] __netif_receive_skb+0x49/0x5b
      	 [<ffffffff8151f0cf>] process_backlog+0x78/0x15e
      	 [<ffffffff8151f571>] ? net_rx_action+0x1a2/0x1cc
      	 [<ffffffff8151f47b>] net_rx_action+0xac/0x1cc
      	 [<ffffffff810c69b7>] ? __do_softirq+0xad/0x218
      	 [<ffffffff810c69ff>] __do_softirq+0xf5/0x218
      	 [<ffffffff815ddafc>] do_softirq_own_stack+0x1c/0x30
      	 <EOI>  [<ffffffff810c6bb6>] do_softirq+0x38/0x5d
      	 [<ffffffffa01f1d5b>] ? ip6_copy_metadata+0x156/0x156 [ipv6]
      	 [<ffffffff810c6c78>] __local_bh_enable_ip+0x9d/0xd9
      	 [<ffffffffa01f1d88>] rcu_read_unlock_bh+0x2d/0x2f [ipv6]
      	 [<ffffffffa01f28b4>] ip6_finish_output2+0x381/0x3d8 [ipv6]
      	 [<ffffffffa01f49ef>] ip6_finish_output+0x6e/0x73 [ipv6]
      	 [<ffffffffa01f4a70>] ip6_output+0x7c/0xa8 [ipv6]
      	 [<ffffffff815b1bfa>] dst_output+0x18/0x1c
      	 [<ffffffff815b1c9e>] ip6_local_out+0x1c/0x21
      	 [<ffffffffa01f2489>] ip6_push_pending_frames+0x37d/0x427 [ipv6]
      	 [<ffffffff81558af8>] ? skb_orphan+0x39/0x39
      	 [<ffffffffa020b85a>] ? rawv6_sendmsg+0x74b/0xa4d [ipv6]
      	 [<ffffffffa020ba51>] rawv6_sendmsg+0x942/0xa4d [ipv6]
      	 [<ffffffff81584cd2>] inet_sendmsg+0x3d/0x66
      	 [<ffffffff81508930>] __sock_sendmsg_nosec+0x25/0x27
      	 [<ffffffff8150b0d7>] sock_sendmsg+0x5a/0x7b
      	 [<ffffffff810fd8dc>] ? lock_release+0x14e/0x17b
      	 [<ffffffff8116d756>] ? might_fault+0x9e/0xa5
      	 [<ffffffff8116d70d>] ? might_fault+0x55/0xa5
      	 [<ffffffff81508cb1>] ? copy_from_user+0x2a/0x2c
      	 [<ffffffff8150b70c>] ___sys_sendmsg+0x226/0x2d9
      	 [<ffffffff810fcd25>] ? __lock_acquire+0x5ee/0xe48
      	 [<ffffffff810fde01>] ? trace_hardirqs_on_caller+0x145/0x1a1
      	 [<ffffffff8118efcb>] ? slab_free_hook.isra.71+0x50/0x59
      	 [<ffffffff8115c81f>] ? release_pages+0xbc/0x181
      	 [<ffffffff810fd99d>] ? lock_acquire+0x94/0x9d
      	 [<ffffffff81115e97>] ? read_seqcount_begin.constprop.25+0x73/0x90
      	 [<ffffffff8150c408>] __sys_sendmsg+0x3d/0x5b
      	 [<ffffffff8150c433>] SyS_sendmsg+0xd/0x19
      	 [<ffffffff815dc53d>] system_call_fastpath+0x1a/0x1f
      Reported-by: default avatarBen Greear <greearb@candelatech.com>
      Cc: Casey Leedom <leedom@chelsio.com>
      Cc: Hariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee9a33b2
    • Andy Adamson's avatar
      NFSv4: test SECINFO RPC_AUTH_GSS pseudoflavors for support · 66b06860
      Andy Adamson authored
      Fix nfs4_negotiate_security to create an rpc_clnt used to test each SECINFO
      returned pseudoflavor. Check credential creation  (and gss_context creation)
      which is important for RPC_AUTH_GSS pseudoflavors which can fail for multiple
      reasons including mis-configuration.
      
      Don't call nfs4_negotiate in nfs4_submount as it was just called by
      nfs4_proc_lookup_mountpoint (nfs4_proc_lookup_common)
      Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
      [Trond: fix corrupt return value from nfs_find_best_sec()]
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      66b06860
    • Andy Adamson's avatar
      NFS Return -EPERM if no supported or matching SECINFO flavor · 8445cd35
      Andy Adamson authored
      Do not return RPC_AUTH_UNIX if SEINFO reply tests fail. This
      prevents an infinite loop of NFS4ERR_WRONGSEC for non RPC_AUTH_UNIX mounts.
      
      Without this patch, a mount with no sec= option to a server
      that does not include RPC_AUTH_UNIX in the
      SECINFO return can be presented with an attemtp to use RPC_AUTH_UNIX
      which will result in an NFS4ERR_WRONG_SEC which will prompt the SECINFO
      call which will again try RPC_AUTH_UNIX....
      Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
      Tested-By: default avatarSteve Dickson <steved@redhat.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      8445cd35
    • Andy Adamson's avatar
    • Trond Myklebust's avatar
      NFS: Don't mark the data cache as invalid if it has been flushed · 6edf9609
      Trond Myklebust authored
      Now that we have functions such as nfs_write_pageuptodate() that use
      the cache_validity flags to check if the data cache is valid or not,
      it is a little more important to keep the flags in sync with the
      state of the data cache.
      In particular, we'd like to ensure that if the data cache is empty, we
      don't start marking it as needing revalidation.
      Reported-by: default avatarScott Mayhew <smayhew@redhat.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      6edf9609