3.7.8-stable review
Subsystems (35)
Greg Kroah-Hartman
maintainercover 3.7.8-stable review
This is the start of the stable review cycle for the 3.7.8 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Feb 14 20:31:32 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.7.8-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.7.8-rc1
Marcin Slusarz <[email protected]>
drm/nouveau: add lockdep annotations
Eric Dumazet <[email protected]>
net: splice: fix __splice_segment()
Eric Dumazet <[email protected]>
net: splice: avoid high order page splitting
Eric Dumazet <[email protected]>
tcp: fix splice() and tcp collapsing interaction
Eric Dumazet <[email protected]>
tcp: splice: fix an infinite loop in tcp_read_sock()
Willy Tarreau <[email protected]>
tcp: don't abort splice() after small transfers
Ilpo Järvinen <[email protected]>
tcp: fix for zero packets_in_flight was too broad
Eric Dumazet <[email protected]>
tcp: frto should not set snd_cwnd to 0
Eric Dumazet <[email protected]>
tcp: fix an infinite loop in tcp_slow_start()
Yuchung Cheng <[email protected]>
tcp: detect SYN/data drop when F-RTO is disabled
Daniel Borkmann <[email protected]>
net: sctp: sctp_endpoint_free: zero out secret key data
Daniel Borkmann <[email protected]>
net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
Neil Horman <[email protected]>
sctp: refactor sctp_outq_teardown to insure proper re-initalization
Steffen Klassert <[email protected]>
ipv4: Fix route refcount on pmtu discovery
Steffen Klassert <[email protected]>
ipv4: Add a socket release callback for datagram sockets
Steffen Klassert <[email protected]>
ipv4: Invalidate the socket cached route on pmtu events if possible
Steffen Klassert <[email protected]>
ipv6: Add an error handler for icmp6
Steffen Klassert <[email protected]>
ipv4: Don't update the pmtu on mtu locked routes
Steffen Klassert <[email protected]>
ipv4: Remove output route check in ipv4_mtu
Ian Campbell <[email protected]>
netback: correct netbk_tx_err to handle wrap around.
Ian Campbell <[email protected]>
xen/netback: free already allocated memory on failure in xen_netbk_get_requests
Matthew Daley <[email protected]>
xen/netback: don't leak pages on failure in xen_netbk_tx_check_gop.
Ian Campbell <[email protected]>
xen/netback: shutdown the ring if it contains garbage.
Heiko Carstens <[email protected]>
atm/iphase: rename fregt_t -> ffreg_t
Tommi Rantala <[email protected]>
ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
Phil Sutter <[email protected]>
packet: fix leakage of tx_ring memory
David S. Miller <[email protected]>
via-rhine: Fix bugs in NAPI support.
Marcelo Ricardo Leitner <[email protected]>
ipv6: do not create neighbor entries for local delivery
Cong Wang <[email protected]>
pktgen: correctly handle failures when adding a device
Pravin B Shelar <[email protected]>
IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
Eric Dumazet <[email protected]>
net: loopback: fix a dst refcounting issue
Timo Teräs <[email protected]>
r8169: remove the obsolete and incorrect AMD workaround
Eric Dumazet <[email protected]>
netxen: fix off by one bug in netxen_release_tx_buffer()
Tilman Schmidt <[email protected]>
isdn/gigaset: fix zero size border case in debug dump
Eric Dumazet <[email protected]>
tcp: fix incorrect LOCKDROPPEDICMPS counter
Or Gerlitz <[email protected]>
net/mlx4_core: Set number of msix vectors under SRIOV mode to firmware defaults
Yan Burman <[email protected]>
net/mlx4_en: Fix bridged vSwitch configuration for non SRIOV mode
Rob Herring <[email protected]>
net: calxedaxgmac: throw away overrun frames
Eric Dumazet <[email protected]>
macvlan: fix macvlan_get_size()
Romain KUNTZ <[email protected]>
ipv6: fix header length calculation in ip6_append_data()
Stephen Hemminger <[email protected]>
MAINTAINERS: Stephen Hemminger email change
Eric Dumazet <[email protected]>
tcp: fix a panic on UP machines in reqsk_fastopen_remove
Stanislaw Gruszka <[email protected]>
net, wireless: overwrite default_ethtool_ops
Romain Kuntz <[email protected]>
ipv6: fix the noflags test in addrconf_get_prefix_route
Cong Wang <[email protected]>
net: prevent setting ttl=0 via IP_TTL
Mike Snitzer <[email protected]>
dm thin: fix queue limits stacking
Linus Walleij <[email protected]>
mfd: db8500-prcmu: Fix irqdomain usage
Felix Fietkau <[email protected]>
ath9k_hw: fix calibration issues on chainmask that don't include chain 0
Mauro Carvalho Chehab <[email protected]>
media: pwc-if: must check vb2_queue_init() success
Bruce Allan <[email protected]>
e1000e: enable ECC on I217/I218 to catch packet buffer memory errors
Bing Zhao <[email protected]>
mwifiex: fix incomplete scan in case of IE parsing error
Alexander Stein <[email protected]>
can: c_can: Set reserved bit in IFx_MASK2 to 1 on write
Emmanuel Grumbach <[email protected]>
Revert "iwlwifi: fix the reclaimed packet tracking upon flush queue"
Johan Hedberg <[email protected]>
Bluetooth: Fix handling of unexpected SMP PDUs
Sjur Brændeland <[email protected]>
virtio_console: Don't access uninitialized data.
Mike Marciniszyn <[email protected]>
IB/qib: Fix for broken sparse warning fix
Alim Akhtar <[email protected]>
regulator: s2mps11: fix incorrect register for buck10
Stephen Warren <[email protected]>
regulator: clear state each invocation of of_regulator_match
Marek Szyprowski <[email protected]>
regulator: max8998: fix incorrect min_uV value for ldo10
Larry Finger <[email protected]>
rtlwifi: Fix scheduling while atomic bug
Larry Finger <[email protected]>
rtlwifi: Fix the usage of the wrong variable in usb.c
-------------
Diffstat:
MAINTAINERS | 6 +- Makefile | 4 +- drivers/atm/iphase.h | 146 ++++++++++----------- drivers/char/virtio_console.c | 3 +- drivers/gpu/drm/nouveau/core/core/subdev.c | 2 +- drivers/gpu/drm/nouveau/core/include/core/object.h | 7 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 3 + drivers/infiniband/hw/qib/qib_qp.c | 11 +- drivers/isdn/gigaset/capi.c | 2 + drivers/md/dm-thin.c | 13 +- drivers/media/usb/pwc/pwc-if.c | 6 +- drivers/mfd/db8500-prcmu.c | 6 +- drivers/net/can/c_can/c_can.c | 6 +- drivers/net/ethernet/calxeda/xgmac.c | 4 + drivers/net/ethernet/intel/e1000e/defines.h | 9 ++ drivers/net/ethernet/intel/e1000e/e1000.h | 2 + drivers/net/ethernet/intel/e1000e/ethtool.c | 2 + drivers/net/ethernet/intel/e1000e/hw.h | 1 + drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 ++ drivers/net/ethernet/intel/e1000e/netdev.c | 46 +++++++ drivers/net/ethernet/mellanox/mlx4/en_tx.c | 13 +- drivers/net/ethernet/mellanox/mlx4/main.c | 11 +- .../net/ethernet/qlogic/netxen/netxen_nic_init.c | 2 +- .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 + drivers/net/ethernet/realtek/r8169.c | 7 - drivers/net/ethernet/via/via-rhine.c | 8 +- drivers/net/loopback.c | 5 + drivers/net/macvlan.c | 5 +- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 2 + drivers/net/wireless/ath/ath9k/ar9003_phy.c | 2 +- drivers/net/wireless/ath/ath9k/hw.h | 1 + drivers/net/wireless/iwlwifi/dvm/tx.c | 24 +--- drivers/net/wireless/mwifiex/scan.c | 9 +- drivers/net/wireless/rtlwifi/base.c | 7 +- drivers/net/wireless/rtlwifi/usb.c | 4 +- drivers/net/xen-netback/common.h | 3 + drivers/net/xen-netback/interface.c | 23 ++-- drivers/net/xen-netback/netback.c | 115 +++++++++------- drivers/regulator/max8998.c | 2 +- drivers/regulator/of_regulator.c | 6 + drivers/regulator/s2mps11.c | 4 +- include/linux/netdevice.h | 3 + include/net/ip.h | 2 + net/bluetooth/smp.c | 13 ++ net/core/dev.c | 8 ++ net/core/pktgen.c | 9 +- net/core/request_sock.c | 2 - net/core/skbuff.c | 44 ++----- net/ipv4/datagram.c | 25 ++++ net/ipv4/ip_gre.c | 6 +- net/ipv4/ip_sockglue.c | 2 +- net/ipv4/ping.c | 1 + net/ipv4/raw.c | 1 + net/ipv4/route.c | 54 +++++++- net/ipv4/tcp.c | 27 ++-- net/ipv4/tcp_cong.c | 14 +- net/ipv4/tcp_input.c | 8 +- net/ipv4/tcp_ipv4.c | 9 +- net/ipv4/udp.c | 1 + net/ipv6/addrconf.c | 2 +- net/ipv6/icmp.c | 12 ++ net/ipv6/ip6_gre.c | 2 +- net/ipv6/ip6_output.c | 4 +- net/ipv6/route.c | 2 +- net/packet/af_packet.c | 10 +- net/sctp/endpointola.c | 5 + net/sctp/outqueue.c | 12 +- net/sctp/socket.c | 2 +- net/wireless/core.c | 3 +- 69 files changed, 537 insertions(+), 291 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/61 rtlwifi: Fix the usage of the wrong variable in usb.c
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 0a06ad8e3a1cb5311b7dbafde45410aa1bce9d40 upstream.
In routine _rtl_rx_pre_process(), skb_dequeue() is called to get an skb; however, the wrong variable name is used in subsequent calls.
--- drivers/net/wireless/rtlwifi/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rtlwifi/usb.c +2 -2
@@ -542,8 +542,8 @@ static void _rtl_rx_pre_process(struct iWARN_ON (skb_queue_empty (&rx_queue));while (!skb_queue_empty (&rx_queue)) { _skb =skb_dequeue (&rx_queue); -_rtl_usb_rx_process_agg (hw, skb); -ieee80211_rx_irqsafe (hw, skb); +_rtl_usb_rx_process_agg (hw, _skb); +ieee80211_rx_irqsafe (hw, _skb); } }
Greg Kroah-Hartman
maintainerPATCH 2/61 rtlwifi: Fix scheduling while atomic bug
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit a5ffbe0a1993a27072742ef7db6cf9839956fce9 upstream.
Kernel commits 41affd5 and 6539306 changed the locking in rtl_lps_leave() from a spinlock to a mutex by doing the calls indirectly from a work queue to reduce the time that interrupts were disabled. This change was fine for most systems; however a scheduling while atomic bug was reported in
https://bugzilla.redhat.com/show_bug.cgi?id=903881. The backtrace indicates that routine rtl_is_special(), which calls rtl_lps_leave() in three places was entered in atomic context. These direct calls are replaced by putting a request on the appropriate work queue.
--- drivers/net/wireless/rtlwifi/base.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/rtlwifi/base.c +4 -3
@@ -980,7 +980,8 @@ u8 rtl_is_special_data(struct ieee80211_ is_tx ? "Tx" : "Rx");if (is_tx) { -rtl_lps_leave (hw); +schedule_work (&rtlpriv-> + works.lps_leave_work); ppsc->last_delaylps_stamp_jiffies = jiffies; }
@@ -990,7 +991,7 @@ u8 rtl_is_special_data(struct ieee80211_ } }else if (ETH_P_ARP == ether_type) {if (is_tx) { -rtl_lps_leave (hw); +schedule_work (&rtlpriv->works.lps_leave_work); ppsc->last_delaylps_stamp_jiffies = jiffies; }
@@ -1000,7 +1001,7 @@ u8 rtl_is_special_data(struct ieee80211_ "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx");if (is_tx) { -rtl_lps_leave (hw); +schedule_work (&rtlpriv->works.lps_leave_work); ppsc->last_delaylps_stamp_jiffies = jiffies; }
Greg Kroah-Hartman
maintainerPATCH 3/61 regulator: max8998: fix incorrect min_uV value for ldo10
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <[email protected]>
commit 36a6f8c035760dcbd0c3acb4c2fd56268588a9cb upstream.
Correct value for minimal voltage for ldo10 output is 950000 uV. This patch fixes the typo introduced by patch adf6178ad5552a7f2f742a8c85343c50 ("regulator: max8998: Use uV in voltage_map_desc"), what solves broken probe of max8998 in v3.8-rc4.
--- drivers/regulator/max8998.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max8998.c +1 -1
@@ -65,7 +65,7 @@ static const struct voltage_map_desc ldo .min = 2800000, .step = 100000, .max = 3100000, };static const struct voltage_map_desc ldo10_voltage_map_desc = { - .min =95000 , .step =50000 , .max =1300000 , + .min =950000 , .step =50000 , .max =1300000 , };static const struct voltage_map_desc ldo1213_voltage_map_desc = { .min =800000 , .step =100000 , .max =3300000 ,
Greg Kroah-Hartman
maintainerPATCH 4/61 regulator: clear state each invocation of of_regulator_match
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Warren <[email protected]>
commit a2f95c363701deba2205f81929b40222ea6f4f80 upstream.
of_regulator_match() saves some dynamcially allocated state into the match table that's passed to it. By implementation and not contract, for each match table entry, if non-NULL state is already present, of_regulator_match() will not overwrite it. of_regulator_match() is typically called each time a regulator is probe()d. This means it is called with the same match table over and over again if a regulator triggers deferred probe. This results in stale, kfree()d data being left in the match table from probe to probe, which causes a variety of crashes or use of invalid data.
Explicitly free all output state from of_regulator_match() before generating new results in order to avoid this.
--- drivers/regulator/of_regulator.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/regulator/of_regulator.c +6 -0
@@ -120,6 +120,12 @@ int of_regulator_match(struct device *deif (!dev || !node)return -EINVAL ; +for (i =0 ; i < num_matches; i++) { +struct of_regulator_match *match = &matches[i]; + match->init_data =NULL ; + match->of_node =NULL ; + } +for_each_child_of_node (node, child) { name =of_get_property (child,"regulator-compatible" ,NULL );
Greg Kroah-Hartman
maintainerPATCH 5/61 regulator: s2mps11: fix incorrect register for buck10
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alim Akhtar <[email protected]>
commit c76edd52bf19c9d01da7edc4ff04d3707c299779 upstream.
For BUCK10 the control registers are wrongly set as buck9 control register This patch corrects the control registers for buck10
--- drivers/regulator/s2mps11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/s2mps11.c +2 -2
@@ -174,9 +174,9 @@ static struct regulator_ops s2mps11_buck .min_uV = S2MPS11_BUCK_MIN2, \ .uV_step = S2MPS11_BUCK_STEP2, \ .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \ - .vsel_reg = S2MPS11_REG_B9CTRL2, \ + .vsel_reg = S2MPS11_REG_B10CTRL2, \ .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \ - .enable_reg = S2MPS11_REG_B9CTRL1, \ + .enable_reg = S2MPS11_REG_B10CTRL1, \ .enable_mask = S2MPS11_ENABLE_MASK \ }
Greg Kroah-Hartman
maintainerPATCH 6/61 IB/qib: Fix for broken sparse warning fix
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <[email protected]>
commit d359f35430c4ea4dd4e24d809aeaeff1fa54c314 upstream.
Commit 1fb9fed6d489 ("IB/qib: Fix QP RCU sparse warning") broke QP hash list deletion in qp_remove() badly.
This patch restores the former for loop behavior, while still fixing the sparse warnings.
--- drivers/infiniband/hw/qib/qib_qp.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/infiniband/hw/qib/qib_qp.c +3 -8
@@ -263,20 +263,15 @@ static void remove_qp(struct qib_ibdev *struct qib_qp __rcu **qpp; qpp = &dev->qp_table[n]; - q =rcu_dereference_protected (*qpp, -lockdep_is_held (&dev->qpt_lock)); -for (; q; qpp = &q->next) { +for (; (q =rcu_dereference_protected (*qpp, +lockdep_is_held (&dev->qpt_lock))) !=NULL ; + qpp = &q->next)if (q == qp) {atomic_dec (&qp->refcount); *qpp = qp->next;rcu_assign_pointer (qp->next,NULL ); - q =rcu_dereference_protected (*qpp, -lockdep_is_held (&dev->qpt_lock));break ; } - q =rcu_dereference_protected (*qpp, -lockdep_is_held (&dev->qpt_lock)); - } }spin_unlock_irqrestore (&dev->qpt_lock, flags);
Greg Kroah-Hartman
maintainerPATCH 7/61 virtio_console: Dont access uninitialized data.
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sjur Brændeland <[email protected]>
commit aded024a12b32fc1ed9a80639681daae2d07ec25 upstream.
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: [<6026085d>] panic+0x16b/0x2d3 62031b30: [<6004ef5e>] flush_work+0x0/0x1d7 62031b60: [<602606f2>] panic+0x0/0x2d3 62031b68: [<600333b0>] memcpy+0x0/0x140 62031b80: [<6002d58a>] unblock_signals+0x0/0x84 62031ba0: [<602609c5>] printk+0x0/0xa0 62031bd8: [<60264e51>] __mutex_unlock_slowpath+0x13d/0x148 62031c10: [<6004ef5e>] flush_work+0x0/0x1d7 62031c18: [<60050234>] try_to_grab_pending+0x0/0x17e 62031c38: [<6004e984>] get_work_gcwq+0x71/0x8f 62031c48: [<60050539>] __cancel_work_timer+0x5b/0x115 62031c78: [<628acc85>] unplug_port+0x0/0x191 [virtio_console] 62031c98: [<6005061c>] cancel_work_sync+0x12/0x14 62031ca8: [<628ace96>] virtcons_remove+0x80/0x15c [virtio_console] 62031ce8: [<628191de>] virtio_dev_remove+0x1e/0x7e [virtio] 62031d08: [<601cf242>] __device_release_driver+0x75/0xe4 62031d28: [<601cf2dd>] device_release_driver+0x2c/0x40 62031d48: [<601ce0dd>] driver_unbind+0x7d/0xc6 62031d88: [<601cd5d9>] drv_attr_store+0x27/0x29 62031d98: [<60115f61>] sysfs_write_file+0x100/0x14d 62031df8: [<600b737d>] vfs_write+0xcb/0x184 62031e08: [<600b58b8>] filp_close+0x88/0x94 62031e38: [<600b7686>] sys_write+0x59/0x88 62031e88: [<6001ced1>] handle_syscall+0x5d/0x80 62031ea8: [<60030a74>] userspace+0x405/0x531 62031f08: [<600d32cc>] sys_dup+0x0/0x5e 62031f28: [<601b11d6>] strcpy+0x0/0x18 62031f38: [<600be46c>] do_execve+0x10/0x12 62031f48: [<600184c7>] run_init_process+0x43/0x45 62031fd8: [<60019a91>] new_thread_handler+0xba/0xbc
--- drivers/char/virtio_console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/virtio_console.c +2 -1
@@ -1966,7 +1966,8 @@ static void virtcons_remove(struct virti/* Disable interrupts for vqs */ vdev->config->reset (vdev);/* Finish up work that's lined up */ -cancel_work_sync (&portdev->control_work); +if (use_multiport (portdev)) +cancel_work_sync (&portdev->control_work);list_for_each_entry_safe (port, port2, &portdev->ports, list)unplug_port (port);
Greg Kroah-Hartman
maintainerPATCH 8/61 Bluetooth: Fix handling of unexpected SMP PDUs
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hedberg <[email protected]>
commit 8cf9fa1240229cbdd888236c0c43fcbad680cf00 upstream.
The conn->smp_chan pointer can be NULL if SMP PDUs arrive at unexpected moments. To avoid NULL pointer dereferences the code should be checking for this and disconnect if an unexpected SMP PDU arrives. This patch fixes the issue by adding a check for conn->smp_chan for all other PDUs except pairing request and security request (which are are the first PDUs to come to initialize the SMP context).
--- net/bluetooth/smp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/bluetooth/smp.c +13 -0
@@ -859,6 +859,19 @@ int smp_sig_channel(struct l2cap_conn *cskb_pull (skb,sizeof (code)); +/* +* The SMP context must be initialized for all other PDUs except +* pairing and security requests. If we get any other PDU when +* not initialized simply disconnect (done if this function +* returns an error). +*/ +if (code !=SMP_CMD_PAIRING_REQ && code !=SMP_CMD_SECURITY_REQ && + !conn->smp_chan) { +BT_ERR ("Unexpected SMP command 0x%02x. Disconnecting." , code); +kfree_skb (skb); +return -ENOTSUPP ; + } +switch (code) {case SMP_CMD_PAIRING_REQ : reason =smp_cmd_pairing_req (conn, skb);
Greg Kroah-Hartman
maintainerPATCH 9/61 Revert "iwlwifi: fix the reclaimed packet tracking upon flush queue"
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit ae023b2795d36f0f077e157428eb7eafa29ee412 upstream.
This reverts commit f590dcec944552f9a4a61155810f3abd17d6465d which has been reported to cause issues.
See https://lkml.org/lkml/2013/1/20/4 for further details.
--- drivers/net/wireless/iwlwifi/dvm/tx.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
drivers/net/wireless/iwlwifi/dvm/tx.c +7 -17
@@ -1154,6 +1154,13 @@ int iwlagn_rx_reply_tx(struct iwl_priv * next_reclaimed = ssn; } +if (tid !=IWL_TID_NON_QOS ) { + priv->tid_data[sta_id][tid].next_reclaimed = + next_reclaimed; +IWL_DEBUG_TX_REPLY (priv,"Next reclaimed packet:%d\n" , + next_reclaimed); + } +iwl_trans_reclaim (priv->trans, txq_id, ssn, &skbs);iwlagn_check_ratid_empty (priv, sta_id, tid);
@@ -1204,28 +1211,11 @@ int iwlagn_rx_reply_tx(struct iwl_priv *if (!is_agg)iwlagn_non_agg_tx_status (priv, ctx, hdr->addr1); -/* -* W/A for FW bug - the seq_ctl isn't updated when the -* queues are flushed. Fetch it from the packet itself -*/ -if (!is_agg && status ==TX_STATUS_FAIL_FIFO_FLUSHED ) { - next_reclaimed =le16_to_cpu (hdr->seq_ctrl); - next_reclaimed = -SEQ_TO_SN (next_reclaimed +0x10 ); - } - is_offchannel_skb = (info->flags &IEEE80211_TX_CTL_TX_OFFCHAN ); freed++; } -if (tid !=IWL_TID_NON_QOS ) { - priv->tid_data[sta_id][tid].next_reclaimed = - next_reclaimed; -IWL_DEBUG_TX_REPLY (priv,"Next reclaimed packet:%d\n" , - next_reclaimed); - } -WARN_ON (!is_agg && freed !=1 );/*
Greg Kroah-Hartman
maintainerPATCH 10/61 can: c_can: Set reserved bit in IFx_MASK2 to 1 on write
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
commit 2bd3bc4e8472424f1a6009825397639a8968920a upstream.
According to C_CAN documentation, the reserved bit in IFx_MASK2 register is fixed 1.
--- drivers/net/can/c_can/c_can.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/can/c_can/c_can.c +5 -1
@@ -482,8 +482,12 @@ static void c_can_setup_receive_object(s priv->write_reg (priv,C_CAN_IFACE (MASK1_REG , iface),IFX_WRITE_LOW_16BIT (mask)); + +/* According to C_CAN documentation, the reserved bit +* in IFx_MASK2 register is fixed 1 +*/ priv->write_reg (priv,C_CAN_IFACE (MASK2_REG , iface), -IFX_WRITE_HIGH_16BIT (mask)); +IFX_WRITE_HIGH_16BIT (mask) |BIT (13 )); priv->write_reg (priv,C_CAN_IFACE (ARB1_REG , iface),IFX_WRITE_LOW_16BIT (id));
Greg Kroah-Hartman
maintainerPATCH 11/61 mwifiex: fix incomplete scan in case of IE parsing error
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bing Zhao <[email protected]>
commit 8a7d7cbf7b5ff9912ef50b3e94c9ad9f37b1c75f upstream.
A scan request is split into multiple scan commands queued in scan_pending_q. Each scan command will be sent to firmware and its response is handlded one after another.
If any error is detected while parsing IE in command response buffer the remaining data will be ignored and error is returned.
We should check if there is any more scan commands pending in the queue before returning error. This ensures that we will call cfg80211_scan_done if this is the last scan command, or send next scan command in scan_pending_q to firmware.
--- drivers/net/wireless/mwifiex/scan.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/mwifiex/scan.c +5 -4
@@ -1555,7 +1555,7 @@ int mwifiex_ret_802_11_scan(struct mwifidev_err (adapter->dev,"SCAN_RESP: too many AP returned (%d)\n" , scan_rsp->number_of_sets); ret =-1 ; - goto done; + goto check_next_scan; } bytes_left =le16_to_cpu (scan_rsp->bss_descript_size);
@@ -1626,7 +1626,8 @@ int mwifiex_ret_802_11_scan(struct mwifiif (!beacon_size || beacon_size > bytes_left) { bss_info += bytes_left; bytes_left =0 ; -return -1 ; + ret =-1 ; + goto check_next_scan; }/* Initialize the current working beacon pointer for this BSS
@@ -1682,7 +1683,7 @@ int mwifiex_ret_802_11_scan(struct mwifidev_err (priv->adapter->dev,"%s: bytes left < IE length\n" , __func__); - goto done; + goto check_next_scan; }if (element_id ==WLAN_EID_DS_PARAMS ) { channel = *(current_ptr +sizeof (struct ieee_types_header ));
@@ -1745,6 +1746,7 @@ int mwifiex_ret_802_11_scan(struct mwifi } } +check_next_scan:spin_lock_irqsave (&adapter->scan_pending_q_lock, flags);if (list_empty (&adapter->scan_pending_q)) {spin_unlock_irqrestore (&adapter->scan_pending_q_lock, flags);
@@ -1792,7 +1794,6 @@ int mwifiex_ret_802_11_scan(struct mwifi } } -done:return ret; }
Greg Kroah-Hartman
maintainerPATCH 12/61 e1000e: enable ECC on I217/I218 to catch packet buffer memory errors
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bruce Allan <[email protected]>
commit 286003048aaef49b26bb9d93611dc69085e8982e upstream.
In rare instances, memory errors have been detected in the internal packet buffer memory on I217/I218 when stressed under certain environmental conditions. Enable Error Correcting Code (ECC) in hardware to catch both correctable and uncorrectable errors. Correctable errors will be handled by the hardware. Uncorrectable errors in the packet buffer will cause the packet to be received with an error indication in the buffer descriptor causing the packet to be discarded. If the uncorrectable error is in the descriptor itself, the hardware will stop and interrupt the driver indicating the error. The driver will then reset the hardware in order to clear the error and restart.
Both types of errors will be accounted for in statistics counters.
--- drivers/net/ethernet/intel/e1000e/defines.h | 9 +++++ drivers/net/ethernet/intel/e1000e/e1000.h | 2 + drivers/net/ethernet/intel/e1000e/ethtool.c | 2 + drivers/net/ethernet/intel/e1000e/hw.h | 1 drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 ++++++ drivers/net/ethernet/intel/e1000e/netdev.c | 46 ++++++++++++++++++++++++++++ 6 files changed, 71 insertions(+)
drivers/net/ethernet/intel/e1000e/defines.h +9 -0
@@ -233,6 +233,7 @@#define E1000_CTRL_FRCDPX 0x00001000/* Force Duplex */ #define E1000_CTRL_LANPHYPC_OVERRIDE 0x00010000/* SW control of LANPHYPC */ #define E1000_CTRL_LANPHYPC_VALUE 0x00020000/* SW value of LANPHYPC */ +#define E1000_CTRL_MEHE 0x00080000/* Memory Error Handling Enable */ #define E1000_CTRL_SWDPIN0 0x00040000/* SWDPIN 0 value */ #define E1000_CTRL_SWDPIN1 0x00080000/* SWDPIN 1 value */ #define E1000_CTRL_SWDPIO0 0x00400000/* SWDPIN 0 Input or output */
@@ -391,6 +392,12 @@#define E1000_PBS_16K E1000_PBA_16K +/* Uncorrectable/correctable ECC Error counts and enable bits */ +#define E1000_PBECCSTS_CORR_ERR_CNT_MASK 0x000000FF +#define E1000_PBECCSTS_UNCORR_ERR_CNT_MASK 0x0000FF00 +#define E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT 8 +#define E1000_PBECCSTS_ECC_ENABLE 0x00010000 +#define IFS_MAX 80#define IFS_MIN 40#define IFS_RATIO 4
@@ -410,6 +417,7 @@#define E1000_ICR_RXSEQ 0x00000008/* Rx sequence error */ #define E1000_ICR_RXDMT0 0x00000010/* Rx desc min. threshold (0) */ #define E1000_ICR_RXT0 0x00000080/* Rx timer intr (ring 0) */ +#define E1000_ICR_ECCER 0x00400000/* Uncorrectable ECC Error */ #define E1000_ICR_INT_ASSERTED 0x80000000/* If this bit asserted, the driver should claim the interrupt */ #define E1000_ICR_RXQ0 0x00100000/* Rx Queue 0 Interrupt */ #define E1000_ICR_RXQ1 0x00200000/* Rx Queue 1 Interrupt */
@@ -446,6 +454,7 @@#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ/* Rx sequence error */ #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0/* Rx desc min. threshold */ #define E1000_IMS_RXT0 E1000_ICR_RXT0/* Rx timer intr */ +#define E1000_IMS_ECCER E1000_ICR_ECCER/* Uncorrectable ECC Error */ #define E1000_IMS_RXQ0 E1000_ICR_RXQ0/* Rx Queue 0 Interrupt */ #define E1000_IMS_RXQ1 E1000_ICR_RXQ1/* Rx Queue 1 Interrupt */ #define E1000_IMS_TXQ0 E1000_ICR_TXQ0/* Tx Queue 0 Interrupt */
drivers/net/ethernet/intel/e1000e/e1000.h +2 -0
@@ -314,6 +314,8 @@ struct e1000_adapter {struct napi_struct napi; +unsigned int uncorr_errors;/* uncorrectable ECC errors */ +unsigned int corr_errors;/* correctable ECC errors */ unsigned int restart_queue;u32 txd_cmd;
drivers/net/ethernet/intel/e1000e/ethtool.c +2 -0
@@ -108,6 +108,8 @@ static const struct e1000_stats e1000_gsE1000_STAT ("dropped_smbus" , stats.mgpdc),E1000_STAT ("rx_dma_failed" , rx_dma_failed),E1000_STAT ("tx_dma_failed" , tx_dma_failed), +E1000_STAT ("uncorr_ecc_errors" , uncorr_errors), + E1000_STAT("corr_ecc_errors", corr_errors), };#define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
drivers/net/ethernet/intel/e1000e/hw.h +1 -0
@@ -77,6 +77,7 @@ enum e1e_registers {#define E1000_POEMB E1000_PHY_CTRL/* PHY OEM Bits */ E1000_PBA =0x01000 ,/* Packet Buffer Allocation - RW */ E1000_PBS =0x01008 ,/* Packet Buffer Size */ +E1000_PBECCSTS =0x0100C ,/* Packet Buffer ECC Status - RW */ E1000_EEMNGCTL =0x01010 ,/* MNG EEprom Control */ E1000_EEWR =0x0102C ,/* EEPROM Write Register - RW */ E1000_FLOP = 0x0103C, /* FLASH Opcode Register */
drivers/net/ethernet/intel/e1000e/ich8lan.c +11 -0
@@ -3690,6 +3690,17 @@ static void e1000_initialize_hw_bits_ichif (hw->mac.type == e1000_ich8lan) reg |= (E1000_RFCTL_IPV6_EX_DIS |E1000_RFCTL_NEW_IPV6_EXT_DIS );ew32 (RFCTL , reg); + +/* Enable ECC on Lynxpoint */ +if (hw->mac.type == e1000_pch_lpt) { + reg =er32 (PBECCSTS ); + reg |=E1000_PBECCSTS_ECC_ENABLE ; +ew32 (PBECCSTS , reg); + + reg =er32 (CTRL ); + reg |=E1000_CTRL_MEHE ; +ew32 (CTRL , reg); + } }/**
drivers/net/ethernet/intel/e1000e/netdev.c +46 -0
70 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 13/61 media: pwc-if: must check vb2_queue_init() success
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mauro Carvalho Chehab <[email protected]>
commit eda94710d6502672c5ee7de198fa78a63ddfae3a upstream.
drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':drivers/media/usb/pwc/pwc-if.c:1003:16: warning: ignoring return value of 'vb2_queue_init', declared with attribute warn_unused_result [-Wunused-result] In the past, it used to have a logic there at queue init that wouldBUG() on errors. This logic got removed. Drivers are now required
to explicitly handle the queue initialization errors, or very bad
things may happen.
--- drivers/media/usb/pwc/pwc-if.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/media/usb/pwc/pwc-if.c +5 -1
@@ -1000,7 +1000,11 @@ static int usb_pwc_probe(struct usb_inte pdev->vb_queue.buf_struct_size =sizeof (struct pwc_frame_buf ); pdev->vb_queue.ops = &pwc_vb_queue_ops; pdev->vb_queue.mem_ops = &vb2_vmalloc_memops; -vb2_queue_init (&pdev->vb_queue); + rc =vb2_queue_init (&pdev->vb_queue); +if (rc <0 ) { +PWC_ERROR ("Oops, could not initialize vb2 queue.\n" ); + goto err_free_mem; + }/* Init video_device structure */ memcpy (&pdev->vdev, &pwc_template,sizeof (pwc_template));
Greg Kroah-Hartman
maintainerPATCH 14/61 ath9k_hw: fix calibration issues on chainmask that dont include chain 0
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 4a8f199508d79ff8a7d1e22f47b912baaf225336 upstream.
--- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 2 ++ drivers/net/wireless/ath/ath9k/ar9003_phy.c | 2 +- drivers/net/wireless/ath/ath9k/hw.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_calib.c +2 -0
@@ -903,6 +903,8 @@ static bool ar9003_hw_init_cal(struct atAR_PHY_CL_TAB_1 , AR_PHY_CL_TAB_2 }; +ar9003_hw_set_chain_masks (ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask); +if (rtt) {if (!ar9003_hw_rtt_restore (ah, chan)) run_rtt_cal = true;
drivers/net/wireless/ath/ath9k/ar9003_phy.c +1 -1
@@ -586,7 +586,7 @@ static void ar9003_hw_init_bb(struct athath9k_hw_synth_delay (ah, chan, synthDelay); } -static void ar9003_hw_set_chain_masks (struct ath_hw *ah,u8 rx,u8 tx) +void ar9003_hw_set_chain_masks (struct ath_hw *ah,u8 rx,u8 tx) {if (ah->caps.tx_chainmask ==5 || ah->caps.rx_chainmask ==5 ) REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
drivers/net/wireless/ath/ath9k/hw.h +1 -0
@@ -1063,6 +1063,7 @@ int ar9003_paprd_create_curve(struct athint ar9003_paprd_setup_gain_table (struct ath_hw *ah,int chain);int ar9003_paprd_init_table (struct ath_hw *ah);bool ar9003_paprd_is_done (struct ath_hw *ah); +void ar9003_hw_set_chain_masks (struct ath_hw *ah,u8 rx,u8 tx);/* Hardware family op attach helpers */ void ar5008_hw_attach_phy_ops (struct ath_hw *ah);
Greg Kroah-Hartman
maintainerPATCH 15/61 mfd: db8500-prcmu: Fix irqdomain usage
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit 89d9b1c99374997d68910ba49d5b7df80e7f2061 upstream.
This fixes two issues with the DB8500 PRCMU irqdomain:
- You have to state the irq base 0 to get a linear domain for the DT case from irq_domain_add_simple()
- The irqdomain was not used to translate the initial irq request using irq_create_mapping() making the linear case fail as it was lacking a proper descriptor.
I took this opportunity to fix two lines of whitespace errors in related code as I was anyway messing around with it.
Acked-by Lee Jones <[email protected]>
--- drivers/mfd/db8500-prcmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mfd/db8500-prcmu.c +5 -1
@@ -2478,7 +2478,7 @@ static bool read_mailbox_0(void)for (n =0 ; n <NUM_PRCMU_WAKEUPS ; n++) {if (ev & prcmu_irq_bit[n]) -generic_handle_irq (IRQ_PRCMU_BASE + n); +generic_handle_irq (irq_find_mapping (db8500_irq_domain, n)); } r = true;break ;
@@ -2706,6 +2706,10 @@ static int db8500_irq_init(struct devicereturn -ENOSYS ; } +/* All wakeups will be used, so create mappings for all */ +for (i =0 ; i <NUM_PRCMU_WAKEUPS ; i++) +irq_create_mapping (db8500_irq_domain, i); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 16/61 dm thin: fix queue limits stacking
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
commit 0f640dca08330dfc7820d610578e5935b5e654b2 upstream.
thin_io_hints() is blindly copying the queue limits from the thin-pool which can lead to incorrect limits being set. The fix here simply deletes the thin_io_hints() hook which leaves the existing stacking infrastructure to set the limits correctly.
When a thin-pool uses an MD device for the data device a thin device from the thin-pool must respect MD's constraints about disallowing a bio from spanning multiple chunks. Otherwise we can see problems. If the raid0 chunksize is 1152K and thin-pool chunksize is 256K I see the following md/raid0 error (with extra debug tracing added to thin_endio) when mkfs.xfs is executed against the thin device:
md/raid0:md99: make_request bug: can't convert block across chunks or bigger than 1152k 6688 127
device-mapper: thin: bio sector=2080 err=-5 bi_size=130560 bi_rw=17 bi_vcnt=32 bi_idx=0
This extra DM debugging shows that the failing bio is spanning across the first and second logical 1152K chunk (sector 2080 + 255 takes the bio beyond the first chunk's boundary of sector 2304). So the bio splitting that DM is doing clearly isn't respecting the MD limits.
max_hw_sectors_kb is 127 for both the thin-pool and thin device (queue_max_hw_sectors returns 255 so we'll excuse sysfs's lack of precision). So this explains why bi_size is 130560.
But the thin device's max_hw_sectors_kb should be 4 (PAGE_SIZE) given that it doesn't have a .merge function (for bio_add_page to consult indirectly via dm_merge_bvec) yet the thin-pool does sit above an MD device that has a compulsory merge_bvec_fn. This scenario is exactly why DM must resort to sending single PAGE_SIZE bios to the underlying layer. Some additional context for this is available in the header for commit 8cbeb67a ("dm: avoid unsupported spanning of md stripe boundaries").
Long story short, the reason a thin device doesn't properly get configured to have a max_hw_sectors_kb of 4 (PAGE_SIZE) is that thin_io_hints() is blindly copying the queue limits from the thin-pool device directly to the thin device's queue limits.
Fix this by eliminating thin_io_hints. Doing so is safe because the block layer's queue limits stacking already enables the upper level thin device to inherit the thin-pool device's discard and minimum_io_size and optimal_io_size limits that get set in pool_io_hints. But avoiding the queue limits copy allows the thin and thin-pool limits to be different where it is important, namely max_hw_sectors_kb.
--- drivers/md/dm-thin.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/md/dm-thin.c +1 -12
@@ -2766,19 +2766,9 @@ static int thin_iterate_devices(struct dreturn 0 ; } -/* -* A thin device always inherits its queue limits from its pool. -*/ -static void thin_io_hints (struct dm_target *ti,struct queue_limits *limits) -{ -struct thin_c *tc = ti->private; - - *limits =bdev_get_queue (tc->pool_dev->bdev)->limits; -} -static struct target_type thin_target = { .name ="thin" , - .version = {1 ,5 ,0 }, + .version = {1 ,5 ,1 }, .module =THIS_MODULE , .ctr = thin_ctr, .dtr = thin_dtr,
@@ -2787,7 +2777,6 @@ static struct target_type thin_target = .postsuspend = thin_postsuspend, .status = thin_status, .iterate_devices = thin_iterate_devices, - .io_hints = thin_io_hints, };/*----------------------------------------------------------------*/
Greg Kroah-Hartman
maintainerPATCH 17/61 net: prevent setting ttl=0 via IP_TTL
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit c9be4a5c49cf51cc70a993f004c5bb30067a65ce ]
A regression is introduced by the following commit:
commit 4d52cfbef6266092d535237ba5a4b981458ab171 Author: Eric Dumazet <[email protected]> Date: Tue Jun 2 00:42:16 2009 -0700 net: ipv4/ip_sockglue.c cleanups Pure cleanups
but it is not a pure cleanup...
- if (val != -1 && (val < 1 || val>255)) + if (val != -1 && (val < 0 || val > 255))
Since there is no reason provided to allow ttl=0, change it back.
--- net/ipv4/ip_sockglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/ip_sockglue.c +1 -1
@@ -590,7 +590,7 @@ static int do_ip_setsockopt(struct sockcase IP_TTL :if (optlen <1 ) goto e_inval; -if (val !=-1 && (val <0 || val >255 )) +if (val !=-1 && (val <1 || val >255 )) goto e_inval; inet->uc_ttl = val;break ;
Greg Kroah-Hartman
maintainerPATCH 18/61 ipv6: fix the noflags test in addrconf_get_prefix_route
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain Kuntz <[email protected]>
[ Upstream commit 85da53bf1c336bb07ac038fb951403ab0478d2c5 ]
The tests on the flags in addrconf_get_prefix_route() does no make much sense: the 'noflags' parameter contains the set of flags that must not match with the route flags, so the test must be done against 'noflags', and not against 'flags'.
--- net/ipv6/addrconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/addrconf.c +1 -1
@@ -1723,7 +1723,7 @@ static struct rt6_info *addrconf_get_precontinue ;if ((rt->rt6i_flags & flags) != flags)continue ; -if ((noflags !=0 ) && ((rt->rt6i_flags & flags) !=0 )) +if ((rt->rt6i_flags & noflags) !=0 )continue ;dst_hold (&rt->dst);break ;
Greg Kroah-Hartman
maintainerPATCH 19/61 net, wireless: overwrite default_ethtool_ops
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
[ Upstream commit d07d7507bfb4e23735c9b83e397c43e1e8a173e8 ]
Since:
commit 2c60db037034d27f8c636403355d52872da92f81
Author: Eric Dumazet <[email protected]> Date: Sun Sep 16 09:17:26 2012 +0000
net: provide a default dev->ethtool_ops
wireless core does not correctly assign ethtool_ops.
After alloc_netdev*() call, some cfg80211 drivers provide they own ethtool_ops, but some do not. For them, wireless core provide generic cfg80211_ethtool_ops, which is assigned in NETDEV_REGISTER notify call:
if (!dev->ethtool_ops)
dev->ethtool_ops = &cfg80211_ethtool_ops;But after Eric's commit, dev->ethtool_ops is no longer NULL (on cfg80211 drivers without custom ethtool_ops), but points to &default_ethtool_ops.
In order to fix the problem, provide function which will overwrite default_ethtool_ops and use it by wireless core.
--- include/linux/netdevice.h | 3 +++ net/core/dev.c | 8 ++++++++ net/wireless/core.c | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-)
include/linux/netdevice.h +3 -0
@@ -60,6 +60,9 @@ struct wireless_dev;#define SET_ETHTOOL_OPS (netdev,ops) \ ( (netdev)->ethtool_ops = (ops) ) +extern void netdev_set_default_ethtool_ops (struct net_device *dev, +const struct ethtool_ops *ops); +/* hardware address assignment types */ #define NET_ADDR_PERM 0/* address is permanent (default) */ #define NET_ADDR_RANDOM 1/* address is generated randomly */
net/core/dev.c +8 -0
@@ -6012,6 +6012,14 @@ struct netdev_queue *dev_ingress_queue_cstatic const struct ethtool_ops default_ethtool_ops; +void netdev_set_default_ethtool_ops (struct net_device *dev, +const struct ethtool_ops *ops) +{ +if (dev->ethtool_ops == &default_ethtool_ops) + dev->ethtool_ops = ops; +} +EXPORT_SYMBOL_GPL (netdev_set_default_ethtool_ops); +/** * alloc_netdev_mqs - allocate network device * @sizeof_priv: size of private data to allocate space for
net/wireless/core.c +1 -2
@@ -856,8 +856,7 @@ static int cfg80211_netdev_notifier_call/* allow mac80211 to determine the timeout */ wdev->ps_timeout =-1 ; -if (!dev->ethtool_ops) - dev->ethtool_ops = &cfg80211_ethtool_ops; +netdev_set_default_ethtool_ops (dev, &cfg80211_ethtool_ops); if ((wdev->iftype == NL80211_IFTYPE_STATION || wdev->iftype == NL80211_IFTYPE_P2P_CLIENT ||
Greg Kroah-Hartman
maintainerPATCH 20/61 tcp: fix a panic on UP machines in reqsk_fastopen_remove
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit cce894bb824429fd312706c7012acae43e725865 ]
spin_is_locked() on a non !SMP build is kind of useless.
BUG_ON(!spin_is_locked(xx)) is guaranteed to crash.
Just remove this check in reqsk_fastopen_remove() as the callers do hold the socket lock.
--- net/core/request_sock.c | 2 -- 1 file changed, 2 deletions(-)
net/core/request_sock.c +0 -2
@@ -186,8 +186,6 @@ void reqsk_fastopen_remove(struct sock *struct fastopen_queue *fastopenq =inet_csk (lsk)->icsk_accept_queue.fastopenq; -BUG_ON (!spin_is_locked (&sk->sk_lock.slock) && !sock_owned_by_user (sk)); -tcp_sk (sk)->fastopen_rsk =NULL ;spin_lock_bh (&fastopenq->lock); fastopenq->qlen--;
Greg Kroah-Hartman
maintainerPATCH 21/61 MAINTAINERS: Stephen Hemminger email change
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Hemminger <[email protected]>
[ Upstream commit adbbf69d1a54abf424e91875746a610dcc80017d ]
I changed my email because the vyatta.com mail server is now redirected to brocade.com; and the Brocade mail system is not friendly to Linux desktop users.
--- MAINTAINERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
MAINTAINERS +3 -3
@@ -2898,7 +2898,7 @@ S: Maintained F: drivers/net/ethernet/i825xx/eexpress.* ETHERNET BRIDGE -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] L: [email protected] W: http://www.linuxfoundation.org/en/Net:Bridge
@@ -4739,7 +4739,7 @@ S: Maintained MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2) M: Mirko Lindner <[email protected]> -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] S: Maintained F: drivers/net/ethernet/marvell/sk*
@@ -4993,7 +4993,7 @@ S: Supported F: drivers/infiniband/hw/nes/ NETEM NETWORK EMULATOR -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] S: Maintained F: net/sched/sch_netem.c
Greg Kroah-Hartman
maintainerPATCH 22/61 ipv6: fix header length calculation in ip6_append_data()
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain KUNTZ <[email protected]>
[ Upstream commit 7efdba5bd9a2f3e2059beeb45c9fa55eefe1bced ]
Commit 299b0767 (ipv6: Fix IPsec slowpath fragmentation problem) has introduced a error in the header length calculation that provokes corrupted packets when non-fragmentable extensions headers (Destination Option or Routing Header Type 2) are used.
rt->rt6i_nfheader_len is the length of the non-fragmentable extension header, and it should be substracted to rt->dst.header_len, and not to exthdrlen, as it was done before commit 299b0767.
This patch reverts to the original and correct behavior. It has been successfully tested with and without IPsec on packets that include non-fragmentable extensions headers.
--- net/ipv6/ip6_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/ip6_output.c +2 -2
@@ -1279,10 +1279,10 @@ int ip6_append_data(struct sock *sk, intif (dst_allfrag (rt->dst.path)) cork->flags |=IPCORK_ALLFRAG ; cork->length =0 ; - exthdrlen = (opt ? opt->opt_flen :0 ) - rt->rt6i_nfheader_len; + exthdrlen = (opt ? opt->opt_flen :0 ); length += exthdrlen; transhdrlen += exthdrlen; - dst_exthdrlen = rt->dst.header_len; + dst_exthdrlen = rt->dst.header_len - rt->rt6i_nfheader_len; }else { rt = (struct rt6_info *)cork->dst; fl6 = &inet->cork.fl.u.ip6;
Greg Kroah-Hartman
maintainerPATCH 23/61 macvlan: fix macvlan_get_size()
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 01fe944f1024bd4e5c327ddbe8d657656b66af2f ]
commit df8ef8f3aaa (macvlan: add FDB bridge ops and macvlan flags) forgot to update macvlan_get_size() after the addition of IFLA_MACVLAN_FLAGS
--- drivers/net/macvlan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/macvlan.c +4 -1
@@ -822,7 +822,10 @@ static int macvlan_changelink(struct netstatic size_t macvlan_get_size (const struct net_device *dev) { -return nla_total_size (4 ); +return (0 + +nla_total_size (4 )/* IFLA_MACVLAN_MODE */ + +nla_total_size (2 )/* IFLA_MACVLAN_FLAGS */ + ); } static int macvlan_fill_info(struct sk_buff *skb,
Greg Kroah-Hartman
maintainerPATCH 24/61 net: calxedaxgmac: throw away overrun frames
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
[ Upstream commit d6fb3be544b46a7611a3373fcaa62b5b0be01888 ]
The xgmac driver assumes 1 frame per descriptor. If a frame larger than the descriptor's buffer size is received, the frame will spill over into the next descriptor. So check for received frames that span more than one descriptor and discard them. This prevents a crash if we receive erroneous large packets.
--- drivers/net/ethernet/calxeda/xgmac.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/calxeda/xgmac.c +4 -0
@@ -546,6 +546,10 @@ static int desc_get_rx_status(struct xgmreturn -1 ; } +/* All frames should fit into a single buffer */ +if (!(status &RXDESC_FIRST_SEG ) || !(status &RXDESC_LAST_SEG )) +return -1 ; +/* Check if packet has checksum already */ if ((status &RXDESC_FRAME_TYPE ) && (status &RXDESC_EXT_STATUS ) && !(ext_status &RXDESC_IP_PAYLOAD_MASK ))
Greg Kroah-Hartman
maintainerPATCH 25/61 net/mlx4_en: Fix bridged vSwitch configuration for non SRIOV mode
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yan Burman <[email protected]>
[ Upstream commit 213815a1e6ae70b9648483b110bc5081795f99e8 ]
Commit 5b4c4d36860e "mlx4_en: Allow communication between functions on same host" introduced a regression under which a bridge acting as vSwitch whose uplink is an mlx4 Ethernet device become non-operative in native (non sriov) mode. This happens since broadcast ARP requests sent by VMs were loopback-ed by the HW and hence the bridge learned VM source MACs on both the VM and the uplink ports.
The fix is to place the DMAC in the send WQE only under SRIOV/eSwitch configuration or when the device is in selftest.
--- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_tx.c +9 -4
@@ -629,10 +629,15 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff ring->tx_csum++; } -/* Copy dst mac address to wqe */ - ethh = (struct ethhdr *)skb->data; - tx_desc->ctrl.srcrb_flags16[0 ] =get_unaligned ((__be16 *)ethh->h_dest); - tx_desc->ctrl.imm =get_unaligned ((__be32 *)(ethh->h_dest +2 )); +if (mlx4_is_mfunc (mdev->dev) || priv->validate_loopback) { +/* Copy dst mac address to wqe. This allows loopback in eSwitch, +* so that VFs and PF can communicate with each other +*/ + ethh = (struct ethhdr *)skb->data; + tx_desc->ctrl.srcrb_flags16[0 ] =get_unaligned ((__be16 *)ethh->h_dest); + tx_desc->ctrl.imm =get_unaligned ((__be32 *)(ethh->h_dest +2 )); + } +/* Handle LSO (TSO) packets */ if (lso_header_size) {/* Mark opcode as LSO */
Greg Kroah-Hartman
maintainerPATCH 26/61 net/mlx4_core: Set number of msix vectors under SRIOV mode to firmware defaults
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Or Gerlitz <[email protected]>
[ Upstream commit ca4c7b35f75492de7fbf5ee95be07481c348caee ]
The lines
if (mlx4_is_mfunc(dev)) {
nreq = 2;
} else {which hard code the number of requested msi-x vectors under multi-function mode to two can be removed completely, since the firmware sets num_eqs and reserved_eqs appropriately Thus, the code line:
nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, nreq);
is by itself sufficient and correct for all cases. Currently, for mfunc mode num_eqs = 32 and reserved_eqs = 28, hence four vectors will be enabled.
This triples (one vector is used for the async events and commands EQ) the horse power provided for processing of incoming packets on netdev RSS scheme, IO initiators/targets commands processing flows, etc.
--- drivers/net/ethernet/mellanox/mlx4/main.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/net/ethernet/mellanox/mlx4/main.c +2 -9
@@ -1702,15 +1702,8 @@ static void mlx4_enable_msi_x(struct mlxint i;if (msi_x) { -/* In multifunction mode each function gets 2 msi-X vectors -* one for data path completions anf the other for asynch events -* or command completions */ -if (mlx4_is_mfunc (dev)) { - nreq =2 ; - }else { - nreq =min_t (int, dev->caps.num_eqs - - dev->caps.reserved_eqs, nreq); - } + nreq =min_t (int, dev->caps.num_eqs - dev->caps.reserved_eqs, + nreq); entries =kcalloc (nreq,sizeof *entries,GFP_KERNEL );if (!entries)
Greg Kroah-Hartman
maintainerPATCH 27/61 tcp: fix incorrect LOCKDROPPEDICMPS counter
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit b74aa930ef49a3c0d8e4c1987f89decac768fb2c ]
commit 563d34d057 (tcp: dont drop MTU reduction indications) added an error leading to incorrect accounting of LINUX_MIB_LOCKDROPPEDICMPS
If socket is owned by the user, we want to increment this SNMP counter, unless the message is a (ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED) one.
--- net/ipv4/tcp_ipv4.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
net/ipv4/tcp_ipv4.c +4 -5
@@ -380,11 +380,10 @@ void tcp_v4_err(struct sk_buff *icmp_skb* We do take care of PMTU discovery (RFC1191) special case : * we can receive locally generated ICMP messages while socket is held. */ -if (sock_owned_by_user (sk) && - type !=ICMP_DEST_UNREACH && - code !=ICMP_FRAG_NEEDED ) -NET_INC_STATS_BH (net,LINUX_MIB_LOCKDROPPEDICMPS ); - +if (sock_owned_by_user (sk)) { +if (!(type ==ICMP_DEST_UNREACH && code ==ICMP_FRAG_NEEDED )) +NET_INC_STATS_BH (net,LINUX_MIB_LOCKDROPPEDICMPS ); + }if (sk->sk_state ==TCP_CLOSE ) goto out;
Greg Kroah-Hartman
maintainerPATCH 28/61 isdn/gigaset: fix zero size border case in debug dump
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tilman Schmidt <[email protected]>
[ Upstream commit d721a1752ba544df8d7d36959038b26bc92bdf80 ]
If subtracting 12 from l leaves zero we'd do a zero size allocation, leading to an oops later when we try to set the NUL terminator.
--- drivers/isdn/gigaset/capi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/isdn/gigaset/capi.c +2 -0
@@ -248,6 +248,8 @@ static inline void dump_rawmsg(enum debuCAPIMSG_APPID (data),CAPIMSG_MSGID (data), l, CAPIMSG_CONTROL(data)); l -=12 ; +if (l <=0 ) +return ; dbgline =kmalloc (3 * l,GFP_ATOMIC );if (!dbgline)return ;
Greg Kroah-Hartman
maintainerPATCH 29/61 netxen: fix off by one bug in netxen_release_tx_buffer()
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit a05948f296ce103989b28a2606e47d2e287c3c89 ]
Christoph Paasch found netxen could trigger a BUG in its dismantle phase, in netxen_release_tx_buffer(), using full size TSO packets.
cmd_buf->frag_count includes the skb->data part, so the loop must start at index 1 instead of 0, or else we can make an out of bound access to cmd_buff->frag_array[MAX_SKB_FRAGS + 2]
Christoph provided the fixes in netxen_map_tx_skb() function. In case of a dma mapping error, its better to clear the dma fields so that we don't try to unmap them again in netxen_release_tx_buffer()
--- drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 2 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +1 -1
@@ -144,7 +144,7 @@ void netxen_release_tx_buffers(struct ne buffrag->length, PCI_DMA_TODEVICE); buffrag->dma =0ULL ; } -for (j =0 ; j < cmd_buf->frag_count; j++) { +for (j =1 ; j < cmd_buf->frag_count; j++) { buffrag++;if (buffrag->dma) { pci_unmap_page(adapter->pdev, buffrag->dma,
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +2 -0
@@ -1963,10 +1963,12 @@ unwind:while (--i >=0 ) { nf = &pbuf->frag_array[i+1 ];pci_unmap_page (pdev, nf->dma, nf->length,PCI_DMA_TODEVICE ); + nf->dma =0ULL ; } nf = &pbuf->frag_array[0 ];pci_unmap_single (pdev, nf->dma,skb_headlen (skb),PCI_DMA_TODEVICE ); + nf->dma =0ULL ; out_err:return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 30/61 r8169: remove the obsolete and incorrect AMD workaround
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <[email protected]>
[ Upstream commit 5d0feaff230c0abfe4a112e6f09f096ed99e0b2d ]
This was introduced in commit 6dccd16 "r8169: merge with version 6.001.00 of Realtek's r8169 driver". I did not find the version 6.001.00 online, but in 6.002.00 or any later r8169 from Realtek this hunk is no longer present.
Also commit 05af214 "r8169: fix Ethernet Hangup for RTL8110SC rev d" claims to have fixed this issue otherwise.
The magic compare mask of 0xfffe000 is dubious as it masks parts of the Reserved part, and parts of the VLAN tag. But this does not make much sense as the VLAN tag parts are perfectly valid there. In matter of fact this seems to be triggered with any VLAN tagged packet as RxVlanTag bit is matched. I would suspect 0xfffe0000 was intended to test reserved part only.
Finally, this hunk is evil as it can cause more packets to be handled than what was NAPI quota causing net/core/dev.c:net_rx_action(): WARN_ON_ONCE(work > weight) to trigger, and mess up the NAPI state causing device to hang.
As result, any system using VLANs and having high receive traffic (so that NAPI poll budget limits rtl_rx) would result in device hang.
--- drivers/net/ethernet/realtek/r8169.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/net/ethernet/realtek/r8169.c +0 -7
@@ -6064,13 +6064,6 @@ process_pkt: tp->rx_stats.bytes += pkt_size;u64_stats_update_end (&tp->rx_stats.syncp); } - -/* Work around for AMD plateform. */ -if ((desc->opts2 &cpu_to_le32 (0xfffe000 )) && - (tp->mac_version ==RTL_GIGA_MAC_VER_05 )) { - desc->opts2 =0 ; - cur_rx++; - } } count = cur_rx - tp->cur_rx;
Greg Kroah-Hartman
maintainerPATCH 31/61 net: loopback: fix a dst refcounting issue
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 794ed393b707f01858f5ebe2ae5eabaf89d00022 ]
Ben Greear reported crashes in ip_rcv_finish() on a stress test involving many macvlans.
We tracked the bug to a dst use after free. ip_rcv_finish() was calling dst->input() and got garbage for dst->input value.
It appears the bug is in loopback driver, lacking a skb_dst_force() before calling netif_rx().
As a result, a non refcounted dst, normally protected by a RCU read_lock section, was escaping this section and could be freed before the packet being processed.
[<ffffffff813a3c4d>] loopback_xmit+0x64/0x83 [<ffffffff81477364>] dev_hard_start_xmit+0x26c/0x35e [<ffffffff8147771a>] dev_queue_xmit+0x2c4/0x37c [<ffffffff81477456>] ? dev_hard_start_xmit+0x35e/0x35e [<ffffffff8148cfa6>] ? eth_header+0x28/0xb6 [<ffffffff81480f09>] neigh_resolve_output+0x176/0x1a7 [<ffffffff814ad835>] ip_finish_output2+0x297/0x30d [<ffffffff814ad6d5>] ? ip_finish_output2+0x137/0x30d [<ffffffff814ad90e>] ip_finish_output+0x63/0x68 [<ffffffff814ae412>] ip_output+0x61/0x67 [<ffffffff814ab904>] dst_output+0x17/0x1b [<ffffffff814adb6d>] ip_local_out+0x1e/0x23 [<ffffffff814ae1c4>] ip_queue_xmit+0x315/0x353 [<ffffffff814adeaf>] ? ip_send_unicast_reply+0x2cc/0x2cc [<ffffffff814c018f>] tcp_transmit_skb+0x7ca/0x80b [<ffffffff814c3571>] tcp_connect+0x53c/0x587 [<ffffffff810c2f0c>] ? getnstimeofday+0x44/0x7d [<ffffffff810c2f56>] ? ktime_get_real+0x11/0x3e [<ffffffff814c6f9b>] tcp_v4_connect+0x3c2/0x431 [<ffffffff814d6913>] __inet_stream_connect+0x84/0x287 [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49 [<ffffffff8108d695>] ? _local_bh_enable_ip+0x84/0x9f [<ffffffff8108d6c8>] ? local_bh_enable+0xd/0x11 [<ffffffff8146763c>] ? lock_sock_nested+0x6e/0x79 [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49 [<ffffffff814d6b49>] inet_stream_connect+0x33/0x49 [<ffffffff814632c6>] sys_connect+0x75/0x98
This bug was introduced in linux-2.6.35, in commit 7fee226ad2397b (net: add a noref bit on skb dst)
skb_dst_force() is enforced in dev_queue_xmit() for devices having a qdisc.
--- drivers/net/loopback.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/loopback.c +5 -0
@@ -77,6 +77,11 @@ static netdev_tx_t loopback_xmit(structskb_orphan (skb); +/* Before queueing this packet to netif_rx(), +* make sure dst is refcounted. +*/ +skb_dst_force (skb); + skb->protocol =eth_type_trans (skb, dev);/* it's OK to use per_cpu_ptr() because BHs are off */
Greg Kroah-Hartman
maintainerPATCH 32/61 IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pravin B Shelar <[email protected]>
[ Upstream commit 5465740ace36f179de5bb0ccb5d46ddeb945e309 ]
Due to IP_GRE GSO support, GRE can recieve non linear skb which results in panic in case of GRE_CSUM. Following patch fixes it by using correct csum API.
Bug introduced in commit 6b78f16e4bdde3936b (gre: add GSO support)
--- net/ipv4/ip_gre.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/ipv4/ip_gre.c +5 -1
@@ -972,8 +972,12 @@ static netdev_tx_t ipgre_tunnel_xmit(str ptr--; }if (tunnel->parms.o_flags&GRE_CSUM ) { +int offset =skb_transport_offset (skb); + *ptr =0 ; - *(__sum16 *)ptr =ip_compute_csum ((void *)(iph+1 ), skb->len -sizeof (struct iphdr )); + *(__sum16 *)ptr =csum_fold (skb_checksum (skb, offset, + skb->len - offset, +0 )); } }
Greg Kroah-Hartman
maintainerPATCH 33/61 pktgen: correctly handle failures when adding a device
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 604dfd6efc9b79bce432f2394791708d8e8f6efc ]
The return value of pktgen_add_device() is not checked, so even if we fail to add some device, for example, non-exist one, we still see "OK:...". This patch fixes it.
After this patch, I got:
# echo "add_device non-exist" > /proc/net/pktgen/kpktgend_0 -bash: echo: write error: No such device # cat /proc/net/pktgen/kpktgend_0 Running: Stopped: Result: ERROR: can not add device non-exist # echo "add_device eth0" > /proc/net/pktgen/kpktgend_0 # cat /proc/net/pktgen/kpktgend_0 Running: Stopped: eth0 Result: OK: add_device=eth0
(Candidate for -stable)
--- net/core/pktgen.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/core/pktgen.c +6 -3
@@ -1795,10 +1795,13 @@ static ssize_t pktgen_thread_write(strucreturn -EFAULT ; i += len;mutex_lock (&pktgen_thread_lock); -pktgen_add_device (t, f); + ret =pktgen_add_device (t, f);mutex_unlock (&pktgen_thread_lock); - ret = count; -sprintf (pg_result,"OK: add_device=%s" , f); +if (!ret) { + ret = count; +sprintf (pg_result,"OK: add_device=%s" , f); + }else +sprintf (pg_result,"ERROR: can not add device %s" , f); goto out; }
Greg Kroah-Hartman
maintainerPATCH 34/61 ipv6: do not create neighbor entries for local delivery
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Ricardo Leitner <[email protected]>
[ Upstream commit bd30e947207e2ea0ff2c08f5b4a03025ddce48d3 ]
They will be created at output, if ever needed. This avoids creating empty neighbor entries when TPROXYing/Forwarding packets for addresses that are not even directly reachable.
Note that IPv4 already handles it this way. No neighbor entries are created for local input.
Tested by myself and customer.
--- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +1 -1
@@ -872,7 +872,7 @@ restart:dst_hold (&rt->dst);read_unlock_bh (&table->tb6_lock); -if (!rt->n && !(rt->rt6i_flags &RTF_NONEXTHOP )) +if (!rt->n && !(rt->rt6i_flags & (RTF_NONEXTHOP |RTF_LOCAL ))) nrt =rt6_alloc_cow (rt, &fl6->daddr, &fl6->saddr);else if (!(rt->dst.flags &DST_HOST )) nrt =rt6_alloc_clone (rt, &fl6->daddr);
Greg Kroah-Hartman
maintainerPATCH 35/61 via-rhine: Fix bugs in NAPI support.
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <[email protected]>
[ Upstream commit 559bcac35facfed49ab4f408e162971612dcfdf3 ]
1) rhine_tx() should use dev_kfree_skb() not dev_kfree_skb_irq()
2) rhine_slow_event_task's NAPI triggering logic is racey, it should just hit the interrupt mask register. This is the same as commit 7dbb491878a2c51d372a8890fa45a8ff80358af1 ("r8169: avoid NAPI scheduling delay.") made to fix the same problem in the r8169 driver. From Francois Romieu.
--- drivers/net/ethernet/via/via-rhine.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/ethernet/via/via-rhine.c +2 -6
@@ -1802,7 +1802,7 @@ static void rhine_tx(struct net_device * rp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE); } -dev_kfree_skb_irq (rp->tx_skbuff[entry]); +dev_kfree_skb (rp->tx_skbuff[entry]); rp->tx_skbuff[entry] =NULL ; entry = (++rp->dirty_tx) %TX_RING_SIZE ; }
@@ -2011,11 +2011,7 @@ static void rhine_slow_event_task(structif (intr_status & IntrPCIErr)netif_warn (rp, hw, dev,"PCI error\n" ); -napi_disable (&rp->napi); -rhine_irq_disable (rp); -/* Slow and safe. Consider __napi_schedule as a replacement ? */ -napi_enable (&rp->napi); -napi_schedule (&rp->napi); +iowrite16 (RHINE_EVENT &0xffff , rp->base + IntrEnable); out_unlock:mutex_unlock (&rp->task_lock);
Greg Kroah-Hartman
maintainerPATCH 36/61 packet: fix leakage of tx_ring memory
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Sutter <[email protected]>
[ Upstream commit 9665d5d62487e8e7b1f546c00e11107155384b9a ]
When releasing a packet socket, the routine packet_set_ring() is reused to free rings instead of allocating them. But when calling it for the first time, it fills req->tp_block_nr with the value of rb->pg_vec_len which in the second invocation makes it bail out since req->tp_block_nr is greater zero but req->tp_block_size is zero.
This patch solves the problem by passing a zeroed auto-variable to packet_set_ring() upon each invocation from packet_release().
As far as I can tell, this issue exists even since 69e3c75 (net: TX_RING and packet mmap), i.e. the original inclusion of TX ring support into af_packet, but applies only to sockets with both RX and TX ring allocated, which is probably why this was unnoticed all the time.
--- net/packet/af_packet.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/packet/af_packet.c +6 -4
@@ -2335,13 +2335,15 @@ static int packet_release(struct socketpacket_flush_mclist (sk); -memset (&req_u,0 ,sizeof (req_u)); - -if (po->rx_ring.pg_vec) +if (po->rx_ring.pg_vec) { +memset (&req_u,0 ,sizeof (req_u));packet_set_ring (sk, &req_u,1 ,0 ); + } -if (po->tx_ring.pg_vec) +if (po->tx_ring.pg_vec) { +memset (&req_u,0 ,sizeof (req_u));packet_set_ring (sk, &req_u,1 ,1 ); + }fanout_release (sk);
Greg Kroah-Hartman
maintainerPATCH 37/61 ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tommi Rantala <[email protected]>
[ Upstream commit 41ab3e31bd50b42c85ac0aa0469642866aee2a9a ]
ip6gre_tunnel_xmit() is leaking the skb when we hit this error branch, and the -1 return value from this function is bogus. Use the error handling we already have in place in ip6gre_tunnel_xmit() for this error case to fix this.
--- net/ipv6/ip6_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_gre.c +1 -1
@@ -976,7 +976,7 @@ static netdev_tx_t ip6gre_tunnel_xmit(stint ret;if (!ip6_tnl_xmit_ctl (t)) -return -1 ; + goto tx_err;switch (skb->protocol) {case htons (ETH_P_IP ):
Greg Kroah-Hartman
maintainerPATCH 38/61 atm/iphase: rename fregt_t -> ffreg_t
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
[ Upstream commit ab54ee80aa7585f9666ff4dd665441d7ce41f1e8 ]
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
--- drivers/atm/iphase.h | 146 +++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 73 deletions(-)
drivers/atm/iphase.h +73 -73
@@ -636,82 +636,82 @@ struct rx_buf_desc {#define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE#define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE -typedef volatile u_int freg_t ; +typedef volatile u_int ffreg_t ;typedef u_int rreg_t ;typedef struct _ffredn_t { -freg_t idlehead_high;/* Idle cell header (high) */ -freg_t idlehead_low;/* Idle cell header (low) */ -freg_t maxrate;/* Maximum rate */ -freg_t stparms;/* Traffic Management Parameters */ -freg_t abrubr_abr;/* ABRUBR Priority Byte 1, TCR Byte 0 */ -freg_t rm_type;/* */ -u_int filler5[0x17 -0x06 ]; -freg_t cmd_reg;/* Command register */ -u_int filler18[0x20 -0x18 ]; -freg_t cbr_base;/* CBR Pointer Base */ -freg_t vbr_base;/* VBR Pointer Base */ -freg_t abr_base;/* ABR Pointer Base */ -freg_t ubr_base;/* UBR Pointer Base */ -u_int filler24; -freg_t vbrwq_base;/* VBR Wait Queue Base */ -freg_t abrwq_base;/* ABR Wait Queue Base */ -freg_t ubrwq_base;/* UBR Wait Queue Base */ -freg_t vct_base;/* Main VC Table Base */ -freg_t vcte_base;/* Extended Main VC Table Base */ -u_int filler2a[0x2C -0x2A ]; -freg_t cbr_tab_beg;/* CBR Table Begin */ -freg_t cbr_tab_end;/* CBR Table End */ -freg_t cbr_pointer;/* CBR Pointer */ -u_int filler2f[0x30 -0x2F ]; -freg_t prq_st_adr;/* Packet Ready Queue Start Address */ -freg_t prq_ed_adr;/* Packet Ready Queue End Address */ -freg_t prq_rd_ptr;/* Packet Ready Queue read pointer */ -freg_t prq_wr_ptr;/* Packet Ready Queue write pointer */ -freg_t tcq_st_adr;/* Transmit Complete Queue Start Address*/ -freg_t tcq_ed_adr;/* Transmit Complete Queue End Address */ -freg_t tcq_rd_ptr;/* Transmit Complete Queue read pointer */ -freg_t tcq_wr_ptr;/* Transmit Complete Queue write pointer*/ -u_int filler38[0x40 -0x38 ]; -freg_t queue_base;/* Base address for PRQ and TCQ */ -freg_t desc_base;/* Base address of descriptor table */ -u_int filler42[0x45 -0x42 ]; -freg_t mode_reg_0;/* Mode register 0 */ -freg_t mode_reg_1;/* Mode register 1 */ -freg_t intr_status_reg;/* Interrupt Status register */ -freg_t mask_reg;/* Mask Register */ -freg_t cell_ctr_high1;/* Total cell transfer count (high) */ -freg_t cell_ctr_lo1;/* Total cell transfer count (low) */ -freg_t state_reg;/* Status register */ -u_int filler4c[0x58 -0x4c ]; -freg_t curr_desc_num;/* Contains the current descriptor num */ -freg_t next_desc;/* Next descriptor */ -freg_t next_vc;/* Next VC */ -u_int filler5b[0x5d -0x5b ]; -freg_t present_slot_cnt;/* Present slot count */ -u_int filler5e[0x6a -0x5e ]; -freg_t new_desc_num;/* New descriptor number */ -freg_t new_vc;/* New VC */ -freg_t sched_tbl_ptr;/* Schedule table pointer */ -freg_t vbrwq_wptr;/* VBR wait queue write pointer */ -freg_t vbrwq_rptr;/* VBR wait queue read pointer */ -freg_t abrwq_wptr;/* ABR wait queue write pointer */ -freg_t abrwq_rptr;/* ABR wait queue read pointer */ -freg_t ubrwq_wptr;/* UBR wait queue write pointer */ -freg_t ubrwq_rptr;/* UBR wait queue read pointer */ -freg_t cbr_vc;/* CBR VC */ -freg_t vbr_sb_vc;/* VBR SB VC */ -freg_t abr_sb_vc;/* ABR SB VC */ -freg_t ubr_sb_vc;/* UBR SB VC */ -freg_t vbr_next_link;/* VBR next link */ -freg_t abr_next_link;/* ABR next link */ -freg_t ubr_next_link;/* UBR next link */ -u_int filler7a[0x7c -0x7a ]; -freg_t out_rate_head;/* Out of rate head */ -u_int filler7d[0xca -0x7d ];/* pad out to full address space */ -freg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ -freg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ -u_int fillercc[0x100 -0xcc ];/* pad out to full address space */ +ffreg_t idlehead_high;/* Idle cell header (high) */ +ffreg_t idlehead_low;/* Idle cell header (low) */ +ffreg_t maxrate;/* Maximum rate */ +ffreg_t stparms;/* Traffic Management Parameters */ +ffreg_t abrubr_abr;/* ABRUBR Priority Byte 1, TCR Byte 0 */ +ffreg_t rm_type;/* */ +u_int filler5[0x17 -0x06 ]; +ffreg_t cmd_reg;/* Command register */ +u_int filler18[0x20 -0x18 ]; +ffreg_t cbr_base;/* CBR Pointer Base */ +ffreg_t vbr_base;/* VBR Pointer Base */ +ffreg_t abr_base;/* ABR Pointer Base */ +ffreg_t ubr_base;/* UBR Pointer Base */ +u_int filler24; +ffreg_t vbrwq_base;/* VBR Wait Queue Base */ +ffreg_t abrwq_base;/* ABR Wait Queue Base */ +ffreg_t ubrwq_base;/* UBR Wait Queue Base */ +ffreg_t vct_base;/* Main VC Table Base */ +ffreg_t vcte_base;/* Extended Main VC Table Base */ +u_int filler2a[0x2C -0x2A ]; +ffreg_t cbr_tab_beg;/* CBR Table Begin */ +ffreg_t cbr_tab_end;/* CBR Table End */ +ffreg_t cbr_pointer;/* CBR Pointer */ +u_int filler2f[0x30 -0x2F ]; +ffreg_t prq_st_adr;/* Packet Ready Queue Start Address */ +ffreg_t prq_ed_adr;/* Packet Ready Queue End Address */ +ffreg_t prq_rd_ptr;/* Packet Ready Queue read pointer */ +ffreg_t prq_wr_ptr;/* Packet Ready Queue write pointer */ +ffreg_t tcq_st_adr;/* Transmit Complete Queue Start Address*/ +ffreg_t tcq_ed_adr;/* Transmit Complete Queue End Address */ +ffreg_t tcq_rd_ptr;/* Transmit Complete Queue read pointer */ +ffreg_t tcq_wr_ptr;/* Transmit Complete Queue write pointer*/ +u_int filler38[0x40 -0x38 ]; +ffreg_t queue_base;/* Base address for PRQ and TCQ */ +ffreg_t desc_base;/* Base address of descriptor table */ +u_int filler42[0x45 -0x42 ]; +ffreg_t mode_reg_0;/* Mode register 0 */ +ffreg_t mode_reg_1;/* Mode register 1 */ +ffreg_t intr_status_reg;/* Interrupt Status register */ +ffreg_t mask_reg;/* Mask Register */ +ffreg_t cell_ctr_high1;/* Total cell transfer count (high) */ +ffreg_t cell_ctr_lo1;/* Total cell transfer count (low) */ +ffreg_t state_reg;/* Status register */ +u_int filler4c[0x58 -0x4c ]; +ffreg_t curr_desc_num;/* Contains the current descriptor num */ +ffreg_t next_desc;/* Next descriptor */ +ffreg_t next_vc;/* Next VC */ +u_int filler5b[0x5d -0x5b ]; +ffreg_t present_slot_cnt;/* Present slot count */ +u_int filler5e[0x6a -0x5e ]; +ffreg_t new_desc_num;/* New descriptor number */ +ffreg_t new_vc;/* New VC */ +ffreg_t sched_tbl_ptr;/* Schedule table pointer */ +ffreg_t vbrwq_wptr;/* VBR wait queue write pointer */ +ffreg_t vbrwq_rptr;/* VBR wait queue read pointer */ +ffreg_t abrwq_wptr;/* ABR wait queue write pointer */ +ffreg_t abrwq_rptr;/* ABR wait queue read pointer */ +ffreg_t ubrwq_wptr;/* UBR wait queue write pointer */ +ffreg_t ubrwq_rptr;/* UBR wait queue read pointer */ +ffreg_t cbr_vc;/* CBR VC */ +ffreg_t vbr_sb_vc;/* VBR SB VC */ +ffreg_t abr_sb_vc;/* ABR SB VC */ +ffreg_t ubr_sb_vc;/* UBR SB VC */ +ffreg_t vbr_next_link;/* VBR next link */ +ffreg_t abr_next_link;/* ABR next link */ +ffreg_t ubr_next_link;/* UBR next link */ +u_int filler7a[0x7c -0x7a ]; +ffreg_t out_rate_head;/* Out of rate head */ +u_int filler7d[0xca -0x7d ];/* pad out to full address space */ +ffreg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ +ffreg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ +u_int fillercc[0x100 -0xcc ];/* pad out to full address space */ }ffredn_t ; typedef struct _rfredn_t {
Greg Kroah-Hartman
maintainerPATCH 39/61 xen/netback: shutdown the ring if it contains garbage.
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Campbell <[email protected]>
[ Upstream commit 48856286b64e4b66ec62b94e504d0b29c1ade664 ]
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.
--- drivers/net/xen-netback/common.h | 3 + drivers/net/xen-netback/interface.c | 23 ++++++++----- drivers/net/xen-netback/netback.c | 62 ++++++++++++++++++++++++++---------- 3 files changed, 62 insertions(+), 26 deletions(-)
drivers/net/xen-netback/common.h +3 -0
@@ -151,6 +151,9 @@ void xen_netbk_queue_tx_skb(struct xenvi/* Notify xenvif that ring now has space to send an skb to the frontend */ void xenvif_notify_tx_completion (struct xenvif *vif); +/* Prevent the device from generating any further traffic. */ +void xenvif_carrier_off (struct xenvif *vif); +/* Returns number of ring slots required to send an skb to the frontend */ unsigned int xen_netbk_count_skb_slots (struct xenvif *vif,struct sk_buff *skb);
drivers/net/xen-netback/interface.c +14 -9
@@ -343,17 +343,22 @@ err:return err; } -void xenvif_disconnect (struct xenvif *vif) +void xenvif_carrier_off (struct xenvif *vif) {struct net_device *dev = vif->dev; -if (netif_carrier_ok (dev)) { -rtnl_lock (); -netif_carrier_off (dev);/* discard queued packets */ -if (netif_running (dev)) -xenvif_down (vif); -rtnl_unlock (); -xenvif_put (vif); - } + +rtnl_lock (); +netif_carrier_off (dev);/* discard queued packets */ +if (netif_running (dev)) +xenvif_down (vif); +rtnl_unlock (); +xenvif_put (vif); +} + +void xenvif_disconnect (struct xenvif *vif) +{ +if (netif_carrier_ok (vif->dev)) +xenvif_carrier_off (vif);atomic_dec (&vif->refcnt);wait_event (vif->waiting_to_free,atomic_read (&vif->refcnt) ==0 );
drivers/net/xen-netback/netback.c +45 -17
151 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 40/61 xen/netback: dont leak pages on failure in xen_netbk_tx_check_gop.
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Daley <[email protected]>
[ Upstream commit 7d5145d8eb2b9791533ffe4dc003b129b9696c48 ]
--- drivers/net/xen-netback/netback.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-)
drivers/net/xen-netback/netback.c +13 -25
@@ -147,7 +147,8 @@ void xen_netbk_remove_xenvif(struct xenvatomic_dec (&netbk->netfront_count); } -static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx); +static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx, +u8 status);static void make_tx_response (struct xenvif *vif,struct xen_netif_tx_request *txp,s8 st);
@@ -1007,30 +1008,20 @@ static int xen_netbk_tx_check_gop(struct {struct gnttab_copy *gop = *gopp;u16 pending_idx = *((u16 *)skb->data); -struct pending_tx_info *pending_tx_info = netbk->pending_tx_info; -struct xenvif *vif = pending_tx_info[pending_idx].vif; -struct xen_netif_tx_request *txp;struct skb_shared_info *shinfo =skb_shinfo (skb);int nr_frags = shinfo->nr_frags;int i, err, start;/* Check status of header. */ err = gop->status; -if (unlikely (err)) { -pending_ring_idx_t index; - index =pending_index (netbk->pending_prod++); - txp = &pending_tx_info[pending_idx].req; -make_tx_response (vif, txp,XEN_NETIF_RSP_ERROR ); - netbk->pending_ring[index] = pending_idx; -xenvif_put (vif); - } +if (unlikely (err)) +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_ERROR );/* Skip first skb fragment if it is on same page as header fragment. */ start = (frag_get_pending_idx (&shinfo->frags[0 ]) == pending_idx);for (i = start; i < nr_frags; i++) {int j, newerr; -pending_ring_idx_t index; pending_idx =frag_get_pending_idx (&shinfo->frags[i]);
@@ -1039,16 +1030,12 @@ static int xen_netbk_tx_check_gop(structif (likely (!newerr)) {/* Had a previous error? Invalidate this fragment. */ if (unlikely (err)) -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY );continue ; }/* Error on this fragment: respond to client with an error. */ - txp = &netbk->pending_tx_info[pending_idx].req; -make_tx_response (vif, txp,XEN_NETIF_RSP_ERROR ); - index =pending_index (netbk->pending_prod++); - netbk->pending_ring[index] = pending_idx; -xenvif_put (vif); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_ERROR );/* Not the first error? Preceding frags already invalidated. */ if (err)
@@ -1056,10 +1043,10 @@ static int xen_netbk_tx_check_gop(struct/* First error: invalidate header and preceding fragments. */ pending_idx = *((u16 *)skb->data); -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY );for (j = start; j < i; j++) { pending_idx =frag_get_pending_idx (&shinfo->frags[j]); -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY ); }/* Remember the error: invalidate all subsequent fragments. */
@@ -1093,7 +1080,7 @@ static void xen_netbk_fill_frags(struct/* Take an extra reference to offset xen_netbk_idx_release */ get_page (netbk->mmap_pages[pending_idx]); -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY ); } }
@@ -1476,7 +1463,7 @@ static void xen_netbk_tx_submit(struct x txp->size -= data_len; }else {/* Schedule a response immediately. */ -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY ); }if (txp->flags & XEN_NETTXF_csum_blank)
@@ -1528,7 +1515,8 @@ static void xen_netbk_tx_action(struct xxen_netbk_tx_submit (netbk); } -static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx) +static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx, +u8 status) {struct xenvif *vif;struct pending_tx_info *pending_tx_info;
@@ -1542,7 +1530,7 @@ static void xen_netbk_idx_release(struct vif = pending_tx_info->vif; -make_tx_response (vif, &pending_tx_info->req,XEN_NETIF_RSP_OKAY ); +make_tx_response (vif, &pending_tx_info->req, status); index =pending_index (netbk->pending_prod++); netbk->pending_ring[index] = pending_idx;
Greg Kroah-Hartman
maintainerPATCH 41/61 xen/netback: free already allocated memory on failure in xen_netbk_get_requests
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Campbell <[email protected]>
[ Upstream commit 4cc7c1cb7b11b6f3515bd9075527576a1eecc4aa ]
--- drivers/net/xen-netback/netback.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/xen-netback/netback.c +12 -1
@@ -978,7 +978,7 @@ static struct gnttab_copy *xen_netbk_get pending_idx = netbk->pending_ring[index]; page =xen_netbk_alloc_page (netbk, skb, pending_idx);if (!page) -return NULL ; + goto err; gop->source.u.ref = txp->gref; gop->source.domid = vif->domid;
@@ -1000,6 +1000,17 @@ static struct gnttab_copy *xen_netbk_get }return gop; +err: +/* Unwind, freeing all pages and sending error responses. */ +while (i-- > start) { +xen_netbk_idx_release (netbk,frag_get_pending_idx (&frags[i]), +XEN_NETIF_RSP_ERROR ); + } +/* The head too, if necessary. */ +if (start) +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_ERROR ); + +return NULL ; } static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
Greg Kroah-Hartman
maintainerPATCH 42/61 netback: correct netbk_tx_err to handle wrap around.
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Campbell <[email protected]>
[ Upstream commit b9149729ebdcfce63f853aa54a404c6a8f6ebbf3 ]
--- drivers/net/xen-netback/netback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/xen-netback/netback.c +1 -1
@@ -880,7 +880,7 @@ static void netbk_tx_err(struct xenvif *do {make_tx_response (vif, txp,XEN_NETIF_RSP_ERROR ); -if (cons >= end) +if (cons == end)break ; txp =RING_GET_REQUEST (&vif->tx, cons++); }while (1 );
Greg Kroah-Hartman
maintainerPATCH 43/61 ipv4: Remove output route check in ipv4_mtu
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit 38d523e2948162776903349c89d65f7b9370dadb ]
The output route check was introduced with git commit 261663b0 (ipv4: Don't use the cached pmtu informations for input routes) during times when we cached the pmtu informations on the inetpeer. Now the pmtu informations are back in the routes, so this check is obsolete. It also had some unwanted side effects, as reported by Timo Teras and Lukas Tribus.
--- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/route.c +1 -1
@@ -1120,7 +1120,7 @@ static unsigned int ipv4_mtu(const strucif (!mtu ||time_after_eq (jiffies, rt->dst.expires)) mtu =dst_metric_raw (dst,RTAX_MTU ); -if (mtu &&rt_is_output_route (rt)) +if (mtu)return mtu; mtu = dst->dev->mtu;
Greg Kroah-Hartman
maintainerPATCH 44/61 ipv4: Dont update the pmtu on mtu locked routes
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit fa1e492aa3cbafba9f8fc6d05e5b08a3091daf4a ]
Routes with locked mtu should not use learned pmtu informations, so do not update the pmtu on these routes.
--- net/ipv4/route.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv4/route.c +3 -0
@@ -912,6 +912,9 @@ static void __ip_rt_update_pmtu(struct rstruct dst_entry *dst = &rt->dst;struct fib_result res; +if (dst_metric_locked (dst,RTAX_MTU )) +return ; +if (dst->dev->mtu < mtu)return ;
Greg Kroah-Hartman
maintainerPATCH 45/61 ipv6: Add an error handler for icmp6
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit 6f809da27c94425e07be4a64d5093e1df95188e9 ]
pmtu and redirect events are now handled in the protocols error handler, so add an error handler for icmp6 to do this. It is needed in the case when we have no socket context. Based on a patch by Duan Jiong.
--- net/ipv6/icmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
net/ipv6/icmp.c +12 -0
@@ -81,10 +81,22 @@ static inline struct sock *icmpv6_sk(strreturn net->ipv6.icmp_sk[smp_processor_id ()]; } +static void icmpv6_err (struct sk_buff *skb,struct inet6_skb_parm *opt, +u8 type,u8 code,int offset,__be32 info) +{ +struct net *net =dev_net (skb->dev); + +if (type ==ICMPV6_PKT_TOOBIG ) +ip6_update_pmtu (skb, net, info,0 ,0 ); +else if (type ==NDISC_REDIRECT ) +ip6_redirect (skb, net,0 ,0 ); +} +static int icmpv6_rcv (struct sk_buff *skb);static const struct inet6_protocol icmpv6_protocol = { .handler = icmpv6_rcv, + .err_handler = icmpv6_err, .flags =INET6_PROTO_NOPOLICY |INET6_PROTO_FINAL , };
Greg Kroah-Hartman
maintainerPATCH 46/61 ipv4: Invalidate the socket cached route on pmtu events if possible
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit 9cb3a50c5f63ed745702972f66eaee8767659acd ]
The route lookup in ipv4_sk_update_pmtu() might return a route different from the route we cached at the socket. This is because standart routes are per cpu, so each cpu has it's own struct rtable. This means that we do not invalidate the socket cached route if the NET_RX_SOFTIRQ is not served by the same cpu that the sending socket uses. As a result, the cached route reused until we disconnect.
With this patch we invalidate the socket cached route if possible. If the socket is owened by the user, we can't update the cached route directly. A followup patch will implement socket release callback functions for datagram sockets to handle this case.
--- net/ipv4/route.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-)
net/ipv4/route.c +41 -1
@@ -965,7 +965,7 @@ void ipv4_update_pmtu(struct sk_buff *sk }EXPORT_SYMBOL_GPL (ipv4_update_pmtu); -void ipv4_sk_update_pmtu (struct sk_buff *skb,struct sock *sk,u32 mtu) +static void __ipv4_sk_update_pmtu (struct sk_buff *skb,struct sock *sk,u32 mtu) {const struct iphdr *iph = (const struct iphdr *) skb->data;struct flowi4 fl4;
@@ -978,6 +978,46 @@ void ipv4_sk_update_pmtu(struct sk_buffip_rt_put (rt); } } + +void ipv4_sk_update_pmtu (struct sk_buff *skb,struct sock *sk,u32 mtu) +{ +const struct iphdr *iph = (const struct iphdr *) skb->data; +struct flowi4 fl4; +struct rtable *rt; +struct dst_entry *dst; + +bh_lock_sock (sk); + rt = (struct rtable *)__sk_dst_get (sk); + +if (sock_owned_by_user (sk) || !rt) { +__ipv4_sk_update_pmtu (skb, sk, mtu); + goto out; + } + +__build_flow_key (&fl4, sk, iph,0 ,0 ,0 ,0 ,0 ); + +if (!__sk_dst_check (sk,0 )) { + rt =ip_route_output_flow (sock_net (sk), &fl4, sk); +if (IS_ERR (rt)) + goto out; + } + +__ip_rt_update_pmtu ((struct rtable *) rt->dst.path, &fl4, mtu); + + dst =dst_check (&rt->dst,0 ); +if (!dst) { + rt =ip_route_output_flow (sock_net (sk), &fl4, sk); +if (IS_ERR (rt)) + goto out; + + dst = &rt->dst; + } + +__sk_dst_set (sk, dst); + +out: +bh_unlock_sock (sk); +}EXPORT_SYMBOL_GPL (ipv4_sk_update_pmtu); void ipv4_redirect(struct sk_buff *skb, struct net *net,
Greg Kroah-Hartman
maintainerPATCH 47/61 ipv4: Add a socket release callback for datagram sockets
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit 8141ed9fcedb278f4a3a78680591bef1e55f75fb ]
This implements a socket release callback function to check if the socket cached route got invalid during the time we owned the socket. The function is used from udp, raw and ping sockets.
--- include/net/ip.h | 2 ++ net/ipv4/datagram.c | 25 +++++++++++++++++++++++++ net/ipv4/ping.c | 1 + net/ipv4/raw.c | 1 + net/ipv4/udp.c | 1 + 5 files changed, 30 insertions(+)
include/net/ip.h +2 -0
@@ -143,6 +143,8 @@ static inline struct sk_buff *ip_finish_extern int ip4_datagram_connect (struct sock *sk,struct sockaddr *uaddr,int addr_len); +extern void ip4_datagram_release_cb (struct sock *sk); +struct ip_reply_arg {struct kvec iov[1 ];int flags;
net/ipv4/datagram.c +25 -0
@@ -85,3 +85,28 @@ out:return err; }EXPORT_SYMBOL (ip4_datagram_connect); + +void ip4_datagram_release_cb (struct sock *sk) +{ +const struct inet_sock *inet =inet_sk (sk); +const struct ip_options_rcu *inet_opt; +__be32 daddr = inet->inet_daddr; +struct flowi4 fl4; +struct rtable *rt; + +if (!__sk_dst_get (sk) ||__sk_dst_check (sk,0 )) +return ; + +rcu_read_lock (); + inet_opt =rcu_dereference (inet->inet_opt); +if (inet_opt && inet_opt->opt.srr) + daddr = inet_opt->opt.faddr; + rt =ip_route_output_ports (sock_net (sk), &fl4, sk, daddr, + inet->inet_saddr, inet->inet_dport, + inet->inet_sport, sk->sk_protocol, +RT_CONN_FLAGS (sk), sk->sk_bound_dev_if); +if (!IS_ERR (rt)) +__sk_dst_set (sk, &rt->dst); +rcu_read_unlock (); +} +EXPORT_SYMBOL_GPL (ip4_datagram_release_cb);
net/ipv4/ping.c +1 -0
@@ -738,6 +738,7 @@ struct proto ping_prot = { .recvmsg = ping_recvmsg, .bind = ping_bind, .backlog_rcv = ping_queue_rcv_skb, + .release_cb = ip4_datagram_release_cb, .hash = ping_v4_hash, .unhash = ping_v4_unhash, .get_port = ping_v4_get_port,
net/ipv4/raw.c +1 -0
@@ -894,6 +894,7 @@ struct proto raw_prot = { .recvmsg = raw_recvmsg, .bind = raw_bind, .backlog_rcv = raw_rcv_skb, + .release_cb = ip4_datagram_release_cb, .hash = raw_hash_sk, .unhash = raw_unhash_sk, .obj_size = sizeof(struct raw_sock),
net/ipv4/udp.c +1 -0
@@ -1952,6 +1952,7 @@ struct proto udp_prot = { .recvmsg = udp_recvmsg, .sendpage = udp_sendpage, .backlog_rcv = __udp_queue_rcv_skb, + .release_cb = ip4_datagram_release_cb, .hash = udp_lib_hash, .unhash = udp_lib_unhash, .rehash = udp_v4_rehash,
Greg Kroah-Hartman
maintainerPATCH 48/61 ipv4: Fix route refcount on pmtu discovery
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit b44108dbdbaa07c609bb5755e8dd6c2035236251 ]
git commit 9cb3a50c (ipv4: Invalidate the socket cached route on pmtu events if possible) introduced a refcount problem. We don't get a refcount on the route if we get it from__sk_dst_get(), but we need one if we want to reuse this route because __sk_dst_set() releases the refcount of the old route. This patch adds proper refcount handling for that case. We introduce a 'new' flag to indicate that we are going to use a new route and we release the old route only if we replace it by a new one.
--- net/ipv4/route.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
net/ipv4/route.c +9 -2
@@ -985,6 +985,7 @@ void ipv4_sk_update_pmtu(struct sk_buffstruct flowi4 fl4;struct rtable *rt;struct dst_entry *dst; +bool new = false;bh_lock_sock (sk); rt = (struct rtable *)__sk_dst_get (sk);
@@ -1000,20 +1001,26 @@ void ipv4_sk_update_pmtu(struct sk_buff rt =ip_route_output_flow (sock_net (sk), &fl4, sk);if (IS_ERR (rt)) goto out; + + new = true; }__ip_rt_update_pmtu ((struct rtable *) rt->dst.path, &fl4, mtu); dst =dst_check (&rt->dst,0 );if (!dst) { +if (new) +dst_release (&rt->dst); + rt =ip_route_output_flow (sock_net (sk), &fl4, sk);if (IS_ERR (rt)) goto out; - dst = &rt->dst; + new = true; } -__sk_dst_set (sk, dst); +if (new) +__sk_dst_set (sk, &rt->dst); out:bh_unlock_sock (sk);
Greg Kroah-Hartman
maintainerPATCH 49/61 sctp: refactor sctp_outq_teardown to insure proper re-initalization
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Horman <[email protected]>
[ Upstream commit 2f94aabd9f6c925d77aecb3ff020f1cc12ed8f86 ]
Jamie Parsons reported a problem recently, in which the re-initalization of an association (The duplicate init case), resulted in a loss of receive window space. He tracked down the root cause to sctp_outq_teardown, which discarded all the data on an outq during a re-initalization of the corresponding association, but never reset the outq->outstanding_data field to zero. I wrote, and he tested this fix, which does a proper full re-initalization of the outq, fixing this problem, and hopefully future proofing us from simmilar issues down the road.
--- net/sctp/outqueue.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/sctp/outqueue.c +8 -4
@@ -224,7 +224,7 @@ void sctp_outq_init(struct sctp_associat/* Free the outqueue structure and any related pending chunks. */ -void sctp_outq_teardown (struct sctp_outq *q) +static void __sctp_outq_teardown (struct sctp_outq *q) {struct sctp_transport *transport;struct list_head *lchunk, *temp;
@@ -277,8 +277,6 @@ void sctp_outq_teardown(struct sctp_outqsctp_chunk_free (chunk); } - q->error =0 ; -/* Throw away any leftover control chunks. */ list_for_each_entry_safe (chunk, tmp, &q->control_chunk_list, list) {list_del_init (&chunk->list);
@@ -286,11 +284,17 @@ void sctp_outq_teardown(struct sctp_outq } } +void sctp_outq_teardown (struct sctp_outq *q) +{ +__sctp_outq_teardown (q); +sctp_outq_init (q->asoc, q); +} +/* Free the outqueue structure and any related pending chunks. */ void sctp_outq_free (struct sctp_outq *q) {/* Throw away leftover chunks. */ -sctp_outq_teardown (q); +__sctp_outq_teardown (q);/* If we were kmalloc()'d, free the memory. */ if (q->malloced)
Greg Kroah-Hartman
maintainerPATCH 50/61 net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit 6ba542a291a5e558603ac51cda9bded347ce7627 ]
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().
--- net/sctp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/socket.c +1 -1
@@ -3388,7 +3388,7 @@ static int sctp_setsockopt_auth_key(stru ret =sctp_auth_set_key (sctp_sk (sk)->ep, asoc, authkey); out: -kfree (authkey); +kzfree (authkey);return ret; }
Greg Kroah-Hartman
maintainerPATCH 51/61 net: sctp: sctp_endpoint_free: zero out secret key data
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit b5c37fe6e24eec194bb29d22fdd55d73bcc709bf ]
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.
--- net/sctp/endpointola.c | 5 +++++ 1 file changed, 5 insertions(+)
net/sctp/endpointola.c +5 -0
@@ -249,6 +249,8 @@ void sctp_endpoint_free(struct sctp_endp/* Final destructor for endpoint. */ static void sctp_endpoint_destroy (struct sctp_endpoint *ep) { +int i; +SCTP_ASSERT (ep->base.dead,"Endpoint is not dead" , return);/* Free up the HMAC transform. */
@@ -271,6 +273,9 @@ static void sctp_endpoint_destroy(structsctp_inq_free (&ep->base.inqueue);sctp_bind_addr_free (&ep->base.bind_addr); +for (i =0 ; i <SCTP_HOW_MANY_SECRETS ; ++i) +memset (&ep->secret_key[i],0 ,SCTP_SECRET_SIZE ); +/* Remove and free the port */ if (sctp_sk (ep->base.sk)->bind_hash)sctp_put_port (ep->base.sk);
Greg Kroah-Hartman
maintainerPATCH 52/61 tcp: detect SYN/data drop when F-RTO is disabled
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuchung Cheng <[email protected]>
[ Upstream commit 66555e92fb7a619188c02cceae4bbc414f15f96d ]
On receiving the SYN-ACK, Fast Open checks icsk_retransmit for SYN retransmission to detect SYN/data drops. But if F-RTO is disabled, icsk_retransmit is reset at step D of tcp_fastretrans_alert() ( under tcp_ack()) before tcp_rcv_fastopen_synack(). The fix is to use total_retrans instead which accounts for SYN retransmission regardless the use of F-RTO.
--- net/ipv4/tcp_input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv4/tcp_input.c +1 -2
@@ -5639,8 +5639,7 @@ static bool tcp_rcv_fastopen_synack(stru* the remote receives only the retransmitted (regular) SYNs: either * the original SYN-data or the corresponding SYN-ACK is lost. */ - syn_drop = (cookie->len <=0 && data && -inet_csk (sk)->icsk_retransmits); + syn_drop = (cookie->len <=0 && data && tp->total_retrans);tcp_fastopen_cache_set (sk, mss, cookie, syn_drop);
Greg Kroah-Hartman
maintainerPATCH 53/61 tcp: fix an infinite loop in tcp_slow_start()
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 973ec449bb4f2b8c514bacbcb4d9506fc31c8ce3 ]
Since commit 9dc274151a548 (tcp: fix ABC in tcp_slow_start()), a nul snd_cwnd triggers an infinite loop in tcp_slow_start()
Avoid this infinite loop and log a one time error for further analysis. FRTO code is suspected to cause this bug.
--- net/ipv4/tcp_cong.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
net/ipv4/tcp_cong.c +10 -4
@@ -309,6 +309,12 @@ void tcp_slow_start(struct tcp_sock *tp) {int cnt;/* increase in packets */ unsigned int delta =0 ; +u32 snd_cwnd = tp->snd_cwnd; + +if (unlikely (!snd_cwnd)) { +pr_err_once ("snd_cwnd is nul, please report this bug.\n" ); + snd_cwnd =1U ; + }/* RFC3465: ABC Slow start * Increase only after a full MSS of bytes is acked
@@ -323,7 +329,7 @@ void tcp_slow_start(struct tcp_sock *tp)if (sysctl_tcp_max_ssthresh >0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh) cnt = sysctl_tcp_max_ssthresh >>1 ;/* limited slow start */ else - cnt = tp->snd_cwnd;/* exponential increase */ + cnt = snd_cwnd;/* exponential increase */ /* RFC3465: ABC * We MAY increase by 2 if discovered delayed ack
@@ -333,11 +339,11 @@ void tcp_slow_start(struct tcp_sock *tp) tp->bytes_acked =0 ; tp->snd_cwnd_cnt += cnt; -while (tp->snd_cwnd_cnt >= tp->snd_cwnd) { - tp->snd_cwnd_cnt -= tp->snd_cwnd; +while (tp->snd_cwnd_cnt >= snd_cwnd) { + tp->snd_cwnd_cnt -= snd_cwnd; delta++; } - tp->snd_cwnd =min (tp->snd_cwnd + delta, tp->snd_cwnd_clamp); + tp->snd_cwnd =min (snd_cwnd + delta, tp->snd_cwnd_clamp); }EXPORT_SYMBOL_GPL (tcp_slow_start);
Greg Kroah-Hartman
maintainerPATCH 54/61 tcp: frto should not set snd_cwnd to 0
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 2e5f421211ff76c17130b4597bc06df4eeead24f ]
Commit 9dc274151a548 (tcp: fix ABC in tcp_slow_start()) uncovered a bug in FRTO code :tcp_process_frto() is setting snd_cwnd to 0 if the number of in flight packets is 0.
As Neal pointed out, if no packet is in flight we lost our chance to disambiguate whether a loss timeout was spurious.
We should assume it was a proper loss.
--- net/ipv4/tcp_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/tcp_input.c +2 -1
@@ -3484,7 +3484,8 @@ static bool tcp_process_frto(struct sock ((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED))) tp->undo_marker = 0; -if (!before (tp->snd_una, tp->frto_highmark)) { +if (!before (tp->snd_una, tp->frto_highmark) || + !tcp_packets_in_flight (tp)) {tcp_enter_frto_loss (sk, (tp->frto_counter ==1 ?2 :3 ), flag);return true; }
Greg Kroah-Hartman
maintainerPATCH 55/61 tcp: fix for zero packets_in_flight was too broad
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= <[email protected]>
[ Upstream commit 6731d2095bd4aef18027c72ef845ab1087c3ba63 ]
There are transients during normal FRTO procedure during which the packets_in_flight can go to zero between write_queue state updates and firing the resulting segments out. As FRTO processing occurs during that window the check must be more precise to not match "spuriously" :-). More specificly, e.g., when packets_in_flight is zero but FLAG_DATA_ACKED is true the problematic branch that set cwnd into zero would not be taken and new segments might be sent out later.
--- net/ipv4/tcp_input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/ipv4/tcp_input.c +6 -2
@@ -3484,8 +3484,7 @@ static bool tcp_process_frto(struct sock ((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED))) tp->undo_marker = 0; -if (!before (tp->snd_una, tp->frto_highmark) || - !tcp_packets_in_flight (tp)) { +if (!before (tp->snd_una, tp->frto_highmark)) {tcp_enter_frto_loss (sk, (tp->frto_counter ==1 ?2 :3 ), flag);return true; }
@@ -3505,6 +3504,11 @@ static bool tcp_process_frto(struct sock } }else {if (!(flag &FLAG_DATA_ACKED ) && (tp->frto_counter ==1 )) { +if (!tcp_packets_in_flight (tp)) { +tcp_enter_frto_loss (sk,2 , flag); +return true; + } +/* Prevent sending of new data. */ tp->snd_cwnd =min (tp->snd_cwnd,tcp_packets_in_flight (tp));
Greg Kroah-Hartman
maintainerPATCH 56/61 tcp: dont abort splice() after small transfers
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willy Tarreau <[email protected]>
[ Upstream commit 02275a2ee7c0ea475b6f4a6428f5df592bc9d30b ]
TCP coalescing added a regression in splice(socket->pipe) performance, for some workloads because of the way tcp_read_sock() is implemented.
The reason for this is the break when (offset + 1 != skb->len).
As we released the socket lock, this condition is possible if TCP stack added a fragment to the skb, which can happen with TCP coalescing.
So let's go back to the beginning of the loop when this happens, to give a chance to splice more frags per system call.
Doing so fixes the issue and makes GRO 10% faster than LRO on CPU-bound splice() workloads instead of the opposite.
--- net/ipv4/tcp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/ipv4/tcp.c +8 -4
@@ -1490,15 +1490,19 @@ int tcp_read_sock(struct sock *sk, read_ copied += used; offset += used; } -/* -* If recv_actor drops the lock (e.g. TCP splice +/* If recv_actor drops the lock (e.g. TCP splice * receive) the skb pointer might be invalid when * getting here: tcp_collapse might have deleted it * while aggregating skbs from the socket queue. */ - skb =tcp_recv_skb (sk, seq-1 , &offset); -if (!skb || (offset+1 != skb->len)) + skb =tcp_recv_skb (sk, seq -1 , &offset); +if (!skb)break ; +/* TCP coalescing might have appended data to the skb. +* Try to splice more frags +*/ +if (offset +1 != skb->len) +continue ; }if (tcp_hdr (skb)->fin) {sk_eat_skb (sk, skb, false);
Greg Kroah-Hartman
maintainerPATCH 57/61 tcp: splice: fix an infinite loop in tcp_read_sock()
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit ff905b1e4aad8ccbbb0d42f7137f19482742ff07 ]
commit 02275a2ee7c0 (tcp: don't abort splice() after small transfers) added a regression.
[ 83.843570] INFO: rcu_sched self-detected stall on CPU
[ 83.844575] INFO: rcu_sched detected stalls on CPUs/tasks: { 6} (detected by 0, t=21002 jiffies, g=4457, c=4456, q=13132)
[ 83.844582] Task dump for CPU 6:
[ 83.844584] netperf R running task 0 8966 8952 0x0000000c
[ 83.844587] 0000000000000000 0000000000000006 0000000000006c6c 0000000000000000
[ 83.844589] 000000000000006c 0000000000000096 ffffffff819ce2bc ffffffffffffff10
[ 83.844592] ffffffff81088679 0000000000000010 0000000000000246 ffff880c4b9ddcd8
[ 83.844594] Call Trace:
[ 83.844596] [<ffffffff81088679>] ? vprintk_emit+0x1c9/0x4c0
[ 83.844601] [<ffffffff815ad449>] ? schedule+0x29/0x70
[ 83.844606] [<ffffffff81537bd2>] ? tcp_splice_data_recv+0x42/0x50
[ 83.844610] [<ffffffff8153beaa>] ? tcp_read_sock+0xda/0x260
[ 83.844613] [<ffffffff81537b90>] ? tcp_prequeue_process+0xb0/0xb0
[ 83.844615] [<ffffffff8153c0f0>] ? tcp_splice_read+0xc0/0x250
[ 83.844618] [<ffffffff814dc0c2>] ? sock_splice_read+0x22/0x30
[ 83.844622] [<ffffffff811b820b>] ? do_splice_to+0x7b/0xa0
[ 83.844627] [<ffffffff811ba4bc>] ? sys_splice+0x59c/0x5d0
[ 83.844630] [<ffffffff8119745b>] ? putname+0x2b/0x40
[ 83.844633] [<ffffffff8118bcb4>] ? do_sys_open+0x174/0x1e0
[ 83.844636] [<ffffffff815b6202>] ? system_call_fastpath+0x16/0x1bif recv_actor() returns 0, we should stop immediately, because looping wont give a chance to drain the pipe.
--- net/ipv4/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp.c +1 -1
@@ -1481,7 +1481,7 @@ int tcp_read_sock(struct sock *sk, read_break ; } used =recv_actor (desc, skb, offset, len); -if (used <0 ) { +if (used <=0 ) {if (!copied) copied = used;break ;
Greg Kroah-Hartman
maintainerPATCH 58/61 tcp: fix splice() and tcp collapsing interaction
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit f26845b43c75d3f32f98d194c1327b5b1e6b3fb0 ]
Under unusual circumstances, TCP collapse can split a big GRO TCP packet while its being used in a splice(socket->pipe) operation.
skb_splice_bits() releases the socket lock before calling splice_to_pipe().
[ 1081.353685] WARNING: at net/ipv4/tcp.c:1330 tcp_cleanup_rbuf+0x4d/0xfc() [ 1081.371956] Hardware name: System x3690 X5 -[7148Z68]- [ 1081.391820] cleanup rbuf bug: copied AD3BCF1 seq AD370AF rcvnxt AD3CF13
To fix this problem, we must eat skbs in tcp_recv_skb().
Remove the inline keyword from tcp_recv_skb() definition since it has three call sites.
--- net/ipv4/tcp.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
net/ipv4/tcp.c +10 -3
@@ -1427,12 +1427,12 @@ static void tcp_service_net_dma(struct s }#endif -static inline struct sk_buff *tcp_recv_skb (struct sock *sk,u32 seq,u32 *off) +static struct sk_buff *tcp_recv_skb (struct sock *sk,u32 seq,u32 *off) {struct sk_buff *skb;u32 offset; - skb_queue_walk(&sk->sk_receive_queue, skb) { +while ((skb =skb_peek (&sk->sk_receive_queue)) !=NULL ) { offset = seq -TCP_SKB_CB (skb)->seq;if (tcp_hdr (skb)->syn) offset--;
@@ -1440,6 +1440,11 @@ static inline struct sk_buff *tcp_recv_s *off = offset;return skb; } +/* This looks weird, but this can happen if TCP collapsing +* splitted a fat GRO packet, while we released socket lock +* in skb_splice_bits() +*/ +sk_eat_skb (sk, skb, false); }return NULL ; }
@@ -1519,8 +1524,10 @@ int tcp_read_sock(struct sock *sk, read_tcp_rcv_space_adjust (sk);/* Clean up data we have read: This will do ACK frames. */ -if (copied >0 ) +if (copied >0 ) { +tcp_recv_skb (sk, seq, &offset);tcp_cleanup_rbuf (sk, copied); + }return copied; }EXPORT_SYMBOL (tcp_read_sock);
Greg Kroah-Hartman
maintainerPATCH 59/61 net: splice: avoid high order page splitting
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 82bda6195615891181115f579a480aa5001ce7e9 ]
splice() can handle pages of any order, but network code tries hard to split them in PAGE_SIZE units. Not quite successfully anyway, as __splice_segment() assumed poff < PAGE_SIZE. This is true for the skb->data part, not necessarily for the fragments.
This patch removes this logic to give the pages as they are in the skb.
--- net/core/skbuff.c | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-)
net/core/skbuff.c +9 -29
@@ -1677,20 +1677,6 @@ static bool spd_fill_page(struct splice_return false; } -static inline void __segment_seek (struct page **page,unsigned int *poff, -unsigned int *plen,unsigned int off) -{ -unsigned long n; - - *poff += off; - n = *poff /PAGE_SIZE ; -if (n) - *page =nth_page (*page, n); - - *poff = *poff %PAGE_SIZE ; - *plen -= off; -} - static bool __splice_segment(struct page *page, unsigned int poff, unsigned int plen, unsigned int *off, unsigned int *len, struct sk_buff *skb,
@@ -1698,6 +1684,8 @@ static bool __splice_segment(struct pagestruct sock *sk, struct pipe_inode_info *pipe) { + unsigned int flen; +if (!*len)return true;
@@ -1708,24 +1696,16 @@ static bool __splice_segment(struct page }/* ignore any bits we already processed */ -if (*off) { -__segment_seek (&page, &poff, &plen, *off); - *off =0 ; - } - -do { -unsigned int flen =min (*len, plen); + poff += *off; + plen -= *off; + *off =0 ; -/* the linear region may spread across several pages */ - flen = min_t(unsigned int, flen, PAGE_SIZE - poff); + flen =min (*len, plen); -if (spd_fill_page (spd, pipe, page, &flen, poff, skb, linear, sk)) -return true; - -__segment_seek (&page, &poff, &plen, flen); - *len -= flen; +if (spd_fill_page (spd, pipe, page, &flen, poff, skb, linear, sk)) +return true; - }while (*len && plen); + *len -= flen;return false; }
Greg Kroah-Hartman
maintainerPATCH 60/61 net: splice: fix __splice_segment()
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit bc9540c637c3d8712ccbf9dcf28621f380ed5e64 ]
commit 9ca1b22d6d2 (net: splice: avoid high order page splitting) forgot that skb->head could need a copy into several page frags.
This could be the case for loopback traffic mostly.
Also remove now useless skb argument from linear_to_page() and __splice_segment() prototypes.
--- net/core/skbuff.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
net/core/skbuff.c +15 -13
@@ -1620,7 +1620,7 @@ static void sock_spd_release(struct splistatic struct page *linear_to_page (struct page *page,unsigned int *len,unsigned int *offset, -struct sk_buff *skb,struct sock *sk) +struct sock *sk) {struct page_frag *pfrag =sk_page_frag (sk);
@@ -1653,14 +1653,14 @@ static bool spd_can_coalesce(const strucstatic bool spd_fill_page (struct splice_pipe_desc *spd,struct pipe_inode_info *pipe,struct page *page,unsigned int *len,unsigned int offset, -struct sk_buff *skb,bool linear, +bool linear,struct sock *sk) {if (unlikely (spd->nr_pages ==MAX_SKB_FRAGS ))return true;if (linear) { - page =linear_to_page (page, len, &offset, skb, sk); + page =linear_to_page (page, len, &offset, sk);if (!page)return true; }
@@ -1679,13 +1679,11 @@ static bool spd_fill_page(struct splice_static bool __splice_segment (struct page *page,unsigned int poff,unsigned int plen,unsigned int *off, -unsigned int *len,struct sk_buff *skb, +unsigned int *len,struct splice_pipe_desc *spd,bool linear,struct sock *sk,struct pipe_inode_info *pipe) { -unsigned int flen; -if (!*len)return true;
@@ -1700,12 +1698,16 @@ static bool __splice_segment(struct page plen -= *off; *off =0 ; - flen =min (*len, plen); - -if (spd_fill_page (spd, pipe, page, &flen, poff, skb, linear, sk)) -return true; +do { +unsigned int flen =min (*len, plen); - *len -= flen; +if (spd_fill_page (spd, pipe, page, &flen, poff, + linear, sk)) +return true; + poff += flen; + plen -= flen; + *len -= flen; + }while (*len && plen);return false; }
@@ -1728,7 +1730,7 @@ static bool __skb_splice_bits(struct sk_if (__splice_segment (virt_to_page (skb->data), (unsigned long ) skb->data & (PAGE_SIZE -1 ),skb_headlen (skb), - offset, len, skb, spd, + offset, len, spd,skb_head_is_locked (skb), sk, pipe))return true;
@@ -1741,7 +1743,7 @@ static bool __skb_splice_bits(struct sk_if (__splice_segment (skb_frag_page (f), f->page_offset,skb_frag_size (f), - offset, len, skb, spd, false, sk, pipe)) + offset, len, spd, false, sk, pipe))return true; }
Greg Kroah-Hartman
maintainerPATCH 61/61 drm/nouveau: add lockdep annotations
In reply to Greg Kroah-Hartman3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Slusarz <[email protected]>
commit 5f97ab913cf0fbc378ea8ffc3ee66f4890d11c55 upstream.
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.
--- drivers/gpu/drm/nouveau/core/core/subdev.c | 2 +- drivers/gpu/drm/nouveau/core/include/core/object.h | 7 +++++-- drivers/gpu/drm/nouveau/nouveau_drm.c | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/core/core/subdev.c +1 -1
@@ -99,7 +99,7 @@ nouveau_subdev_create_(struct nouveau_obif (ret)return ret; -mutex_init (&subdev->mutex); +__mutex_init (&subdev->mutex, subname, &oclass->lock_class_key); subdev->name = subname;if (parent) {
drivers/gpu/drm/nouveau/core/include/core/object.h +5 -2
@@ -50,10 +50,13 @@ int nouveau_object_fini(struct nouveau_extern struct nouveau_ofuncs nouveau_object_ofuncs; +/* Don't allocate dynamically, because lockdep needs lock_class_keys to be in +* ".data". */ struct nouveau_oclass {u32 handle; -struct nouveau_ofuncs *ofuncs; -struct nouveau_omthds *omthds; +struct nouveau_ofuncs * ofuncs; +struct nouveau_omthds *const omthds; +struct lock_class_key lock_class_key; };#define nv_oclass (o) nv_object(o)->oclass
drivers/gpu/drm/nouveau/nouveau_drm.c +3 -0
@@ -241,6 +241,8 @@ nouveau_drm_probe(struct pci_dev *pdev,return 0 ; } +static struct lock_class_key drm_client_lock_class_key; +static int nouveau_drm_load (struct drm_device *dev,unsigned long flags) {
@@ -252,6 +254,7 @@ nouveau_drm_load(struct drm_device *dev, ret =nouveau_cli_create (pdev,"DRM" ,sizeof (*drm), (void **)&drm);if (ret)return ret; +lockdep_set_class (&drm->client.mutex, &drm_client_lock_class_key); dev->dev_private = drm; drm->dev = dev;
Re: [ 61/61] drm/nouveau: add lockdep annotations
Quoted 1 line · Greg Kroah-Hartman
3.7-stable review patch. If anyone has any objections, please let me know.
FWIW, I never saw this on 3.7 but it happened 1st time on 3.8-rcX I haven't tested this fix either.
Regards,
Peter Hurley
Re: [ 61/61] drm/nouveau: add lockdep annotations
Quoted 5 lines · Peter Hurley
Quoted 1 line · Greg Kroah-Hartman
3.7-stable review patch. If anyone has any objections, please let me know.
FWIW, I never saw this on 3.7 but it happened 1st time on 3.8-rcX I haven't tested this fix either.
Dito.
Gr. AvS
Re: [ 61/61] drm/nouveau: add lockdep annotations
Quoted 10 lines · Arend van Spriel
Quoted 5 lines · Peter Hurley
Quoted 1 line · Greg Kroah-Hartman
3.7-stable review patch. If anyone has any objections, please let me know.
FWIW, I never saw this on 3.7 but it happened 1st time on 3.8-rcX I haven't tested this fix either.
Dito.
Gr. AvS
Yeah, I don't believe anything could trigger it in 3.7. It doesn't hurt anyway.
Quoted 2 lines
Re: [ 61/61] drm/nouveau: add lockdep annotations
Quoted 5 lines · Ben Skeggs
Quoted 4 lines · Arend van Spriel
Quoted 3 lines · Peter Hurley
Quoted 1 line · Greg Kroah-Hartman
3.7-stable review patch. If anyone has any objections, please let me know.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
FWIW, I never saw this on 3.7 but it happened 1st time on 3.8-rcX I haven't tested this fix either.
Dito.
Gr. AvS
Yeah, I don't believe anything could trigger it in 3.7. It doesn't hurt anyway.
You are right. There could be other stable patches introducing a similar issue in 3.7 later on. Better be prepared.
Gr. AvS
Re: [ 61/61] drm/nouveau: add lockdep annotations
In reply to Ben SkeggsQuoted 5 lines · Ben Skeggs
Quoted 4 lines · Arend van Spriel
Quoted 3 lines · Peter Hurley
Quoted 1 line · Greg Kroah-Hartman
3.7-stable review patch. If anyone has any objections, please let me know.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
FWIW, I never saw this on 3.7 but it happened 1st time on 3.8-rcX I haven't tested this fix either.
Dito.
Gr. AvS
Yeah, I don't believe anything could trigger it in 3.7. It doesn't hurt anyway.
Client locking splat is definitely triggerable on 3.7:
https://lkml.org/lkml/2012/10/16/251
Subdev locking splat is triggerable since 3.7 has "drm/nouveau: add locking around instobj list operations" and "drm/nvc0/fb: fix crash when different mutex is used to protect same list" (both applied for 3.7.3).
Marcin
Re: [ 61/61] drm/nouveau: add lockdep annotations
Quoted 11 lines · Marcin Slusarz
Quoted 10 lines · Ben Skeggs
Quoted 9 lines · Arend van Spriel
Quoted 5 lines · Peter Hurley
Quoted 1 line · Greg Kroah-Hartman
3.7-stable review patch. If anyone has any objections, please let me know.
FWIW, I never saw this on 3.7 but it happened 1st time on 3.8-rcX I haven't tested this fix either.
Dito.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Gr. AvS
Yeah, I don't believe anything could trigger it in 3.7. It doesn't hurt anyway.
Client locking splat is definitely triggerable on 3.7:
https://lkml.org/lkml/2012/10/16/251Subdev locking splat is triggerable since 3.7 has "drm/nouveau: add locking
s/is/should be/
Quoted 4 lines
around instobj list operations" and "drm/nvc0/fb: fix crash when different mutex is used to protect same list" (both applied for 3.7.3).
Marcin
At Tue, 12 Feb 2013 12:34:20 -0800,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.7.8 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Feb 14 20:31:32 UTC 2013. Anything received after that time might be too late.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
- Test machine: debian wheezy x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
I reviewed the following patches and it looks good to me.
Quoted 2 lines
Stephen Hemminger <[email protected]>
MAINTAINERS: Stephen Hemminger email change
...
Quoted 2 lines
Sjur Brændeland <[email protected]>
virtio_console: Don't access uninitialized data.
Thanks,
Satoru
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.7.8 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Feb 14 20:31:32 UTC 2013. Anything received after that time might be too late.
Quoted 8 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.7.8-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches applied cleanly to 3.0.63, 3.4.30, and 3.7.7. Compiled and booted on the following systems:
HP EliteBook 6930p Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics
Cross-compile tests results:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.7.y
c6x: not applicable to 3.0.y, defconfig passed on 3.4.y, and 3.7.y.
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all
-- Shuah