* [PATCH 07/16] irda: Fix missing msg_namelen update in irda_recvmsg_dgram()
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
In-Reply-To: <1365335522-29931-1-git-send-email-minipli@googlemail.com>
The current code does not fill the msg_name member in case it is set.
It also does not set the msg_namelen member to 0 and therefore makes
net/socket.c leak the local, uninitialized sockaddr_storage variable
to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared
about irda_recvmsg_dgram() not filling the msg_name in case it was
set.
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/irda/af_irda.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index d28e7f0..e493b33 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1386,6 +1386,8 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,
IRDA_DEBUG(4, "%s()\n", __func__);
+ msg->msg_namelen = 0;
+
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
flags & MSG_DONTWAIT, &err);
if (!skb)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 06/16] caif: Fix missing msg_namelen update in caif_seqpkt_recvmsg()
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
In-Reply-To: <1365335522-29931-1-git-send-email-minipli@googlemail.com>
The current code does not fill the msg_name member in case it is set.
It also does not set the msg_namelen member to 0 and therefore makes
net/socket.c leak the local, uninitialized sockaddr_storage variable
to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared
about caif_seqpkt_recvmsg() not filling the msg_name in case it was
set.
Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/caif/caif_socket.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 095259f..ff2ff3c 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -286,6 +286,8 @@ static int caif_seqpkt_recvmsg(struct kiocb *iocb, struct socket *sock,
if (m->msg_flags&MSG_OOB)
goto read_error;
+ m->msg_namelen = 0;
+
skb = skb_recv_datagram(sk, flags, 0 , &ret);
if (!skb)
goto read_error;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 05/16] Bluetooth: SCO - Fix missing msg_namelen update in sco_sock_recvmsg()
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
In-Reply-To: <1365335522-29931-1-git-send-email-minipli@googlemail.com>
If the socket is in state BT_CONNECT2 and BT_SK_DEFER_SETUP is set in
the flags, sco_sock_recvmsg() returns early with 0 without updating the
possibly set msg_namelen member. This, in turn, leads to a 128 byte
kernel stack leak in net/socket.c.
Fix this by updating msg_namelen in this case. For all other cases it
will be handled in bt_sock_recvmsg().
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/bluetooth/sco.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index fad0302..fb6192c 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -665,6 +665,7 @@ static int sco_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) {
hci_conn_accept(pi->conn->hcon, 0);
sk->sk_state = BT_CONFIG;
+ msg->msg_namelen = 0;
release_sock(sk);
return 0;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 04/16] Bluetooth: RFCOMM - Fix missing msg_namelen update in rfcomm_sock_recvmsg()
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
In-Reply-To: <1365335522-29931-1-git-send-email-minipli@googlemail.com>
If RFCOMM_DEFER_SETUP is set in the flags, rfcomm_sock_recvmsg() returns
early with 0 without updating the possibly set msg_namelen member. This,
in turn, leads to a 128 byte kernel stack leak in net/socket.c.
Fix this by updating msg_namelen in this case. For all other cases it
will be handled in bt_sock_stream_recvmsg().
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/bluetooth/rfcomm/sock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index c23bae8..7c9224b 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -608,6 +608,7 @@ static int rfcomm_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) {
rfcomm_dlc_accept(d);
+ msg->msg_namelen = 0;
return 0;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 03/16] Bluetooth: fix possible info leak in bt_sock_recvmsg()
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
In-Reply-To: <1365335522-29931-1-git-send-email-minipli@googlemail.com>
In case the socket is already shutting down, bt_sock_recvmsg() returns
with 0 without updating msg_namelen leading to net/socket.c leaking the
local, uninitialized sockaddr_storage variable to userland -- 128 bytes
of kernel stack memory.
Fix this by moving the msg_namelen assignment in front of the shutdown
test.
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/bluetooth/af_bluetooth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index d3ee69b..0d1b08c 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -230,6 +230,8 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
if (flags & (MSG_OOB))
return -EOPNOTSUPP;
+ msg->msg_namelen = 0;
+
skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb) {
if (sk->sk_shutdown & RCV_SHUTDOWN)
@@ -237,8 +239,6 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
return err;
}
- msg->msg_namelen = 0;
-
copied = skb->len;
if (len < copied) {
msg->msg_flags |= MSG_TRUNC;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 02/16] ax25: fix info leak via msg_name in ax25_recvmsg()
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
In-Reply-To: <1365335522-29931-1-git-send-email-minipli@googlemail.com>
When msg_namelen is non-zero the sockaddr info gets filled out, as
requested, but the code fails to initialize the padding bytes of struct
sockaddr_ax25 inserted by the compiler for alignment. Additionally the
msg_namelen value is updated to sizeof(struct full_sockaddr_ax25) but is
not always filled up to this size.
Both issues lead to the fact that the code will leak uninitialized
kernel stack bytes in net/socket.c.
Fix both issues by initializing the memory with memset(0).
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/ax25/af_ax25.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 7b11f8b..e277e38 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1642,6 +1642,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
ax25_address src;
const unsigned char *mac = skb_mac_header(skb);
+ memset(sax, 0, sizeof(struct full_sockaddr_ax25));
ax25_addr_parse(mac + 1, skb->data - mac - 1, &src, NULL,
&digi, NULL, NULL);
sax->sax25_family = AF_AX25;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 01/16] atm: update msg_namelen in vcc_recvmsg()
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
In-Reply-To: <1365335522-29931-1-git-send-email-minipli@googlemail.com>
The current code does not fill the msg_name member in case it is set.
It also does not set the msg_namelen member to 0 and therefore makes
net/socket.c leak the local, uninitialized sockaddr_storage variable
to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared
about vcc_recvmsg() not filling the msg_name in case it was set.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/atm/common.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/atm/common.c b/net/atm/common.c
index 7b49100..737bef5 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -531,6 +531,8 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
struct sk_buff *skb;
int copied, error = -EINVAL;
+ msg->msg_namelen = 0;
+
if (sock->state != SS_CONNECTED)
return -ENOTCONN;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 00/16] info leak fixes in recvmsg
From: Mathias Krause @ 2013-04-07 11:51 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Allan Stephens, Aloisio Almeida Jr, Andy King,
Arnaldo Carvalho de Melo, Dmitry Torokhov, George Zhang,
Gustavo Padovan, Johan Hedberg, Jon Maloy, Lauro Ramos Venancio,
Marcel Holtmann, Ralf Baechle, Samuel Ortiz, Samuel Ortiz,
Sjur Braendeland, Ursula Braun, Brad Spengler, Mathias Krause
Hi Dave,
a few more info leak fixes in the recvmsg path. The error pattern here
is the protocol specific recvmsg function is missing the msg_namelen
assignment -- either completely or in early exit paths that do not
result in errors in __sys_recvmsg()/sys_recvfrom() and, in turn, make
them call move_addr_to_user(), leaking the then still uninitialized
sockaddr_storage stack variable to userland.
My audit was initiated by a rather coarse fix of the leak that can be
found in the grsecurity patch, putting a penalty on protocols complying
to the rules of recvmsg. So credits for finding the leak in the recvmsg
path in __sys_recvmsg() should go to Brad!
The buggy protocols/subsystems are rather obscure anyway. As a missing
assignment of msg_namelen coupled with a missing filling of msg_name
would only result in garbage -- the leak -- in case userland would care
about that information, i.e. would provide a msg_name pointer. But
obviously current userland does not.
While auditing the code for the above pattern I found a few more
'uninitialized members' kind of leaks related to the msg_name filling.
Those are fixed in this series, too.
I have to admit, I failed to test all of the patches due to missing
hardware, e.g. iucv depends on S390 -- hardware I've no access to :/
Please apply!
Mathias Krause (16):
atm: update msg_namelen in vcc_recvmsg()
ax25: fix info leak via msg_name in ax25_recvmsg()
Bluetooth: fix possible info leak in bt_sock_recvmsg()
Bluetooth: RFCOMM - Fix missing msg_namelen update in
rfcomm_sock_recvmsg()
Bluetooth: SCO - Fix missing msg_namelen update in sco_sock_recvmsg()
caif: Fix missing msg_namelen update in caif_seqpkt_recvmsg()
irda: Fix missing msg_namelen update in irda_recvmsg_dgram()
iucv: Fix missing msg_namelen update in iucv_sock_recvmsg()
l2tp: fix info leak in l2tp_ip6_recvmsg()
llc: Fix missing msg_namelen update in llc_ui_recvmsg()
netrom: fix info leak via msg_name in nr_recvmsg()
NFC: llcp: fix info leaks via msg_name in llcp_sock_recvmsg()
rose: fix info leak via msg_name in rose_recvmsg()
tipc: fix info leaks via msg_name in recv_msg/recv_stream
VSOCK: vmci - fix possible info leak in
vmci_transport_dgram_dequeue()
VSOCK: Fix missing msg_namelen update in vsock_stream_recvmsg()
net/atm/common.c | 2 ++
net/ax25/af_ax25.c | 1 +
net/bluetooth/af_bluetooth.c | 4 ++--
net/bluetooth/rfcomm/sock.c | 1 +
net/bluetooth/sco.c | 1 +
net/caif/caif_socket.c | 2 ++
net/irda/af_irda.c | 2 ++
net/iucv/af_iucv.c | 2 ++
net/l2tp/l2tp_ip6.c | 1 +
net/llc/af_llc.c | 2 ++
net/netrom/af_netrom.c | 1 +
net/nfc/llcp/sock.c | 3 +++
net/rose/af_rose.c | 1 +
net/tipc/socket.c | 7 +++++++
net/vmw_vsock/af_vsock.c | 2 ++
net/vmw_vsock/vmci_transport.c | 3 ++-
16 files changed, 32 insertions(+), 3 deletions(-)
--
1.7.10.4
^ permalink raw reply
* Re: net_dropmon usage documentation/examples?
From: Eric Wong @ 2013-04-07 11:28 UTC (permalink / raw)
To: Neil Horman
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-man-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20130406123856.GA11355-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> wrote:
> On Fri, Apr 05, 2013 at 07:38:55PM +0000, Eric Wong wrote:
> > Hi Neil, I'm wondering if you have or know of any public
> > documentation/examples for using net_dropmon.
> >
> > If not, I'll figure it out on my own at some point.
> >
> > Thanks in advance!
>
> I don't think there are any particular examples at the moment, but if you
> download the dropwatch utility, it uses the dropmon protocol to detect frame
> loss in the stack, and its use is pretty self explanitory, as is the perf script
> that uses the same tracepoints as the dropmon protocol.
>
>
> https://fedorahosted.org/dropwatch/
Thanks Neil! I think I'll just use dropwatch directly instead of
writing my own code, now :)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] net: of_mdio: scan mdiobus for PHYs without reg property
From: Sebastian Hesselbarth @ 2013-04-07 11:09 UTC (permalink / raw)
To: Sebastian Hesselbarth
Cc: Grant Likely, Rob Herring, Florian Fainelli, devicetree-discuss,
netdev, linux-kernel
In-Reply-To: <1365332988-9053-1-git-send-email-sebastian.hesselbarth@gmail.com>
Using DT for mdiobus and ethernet-phy requires to know the PHY address, which
is hard to guess if you don't know it. This patch extends of_mdiobus_register
to scan mdiobus for PHYs if reg property of the corresponding node is not set.
This also allows to have phy nodes in SoC DT files where the reg property can
be overwritten in the board file later. To encourage people to finally set the
actual phy address, the mdiobus scan is noisier than required.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/of/of_mdio.c | 64 +++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 58 insertions(+), 6 deletions(-)
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index e3a8b22..23049ae 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -34,7 +34,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
{
struct phy_device *phy;
struct device_node *child;
- int rc, i;
+ const __be32 *paddr;
+ u32 addr;
+ bool is_c45, scanphys = false;
+ int rc, i, len;
/* Mask out all PHYs from auto probing. Instead the PHYs listed in
* the device tree are populated after the bus has been registered */
@@ -54,14 +57,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
/* Loop over the child nodes and register a phy_device for each one */
for_each_available_child_of_node(np, child) {
- const __be32 *paddr;
- u32 addr;
- int len;
- bool is_c45;
-
/* A PHY must have a reg property in the range [0-31] */
paddr = of_get_property(child, "reg", &len);
if (!paddr || len < sizeof(*paddr)) {
+ scanphys = true;
dev_err(&mdio->dev, "%s has invalid PHY address\n",
child->full_name);
continue;
@@ -111,6 +110,59 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
child->name, addr);
}
+ if (!scanphys)
+ return 0;
+
+ /* auto scan for PHYs with empty reg property */
+ for_each_available_child_of_node(np, child) {
+ /* Skip PHYs with reg property set */
+ paddr = of_get_property(child, "reg", &len);
+ if (paddr)
+ continue;
+
+ is_c45 = of_device_is_compatible(child,
+ "ethernet-phy-ieee802.3-c45");
+
+ for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
+ /* skip already registered PHYs */
+ if (mdio->phy_map[addr])
+ continue;
+
+ /* be noisy to encourage people to set reg property */
+ dev_info(&mdio->dev, "scan phy %s at address %i\n",
+ child->name, addr);
+
+ phy = get_phy_device(mdio, addr, is_c45);
+ if (!phy || IS_ERR(phy))
+ continue;
+
+ if (mdio->irq) {
+ mdio->irq[addr] =
+ irq_of_parse_and_map(child, 0);
+ if (!mdio->irq[addr])
+ mdio->irq[addr] = PHY_POLL;
+ }
+
+ /* Associate the OF node with the device structure so it
+ * can be looked up later */
+ of_node_get(child);
+ phy->dev.of_node = child;
+
+ /* All data is now stored in the phy struct;
+ * register it */
+ rc = phy_device_register(phy);
+ if (rc) {
+ phy_device_free(phy);
+ of_node_put(child);
+ continue;
+ }
+
+ dev_info(&mdio->dev, "registered phy %s at address %i\n",
+ child->name, addr);
+ break;
+ }
+ }
+
return 0;
}
EXPORT_SYMBOL(of_mdiobus_register);
--
1.7.10.4
^ permalink raw reply related
* [PATCH] net: mvmdio: get and enable optional clock
From: Sebastian Hesselbarth @ 2013-04-07 11:09 UTC (permalink / raw)
To: Sebastian Hesselbarth
Cc: David S. Miller, Florian Fainelli, Thomas Petazzoni,
Greg Kroah-Hartman, netdev, linux-kernel
Marvell mdio driver uses internal registers that can be clock gated on
some SoCs. This patch just adds optional clock handling, to allow to pass
and enable the corresponding clock.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/marvell/mvmdio.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index 7b5158f..e2f6626 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -28,6 +28,7 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/io.h>
+#include <linux/clk.h>
#include <linux/of_mdio.h>
#include <linux/sched.h>
#include <linux/wait.h>
@@ -46,6 +47,7 @@
struct orion_mdio_dev {
struct mutex lock;
void __iomem *regs;
+ struct clk *clk;
/*
* If we have access to the error interrupt pin (which is
* somewhat misnamed as it not only reflects internal errors
@@ -230,6 +232,10 @@ static int orion_mdio_probe(struct platform_device *pdev)
init_waitqueue_head(&dev->smi_busy_wait);
+ dev->clk = devm_clk_get(&pdev->dev, NULL);
+ if (!IS_ERR(dev->clk))
+ clk_prepare_enable(dev->clk);
+
dev->err_interrupt = platform_get_irq(pdev, 0);
if (dev->err_interrupt != -ENXIO) {
ret = devm_request_irq(&pdev->dev, dev->err_interrupt,
@@ -258,6 +264,8 @@ static int orion_mdio_probe(struct platform_device *pdev)
return 0;
out_mdio:
+ if (!IS_ERR(dev->clk))
+ clk_disable_unprepare(dev->clk);
kfree(bus->irq);
mdiobus_free(bus);
return ret;
@@ -272,6 +280,9 @@ static int orion_mdio_remove(struct platform_device *pdev)
mdiobus_unregister(bus);
kfree(bus->irq);
mdiobus_free(bus);
+ if (!IS_ERR(dev->clk))
+ clk_disable_unprepare(dev->clk);
+
return 0;
}
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] net: mvneta: enable features before registering the driver
From: Thomas Petazzoni @ 2013-04-07 10:11 UTC (permalink / raw)
To: Willy Tarreau; +Cc: netdev
In-Reply-To: <20130406184701.GA16142@1wt.eu>
Dear Willy Tarreau,
On Sat, 6 Apr 2013 20:47:01 +0200, Willy Tarreau wrote:
> From 005eb7594a4304eed5e9b427ca6b745260c9eded Mon Sep 17 00:00:00 2001
> From: Willy Tarreau <w@1wt.eu>
> Date: Mon, 11 Mar 2013 07:56:58 +0100
> Subject: [PATCH] net: mvneta: enable features before registering the
> driver, not after
>
> It seems that the reason why the dev features were ignored was because
> they were enabled after registeration.
>
> Signed-off-by: Willy Tarreau <w@1wt.eu>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH 4/5] tipc: add InfiniBand media type
From: Patrick McHardy @ 2013-04-07 9:43 UTC (permalink / raw)
To: Bart Van Assche
Cc: jon.maloy, allan.stephens, netdev, roland, sean.hefty,
hal.rosenstock, linux-rdma
In-Reply-To: <51613A0A.3060706@acm.org>
On Sun, Apr 07, 2013 at 11:19:06AM +0200, Bart Van Assche wrote:
> On 04/03/13 14:43, Patrick McHardy wrote:
> >diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
> >+#ifdef CONFIG_TIPC_MEDIA_IB
> >+int tipc_ib_media_start(void);
> >+void tipc_ib_media_stop(void);
> >+#else
> >+int tipc_ib_media_start(void) { return 0; }
> >+void tipc_ib_media_stop(void) { return; }
> >+#endif
>
> Is the above a definition of a non-inline function pair in a header
> file ? I'm afraid that will cause trouble when including that header
> file in more than one source file.
Oops right, I'll fix that up.
^ permalink raw reply
* [PATCH 2/2] net: ks8851: Use dev_pm_ops
From: Lars-Peter Clausen @ 2013-04-07 9:33 UTC (permalink / raw)
To: David S. Miller; +Cc: Ben Dooks, netdev, linux-kernel, Lars-Peter Clausen
In-Reply-To: <1365327184-22956-1-git-send-email-lars@metafoo.de>
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/net/ethernet/micrel/ks8851.c | 37 +++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 84ca876..2d786b4 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -1364,35 +1364,39 @@ static int ks8851_read_selftest(struct ks8851_net *ks)
/* driver bus management functions */
-#ifdef CONFIG_PM
-static int ks8851_suspend(struct spi_device *spi, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+
+static int ks8851_suspend(struct device *dev)
{
- struct ks8851_net *ks = dev_get_drvdata(&spi->dev);
- struct net_device *dev = ks->netdev;
+ struct ks8851_net *ks = dev_get_drvdata(dev);
+ struct net_device *netdev = ks->netdev;
- if (netif_running(dev)) {
- netif_device_detach(dev);
- ks8851_net_stop(dev);
+ if (netif_running(netdev)) {
+ netif_device_detach(netdev);
+ ks8851_net_stop(netdev);
}
return 0;
}
-static int ks8851_resume(struct spi_device *spi)
+static int ks8851_resume(struct device *dev)
{
- struct ks8851_net *ks = dev_get_drvdata(&spi->dev);
- struct net_device *dev = ks->netdev;
+ struct ks8851_net *ks = dev_get_drvdata(dev);
+ struct net_device *netdev = ks->netdev;
- if (netif_running(dev)) {
- ks8851_net_open(dev);
- netif_device_attach(dev);
+ if (netif_running(netdev)) {
+ ks8851_net_open(netdev);
+ netif_device_attach(netdev);
}
return 0;
}
+
+static SIMPLE_DEV_PM_OPS(ks8851_pm_ops, ks8851_suspend, ks8851_resume);
+#define KS8851_PM_OPS (&ks8851_pm_ops)
+
#else
-#define ks8851_suspend NULL
-#define ks8851_resume NULL
+#define KS8851_PM_OPS NULL
#endif
static int ks8851_probe(struct spi_device *spi)
@@ -1532,11 +1536,10 @@ static struct spi_driver ks8851_driver = {
.driver = {
.name = "ks8851",
.owner = THIS_MODULE,
+ .pm = KS8851_PM_OPS,
},
.probe = ks8851_probe,
.remove = ks8851_remove,
- .suspend = ks8851_suspend,
- .resume = ks8851_resume,
};
module_spi_driver(ks8851_driver);
--
1.8.0
^ permalink raw reply related
* [PATCH 1/2] net: ks8851: Use module_spi_driver
From: Lars-Peter Clausen @ 2013-04-07 9:33 UTC (permalink / raw)
To: David S. Miller; +Cc: Ben Dooks, netdev, linux-kernel, Lars-Peter Clausen
By using module_spi_driver we can eliminate a few lines of boilerplate code.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/net/ethernet/micrel/ks8851.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 8fb4812..84ca876 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -1538,19 +1538,7 @@ static struct spi_driver ks8851_driver = {
.suspend = ks8851_suspend,
.resume = ks8851_resume,
};
-
-static int __init ks8851_init(void)
-{
- return spi_register_driver(&ks8851_driver);
-}
-
-static void __exit ks8851_exit(void)
-{
- spi_unregister_driver(&ks8851_driver);
-}
-
-module_init(ks8851_init);
-module_exit(ks8851_exit);
+module_spi_driver(ks8851_driver);
MODULE_DESCRIPTION("KS8851 Network driver");
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
--
1.8.0
^ permalink raw reply related
* Re: [PATCH 4/5] tipc: add InfiniBand media type
From: Bart Van Assche @ 2013-04-07 9:19 UTC (permalink / raw)
To: Patrick McHardy
Cc: jon.maloy-IzeFyvvaP7pWk0Htik3J/w,
allan.stephens-CWA4WttNNZF54TAoqtyWWQ,
netdev-u79uwXL29TY76Z2rM5mHXA, roland-DgEjT+Ai2ygdnm+yROfE0A,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1364993010-15515-5-git-send-email-kaber-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
On 04/03/13 14:43, Patrick McHardy wrote:
> diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
> +#ifdef CONFIG_TIPC_MEDIA_IB
> +int tipc_ib_media_start(void);
> +void tipc_ib_media_stop(void);
> +#else
> +int tipc_ib_media_start(void) { return 0; }
> +void tipc_ib_media_stop(void) { return; }
> +#endif
Is the above a definition of a non-inline function pair in a header file
? I'm afraid that will cause trouble when including that header file in
more than one source file.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 4/5] tipc: add InfiniBand media type
From: Ying Xue @ 2013-04-07 9:07 UTC (permalink / raw)
To: Patrick McHardy
Cc: jon.maloy-IzeFyvvaP7pWk0Htik3J/w,
allan.stephens-CWA4WttNNZF54TAoqtyWWQ,
netdev-u79uwXL29TY76Z2rM5mHXA, roland-DgEjT+Ai2ygdnm+yROfE0A,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1364993010-15515-5-git-send-email-kaber-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
> --- a/net/tipc/core.c
> +++ b/net/tipc/core.c
> @@ -82,6 +82,7 @@ static void tipc_core_stop_net(void)
> {
> tipc_net_stop();
> tipc_eth_media_stop();
> + tipc_ib_media_stop();
> }
>
> /**
> @@ -93,8 +94,17 @@ int tipc_core_start_net(unsigned long addr)
>
> tipc_net_start(addr);
> res = tipc_eth_media_start();
> - if (res)
> - tipc_core_stop_net();
> + if (res < 0)
> + goto err1;
> + res = tipc_ib_media_start();
> + if (res < 0)
> + goto err2;
> + return res;
> +
> +err2:
> + tipc_eth_media_stop();
Why do we need to call tipc_eth_media_stop() separately?
In any failed case, we will finally invoke tipc_core_stop_net() which
already places tipc_eth_media_stop().
> +err1:
> + tipc_core_stop_net();
> return res;
> }
>
Regards,
Ying
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] kernel: audit: beautify code, for extern function, better to check its parameters by itself
From: Chen Gang @ 2013-04-07 8:55 UTC (permalink / raw)
To: Al Viro, eparis; +Cc: David Miller, linux-kernel@vger.kernel.org, netdev
__audit_socketcall is an extern function.
better to check its parameters by itself.
also can return error code, when fail (find invalid parameters).
also use macro instead of real hard code number
also give related comments for it.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
include/linux/audit.h | 12 ++++++++----
kernel/auditsc.c | 9 ++++++---
net/socket.c | 6 ++++--
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 5a6d718..3fe9b7b 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -84,6 +84,9 @@ extern int audit_classify_arch(int arch);
#define AUDIT_TYPE_CHILD_DELETE 3 /* a child being deleted */
#define AUDIT_TYPE_CHILD_CREATE 4 /* a child being created */
+/* maximized args number that audit_socketcall can process */
+#define AUDITSC_ARGS 6
+
struct filename;
#ifdef CONFIG_AUDITSYSCALL
@@ -190,7 +193,7 @@ extern void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk
extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
extern int __audit_bprm(struct linux_binprm *bprm);
-extern void __audit_socketcall(int nargs, unsigned long *args);
+extern int __audit_socketcall(int nargs, unsigned long *args);
extern int __audit_sockaddr(int len, void *addr);
extern void __audit_fd_pair(int fd1, int fd2);
extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr);
@@ -224,10 +227,11 @@ static inline int audit_bprm(struct linux_binprm *bprm)
return __audit_bprm(bprm);
return 0;
}
-static inline void audit_socketcall(int nargs, unsigned long *args)
+static inline int audit_socketcall(int nargs, unsigned long *args)
{
if (unlikely(!audit_dummy_context()))
- __audit_socketcall(nargs, args);
+ return __audit_socketcall(nargs, args);
+ return 0;
}
static inline int audit_sockaddr(int len, void *addr)
{
@@ -354,7 +358,7 @@ static inline int audit_bprm(struct linux_binprm *bprm)
{
return 0;
}
-static inline void audit_socketcall(int nargs, unsigned long *args)
+static inline int audit_socketcall(int nargs, unsigned long *args)
{ }
static inline void audit_fd_pair(int fd1, int fd2)
{ }
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index a371f85..91270f0 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -226,7 +226,7 @@ struct audit_context {
union {
struct {
int nargs;
- long args[6];
+ long args[AUDITSC_ARGS];
} socketcall;
struct {
kuid_t uid;
@@ -2477,17 +2477,20 @@ int __audit_bprm(struct linux_binprm *bprm)
/**
* audit_socketcall - record audit data for sys_socketcall
- * @nargs: number of args
+ * @nargs: number of args, which should not be more than AUDITSC_ARGS.
* @args: args array
*
*/
-void __audit_socketcall(int nargs, unsigned long *args)
+int __audit_socketcall(int nargs, unsigned long *args)
{
struct audit_context *context = current->audit_context;
+ if (nargs <= 0 || nargs > AUDITSC_ARGS || !args)
+ return -EINVAL;
context->type = AUDIT_SOCKETCALL;
context->socketcall.nargs = nargs;
memcpy(context->socketcall.args, args, nargs * sizeof(unsigned long));
+ return 0;
}
/**
diff --git a/net/socket.c b/net/socket.c
index 88f759a..122e460 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2434,7 +2434,7 @@ static const unsigned char nargs[21] = {
SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
{
- unsigned long a[6];
+ unsigned long a[AUDITSC_ARGS];
unsigned long a0, a1;
int err;
unsigned int len;
@@ -2450,7 +2450,9 @@ SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
if (copy_from_user(a, args, len))
return -EFAULT;
- audit_socketcall(nargs[call] / sizeof(unsigned long), a);
+ err = audit_socketcall(nargs[call] / sizeof(unsigned long), a);
+ if (err)
+ return err;
a0 = a[0];
a1 = a[1];
--
1.7.7.6
^ permalink raw reply related
* [PATCH 3.8-stable] r8169: fix auto speed down issue
From: Jonghwan Choi @ 2013-04-07 2:17 UTC (permalink / raw)
To: Realtek linux nic maintainers, hayeswang
Cc: stable, netdev, David S. Miller, Jonghwan Choi
From: hayeswang <hayeswang@realtek.com>
This patch looks like it should be in the 3.8-stable tree, should we apply
it?
------------------
From: "hayeswang <hayeswang@realtek.com>"
commit e2409d83434d77874b461b78af6a19cd6e6a1280 upstream
It would cause no link after suspending or shutdowning when the
nic changes the speed to 10M and connects to a link partner which
forces the speed to 100M.
Check the link partner ability to determine which speed to set.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
drivers/net/ethernet/realtek/r8169.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 998974f..2d849da 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3819,6 +3819,30 @@ static void rtl_init_mdio_ops(struct rtl8169_private *tp)
}
}
+static void rtl_speed_down(struct rtl8169_private *tp)
+{
+ u32 adv;
+ int lpa;
+
+ rtl_writephy(tp, 0x1f, 0x0000);
+ lpa = rtl_readphy(tp, MII_LPA);
+
+ if (lpa & (LPA_10HALF | LPA_10FULL))
+ adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full;
+ else if (lpa & (LPA_100HALF | LPA_100FULL))
+ adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
+ ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full;
+ else
+ adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
+ ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
+ (tp->mii.supports_gmii ?
+ ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full : 0);
+
+ rtl8169_set_speed(tp->dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
+ adv);
+}
+
static void rtl_wol_suspend_quirk(struct rtl8169_private *tp)
{
void __iomem *ioaddr = tp->mmio_addr;
@@ -3849,9 +3873,7 @@ static bool rtl_wol_pll_power_down(struct rtl8169_private *tp)
if (!(__rtl8169_get_wol(tp) & WAKE_ANY))
return false;
- rtl_writephy(tp, 0x1f, 0x0000);
- rtl_writephy(tp, MII_BMCR, 0x0000);
-
+ rtl_speed_down(tp);
rtl_wol_suspend_quirk(tp);
return true;
--
1.7.10.4
^ permalink raw reply related
* Re: 3.9.0-rc5-ge24b0bfa: e1000e transmit queue 0 timed out
From: Sami Farin @ 2013-04-06 20:55 UTC (permalink / raw)
To: Linux Networking Mailing List
In-Reply-To: <20130406203948.dv7ef4xrc3ylt24p@m.safari.iki.fi>
OK, probably harmless warning, coincided with Saunalahti 3G
connection troubles.. :)
--
Do what you love because life is too short for anything else.
^ permalink raw reply
* 3.9.0-rc5-ge24b0bfa: e1000e transmit queue 0 timed out
From: Sami Farin @ 2013-04-06 20:39 UTC (permalink / raw)
To: Linux Networking Mailing List
3.8.0-rc4-g5da1f worked OK for 70 days.
Actually, this is the first bug I see with e1000e.
It crashed when I sent a bunch of DNS packets out.
[94334.691772] WARNING: at net/sched/sch_generic.c:255 dev_watchdog+0x23c/0x245()
[94334.691775] Hardware name: System Product Name
[94334.691777] NETDEV WATCHDOG: eth0 (e1000e): transmit queue 0 timed out
[94334.691779] Modules linked in: nls_iso8859_1 nls_cp437 fuse xt_CLASSIFY ipt_ECN xt_length xt_connmark xt_connlimit ip_set_hash_net xt_set xt_multiport snd_usb_audio snd_usbmidi_lib snd_hwdep snd_rawmidi arptable_filter arp_tables ip6t_rt nf_conntrack_ipv6 nf_defrag_ipv6 ipt_REJECT xt_limit xt_LOG xt_hashlimit xt_owner nf_conntrack_ipv4 nf_defrag_ipv4 xt_tcpudp xt_conntrack ip6table_filter ip6table_mangle ip6_tables iptable_filter iptable_mangle iptable_raw ip_tables bridge stp llc tcp_yeah tcp_westwood tcp_veno tcp_vegas tcp_scalable tcp_lp tcp_illinois tcp_hybla tcp_htcp tcp_highspeed ip_set sch_netem sch_hfsc sch_htb sch_sfq cls_fw cls_u32 cls_route sch_ingress sch_red sch_tbf sch_teql sch_prio sch_fq_codel sch_codel sch_gred sch_qfq cls_rsvp cls_rsvp6 cls_tcindex snd_hda_intel sch_cb
q sch_dsmark
[94334.691836] nf_conntrack_netlink nfnetlink hfsplus usbnet mii usbmon at24 at25 uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev pps_ldisc pl2303 af_key xfrm4_tunnel esp4 ah4 ipcomp xfrm_ipcomp ipip udf vfat fat oprofile nf_conntrack x_tables dccp_diag dccp cmtp kernelcapi loop ppdev parport_pc lp parport i2c_dev ppp_async ppp_generic slhc ftdi_sio usbserial tun rfcomm bnep w83627ehf hwmon_vid coretemp snd_hda_codec_hdmi snd_hda_codec_realtek hwmon e1000e snd_hda_codec acpi_cpufreq snd_seq snd_seq_device btusb mperf freq_table snd_pcm iTCO_wdt iTCO_vendor_support ptp snd_page_alloc pps_core snd_timer rtc_cmos bluetooth snd soundcore rfkill mei i2c_i801 lpc_ich mxm_wmi wmi kvm binfmt_misc tcp_cubic ecryptfs autofs4 i915 drm_kms_helper video button [last unloaded: pcspk
r]
[94334.691890] Pid: 0, comm: swapper/2 Not tainted 3.9.0-rc5-ge24b0bfa+ #66
[94334.691891] Call Trace:
[94334.691892] <IRQ> [<ffffffff81061083>] warn_slowpath_common+0x6b/0x98
[94334.691898] [<ffffffff810610f7>] warn_slowpath_fmt+0x47/0x49
[94334.691901] [<ffffffff8163a9e3>] dev_watchdog+0x23c/0x245
[94334.691903] [<ffffffff8163a7a7>] ? dev_graft_qdisc+0x6c/0x6c
[94334.691905] [<ffffffff8106f2d6>] call_timer_fn+0x8a/0x16d
[94334.691907] [<ffffffff8106f2a6>] ? call_timer_fn+0x5a/0x16d
[94334.691909] [<ffffffff8163a7a7>] ? dev_graft_qdisc+0x6c/0x6c
[94334.691911] [<ffffffff8106fbfc>] run_timer_softirq+0x1b6/0x28b
[94334.691913] [<ffffffff81068943>] __do_softirq+0xdc/0x219
[94334.691915] [<ffffffff81068b86>] irq_exit+0x5c/0x67
[94334.691917] [<ffffffff81021e69>] smp_apic_timer_interrupt+0x69/0x97
[94334.691920] [<ffffffff817294ca>] apic_timer_interrupt+0x6a/0x70
[94334.691921] <EOI> [<ffffffff81009b01>] ? default_idle+0x47/0xe5
[94334.691926] [<ffffffff8100a41b>] cpu_idle+0xb2/0xcc
[94334.691929] [<ffffffff8171673d>] start_secondary+0x216/0x218
[94334.691930] ---[ end trace 4bd208232dfb8438 ]---
[94334.692002] e1000e 0000:00:19.0 eth0: Reset adapter unexpectedly
[94336.539874] e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: Rx/Tx
Asus P8Z68-V PRO GEN3 mobo
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
00:1c.6 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)
00:1c.7 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation Z68 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
03:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller
04:00.0 SATA controller: JMicron Technology Corp. JMB362 SATA Controller (rev 10)
05:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller
06:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 01)
07:02.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)
08:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller (rev 11)
qdisc htb 1: root refcnt 2 r2q 10 default 19 direct_packets_stat 0 ver 3.17
Sent 90062531 bytes 993345 pkt (dropped 0, overlimits 6141 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 11: parent 1:11 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 16968493 bytes 51685 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1013 drop_overlimit 0 new_flow_count 23536 ecn_mark 0
new_flows_len 1 old_flows_len 3
qdisc fq_codel 12: parent 1:12 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 53860052 bytes 855858 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 256 drop_overlimit 0 new_flow_count 46440 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc fq_codel 13: parent 1:13 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 123970 bytes 1401 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 256 drop_overlimit 0 new_flow_count 1199 ecn_mark 0
new_flows_len 0 old_flows_len 1
qdisc fq_codel 19: parent 1:19 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 348880 bytes 1937 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1514 drop_overlimit 0 new_flow_count 112 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc fq_codel 20: parent 1:20 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 88982 bytes 498 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1514 drop_overlimit 0 new_flow_count 86 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 21: parent 1:21 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 6092165 bytes 4221 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1514 drop_overlimit 0 new_flow_count 71 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 22: parent 1:22 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 6041816 bytes 5902 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1514 drop_overlimit 0 new_flow_count 1472 ecn_mark 0
new_flows_len 0 old_flows_len 1
qdisc fq_codel 30: parent 1:30 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 5767604 bytes 72912 pkt (dropped 1319, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 256 drop_overlimit 0 new_flow_count 67956 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc fq_codel 31: parent 1:31 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 256 drop_overlimit 0 new_flow_count 0 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 32: parent 1:32 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
Sent 963816 bytes 1431 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1514 drop_overlimit 0 new_flow_count 241 ecn_mark 0
new_flows_len 0 old_flows_len 0
class htb 1:22 parent 1:1 leaf 22: prio 2 quantum 1600 rate 200000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 800000b/1 mpu 0b overhead 0b level 0
Sent 6041816 bytes 5902 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 4294 borrowed: 1608 giants: 0
tokens: 56280000 ctokens: 63984560
class htb 1:11 parent 1:1 leaf 11: prio 1 quantum 1600 rate 100000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600000b/1 mpu 0b overhead 0b level 0
Sent 16969097 bytes 51689 pkt (dropped 0, overlimits 0 requeues 0)
rate 480bit 0pps backlog 0b 0p requeues 0
lended: 43551 borrowed: 8138 giants: 0
tokens: 116080000 ctokens: 127988080
class htb 1:32 parent 1:1 leaf 32: prio 4 quantum 1600 rate 100000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600000b/1 mpu 0b overhead 0b level 0
Sent 963816 bytes 1431 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 1385 borrowed: 46 giants: 0
tokens: 122720000 ctokens: 127994720
class htb 1:1 root rate 100000Kbit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600b/1 mpu 0b overhead 0b level 7
Sent 90071579 bytes 993458 pkt (dropped 0, overlimits 0 requeues 0)
rate 7040bit 11pps backlog 0b 0p requeues 0
lended: 45569 borrowed: 0 giants: 0
tokens: 122240 ctokens: 122240
class htb 1:31 parent 1:1 leaf 31: prio 4 quantum 1600 rate 100000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600000b/1 mpu 0b overhead 0b level 0
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 128000000 ctokens: 128000
class htb 1:13 parent 1:1 leaf 13: prio 0 quantum 1600 rate 100000bit ceil 300000bit burst 1600b/1 mpu 0b overhead 0b cburst 4800b/1 mpu 0b overhead 0b level 0
Sent 124158 bytes 1403 pkt (dropped 0, overlimits 0 requeues 0)
rate 56bit 0pps backlog 0b 0p requeues 0
lended: 1403 borrowed: 0 giants: 0
tokens: 120800000 ctokens: 125600001
class htb 1:20 parent 1:1 leaf 20: prio 2 quantum 1600 rate 100000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600000b/1 mpu 0b overhead 0b level 0
Sent 88982 bytes 498 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 498 borrowed: 0 giants: 0
tokens: 123680000 ctokens: 127995680
class htb 1:30 parent 1:1 leaf 30: prio 1 quantum 1600 rate 100000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600000b/1 mpu 0b overhead 0b level 0
Sent 5582613 bytes 70519 pkt (dropped 0, overlimits 0 requeues 0)
rate 6480bit 11pps backlog 0b 0p requeues 0
lended: 38294 borrowed: 32225 giants: 0
tokens: 109923209 ctokens: 127994240
class htb 1:12 parent 1:1 leaf 12: prio 1 quantum 1600 rate 1000Kbit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 160000b/1 mpu 0b overhead 0b level 0
Sent 53860052 bytes 855858 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 855854 borrowed: 4 giants: 0
tokens: 11978532 ctokens: 12794720
class htb 1:21 parent 1:1 leaf 21: prio 2 quantum 1600 rate 100000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600000b/1 mpu 0b overhead 0b level 0
Sent 6092165 bytes 4221 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 725 borrowed: 3496 giants: 0
tokens: 123680000 ctokens: 127995680
class htb 1:19 parent 1:1 leaf 19: prio 3 quantum 1600 rate 100000bit ceil 100000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600000b/1 mpu 0b overhead 0b level 0
Sent 348880 bytes 1937 pkt (dropped 0, overlimits 0 requeues 0)
rate 24bit 0pps backlog 0b 0p requeues 0
lended: 1885 borrowed: 52 giants: 0
tokens: 124640000 ctokens: 127996640
class fq_codel 11:d5 parent 11:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 1373 count 0 lastcount 0 ldelay 1us
class fq_codel 11:220 parent 11:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 1064 count 0 lastcount 0 ldelay 2us
class fq_codel 11:241 parent 11:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 173 count 0 lastcount 0 ldelay 1us
class fq_codel 11:2b9 parent 11:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 876 count 0 lastcount 0 ldelay 1us
class fq_codel 12:1b4 parent 12:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 1024 count 0 lastcount 0 ldelay 1us
class fq_codel 13:d7 parent 13:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 1424 count 0 lastcount 0 ldelay 1us
class fq_codel 13:2c2 parent 13:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 872 count 0 lastcount 0 ldelay 1us
class fq_codel 19:ba parent 19:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 590 count 0 lastcount 0 ldelay 1us
class fq_codel 22:25d parent 22:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 831 count 0 lastcount 0 ldelay 1us
class fq_codel 30:122 parent 30:
(dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
deficit 1442 count 1 lastcount 1 ldelay 0us
Features for eth0:
rx-checksumming: on
tx-checksumming: on
tx-checksum-ipv4: off [fixed]
tx-checksum-ip-generic: on
tx-checksum-ipv6: off [fixed]
tx-checksum-fcoe-crc: off [fixed]
tx-checksum-sctp: off [fixed]
scatter-gather: off
tx-scatter-gather: off
tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: off
tx-tcp-segmentation: off [requested on]
tx-tcp-ecn-segmentation: off [fixed]
tx-tcp6-segmentation: off [requested on]
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: off
generic-receive-offload: off
large-receive-offload: off [fixed]
rx-vlan-offload: off
tx-vlan-offload: off
ntuple-filters: off [fixed]
receive-hashing: off
highdma: on [fixed]
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: on
loopback: off [fixed]
rx-fcs: off
rx-all: off
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 2
Transceiver: internal
Auto-negotiation: on
MDI-X: on (auto)
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
NIC statistics:
rx_packets: 1413394
tx_packets: 994142
rx_bytes: 1886827377
tx_bytes: 96720549
rx_broadcast: 42
tx_broadcast: 1
rx_multicast: 0
tx_multicast: 6
rx_errors: 0
tx_errors: 0
tx_dropped: 0
multicast: 0
collisions: 0
rx_length_errors: 0
rx_over_errors: 0
rx_crc_errors: 0
rx_frame_errors: 0
rx_no_buffer_count: 0
rx_missed_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_fifo_errors: 0
tx_heartbeat_errors: 0
tx_window_errors: 0
tx_abort_late_coll: 0
tx_deferred_ok: 0
tx_single_coll_ok: 0
tx_multi_coll_ok: 0
tx_timeout_count: 1
tx_restart_queue: 0
rx_long_length_errors: 0
rx_short_length_errors: 0
rx_align_errors: 0
tx_tcp_seg_good: 0
tx_tcp_seg_failed: 0
rx_flow_control_xon: 33
rx_flow_control_xoff: 123
tx_flow_control_xon: 0
tx_flow_control_xoff: 0
rx_csum_offload_good: 1411434
rx_csum_offload_errors: 2
rx_header_split: 0
alloc_rx_buff_failed: 0
tx_smbus: 0
rx_smbus: 0
dropped_smbus: 0
rx_dma_failed: 0
tx_dma_failed: 0
rx_hwtstamp_cleared: 0
uncorr_ecc_errors: 0
corr_ecc_errors: 0
then I reloaded the module..
# ethtool -t eth0
The test result is PASS
The test extra info:
Register test (offline) 0
Eeprom test (offline) 0
Interrupt test (offline) 0
Loopback test (offline) 0
Link test (on/offline) 0
--
Do what you love because life is too short for anything else.
^ permalink raw reply
* [PATCH] net: mvneta: enable features before registering the driver
From: Willy Tarreau @ 2013-04-06 18:47 UTC (permalink / raw)
To: netdev; +Cc: thomas.petazzoni
Hi,
I noticed that mvneta's tx-csum/sg were off until disabled then
enabled, which led me to think that something was not made in the
correct sequence. And indeed, setting the dev features _before_
registering the device works much better :-)
This patch is for master but may be backported to 3.8-stable as well,
which is where I first experienced the issue.
Thanks,
Willy
>From 005eb7594a4304eed5e9b427ca6b745260c9eded Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Mon, 11 Mar 2013 07:56:58 +0100
Subject: [PATCH] net: mvneta: enable features before registering the driver,
not after
It seems that the reason why the dev features were ignored was because
they were enabled after registeration.
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
drivers/net/ethernet/marvell/mvneta.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index cd345b8..1e628ce 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2771,16 +2771,17 @@ static int mvneta_probe(struct platform_device *pdev)
netif_napi_add(dev, &pp->napi, mvneta_poll, pp->weight);
+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
+ dev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+ dev->vlan_features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+ dev->priv_flags |= IFF_UNICAST_FLT;
+
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
goto err_deinit;
}
- dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
- dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM;
- dev->priv_flags |= IFF_UNICAST_FLT;
-
netdev_info(dev, "mac: %pM\n", dev->dev_addr);
platform_set_drvdata(pdev, pp->dev);
--
1.7.12.2.21.g234cd45.dirty
^ permalink raw reply related
* Re: PROBLEM: IPv6 TCP-Connections resetting
From: Tetja Rediske @ 2013-04-06 18:27 UTC (permalink / raw)
To: Eric Dumazet
Cc: christoph.paasch, Hannes Frederic Sowa, djduanjiong, netdev,
steffen.klassert, Neal Cardwell, David Miller
In-Reply-To: <1365270879.3887.4.camel@edumazet-glaptop>
Hi,
> OK, it seems bug was added in commit
> ec18d9a2691d69cd14b48f9b919fddcef28b7f5c
> (ipv6: Add redirect support to all protocol icmp error handlers.)
> Not sure why Tetja Rediske bisected t
> 093d04d42fa094f6740bb188f0ad0c215ff61e2c
there could be an simple explenation, because i couldn't realy provoke
it with direct connected machines I did it on one of our least important
DNS-Server, I did a "bad" everytime the connection fault and did a
"good" after a some succesful connects (with waiting Time in between).
If the Bug is based on an ICMPv6 redirect in the meantime a redirect
could be sent out without me noticing. I did not keep the tcpdump
running while bisect(?ing?).
I will happily try the patch, when I get to work Monday, weekend is
mostly for family. ;)
Tetja
^ permalink raw reply
* Re: PROBLEM: IPv6 TCP-Connections resetting
From: Eric Dumazet @ 2013-04-06 17:54 UTC (permalink / raw)
To: christoph.paasch
Cc: Hannes Frederic Sowa, Tetja Rediske, djduanjiong, netdev,
steffen.klassert, Neal Cardwell, David Miller
In-Reply-To: <1460015.zN3jPXiAbD@cpaasch-mac>
On Sat, 2013-04-06 at 11:14 +0200, Christoph Paasch wrote:
> Hello,
>
> On Saturday 06 April 2013 06:35:34 Hannes Frederic Sowa wrote:
> > > [1.] One line summary of the problem:
> > >
> > > IPv6 TCP-Connections resetting
> > >
> > > [2.] Full description of the problem/report:
> > >
> > > In the last weeks we updated some of our systems to a 3.8.4 Kernel.
> > > Since then sometimes we can't connect to services running IPv6,
> > > Apache and Openssh tested.
> > >
> > > We got this on different machines with x86 and x86_64 Kernels. On
> > > x86_64 it is more random, but on x86 i can reproduce it permanently
> > > (Just opening any TCP Connection 1st time or after some short delay).
> > > Connecting quick after the reset again will work as expected. It will
> > > also work, if you keep another connection open.
> > >
> > > Before I got to the Kernel, I just kept an strace on an userspace
> > > process, but it did not notice the connection attempt. After this I
> > > monitored the connection with tcpdump, but nothing unusual.
> > >
> > > Then I did a rollback to the older Kernel and it worked as expected.
> > >
> > > I tracked it down with 'git bisect' to commit:
> > > 093d04d42fa094f6740bb188f0ad0c215ff61e2c
> > >
> > > I also tested latest git state available.
> > >
> > > [3.] Keywords (i.e., modules, networking, kernel):
> > >
> > > networking, IPv6
> > >
> > > [4.] Kernel information
> > >
> > > [4.1.] Kernel version (from /proc/version):
> > > since commit: 093d04d42fa094f6740bb188f0ad0c215ff61e2c
> > >
> > > [4.2.] Kernel .config file:
> > > [5.] Most recent kernel version which did not have the bug:
> > >
> > > none
> > >
> > > [6.] Output of Oops.. message (if applicable) with symbolic information
> > >
> > > resolved (see Documentation/oops-tracing.txt)
> > >
> > > [7.] A small shell script or example program which triggers the
> > >
> > > problem (if possible)
> > >
> > > [8.] Environment
> > > [8.1.] Software (add the output of the ver_linux script here)
> > >
> > > Different systems, mostly reproduced on this one:
> > >
> > > Linux dns03.tetja.de 3.9.0-rc5+ #10 SMP Fri Apr 5 16:55:54 CEST 2013
> > > i686 AMD Athlon(tm) 64 X2 Dual Core Processor 5600+ AuthenticAMD
> > > GNU/Linux
> > >
> > > Gnu C 4.4.5
> > > Gnu make 3.82
> > > binutils 2.22
> > > util-linux 2.22.2
> > > mount debug
> > > module-init-tools 12
> > > e2fsprogs 1.42
> > > jfsutils 1.1.15
> > > reiserfsprogs 3.6.21
> > > xfsprogs 3.1.10
> > > Linux C Library 2.15
> > > Dynamic linker (ldd) 2.15
> > > Procps 3.3.4
> > > Net-tools 1.60_p20120127084908
> > > Kbd 1.15.3wip
> > > Sh-utils 8.20
> > > Modules Loaded
> > >
> > > Connections looking like this on booth sites:
> > >
> > > 11:52:04.634315 IP6 2a00:1828:0:1::10.51808 >
> > > 2a00:1828:1000:1102::2.80: Flags [S], seq 103067898, win 5760, options
> > > [mss 1440,sackOK,TS val 232579708 ecr 0,nop,wscale 7], length 0
> > >
> > > 11:52:04.634354 IP6 2a00:1828:1000:1102::2.80 >
> > > 2a00:1828:0:1::10.51808: Flags [S.], seq 3352491415, ack 103067899, win
> > > 14280, options [mss 1440,sackOK,TS val 174797959 ecr
> > > 232579708,nop,wscale 7], length 0
> > >
> > > 11:52:04.634656 IP6 fe80::92e2:baff:fe00:c120 > 2a00:1828:1000:1102::2:
> > > ICMP6, redirect, 2a00:1828:0:1::10 to 2a00:1828:0:1::10, length 136
> > >
> > > 11:52:04.634715 IP6 2a00:1828:0:1::10.51808 >
> > > 2a00:1828:1000:1102::2.80: Flags [.], ack 1, win 45, options
> > > [nop,nop,TS val 232579708 ecr 174797959], length 0
> > >
> > > 11:52:04.634726 IP6 2a00:1828:1000:1102::2.80 >
> > > 2a00:1828:0:1::10.51808: Flags [R], seq 3352491416, win 0, length 0
> > >
> > > 11:52:04.635027 IP6 2a00:1828:0:1::10.51808 >
> > > 2a00:1828:1000:1102::2.80: Flags [P.], seq 1:359, ack 1, win 45,
> > > options [nop,nop,TS val 232579708 ecr 174797959], length 358
> > >
> > > 11:52:04.635037 IP6 2a00:1828:1000:1102::2.80 >
> > > 2a00:1828:0:1::10.51808: Flags [R], seq 3352491416, win 0, length 0
> > >
> > > 11:52:04.635071 IP6 fe80::92e2:baff:fe00:c120 > 2a00:1828:1000:1102::2:
> > > ICMP6, redirect, 2a00:1828:0:1::10 to 2a00:1828:0:1::10, length 112
> > >
> > > 11:52:04.635246 IP6 fe80::92e2:baff:fe00:c120 > 2a00:1828:1000:1102::2:
> > > ICMP6, redirect, 2a00:1828:0:1::10 to 2a00:1828:0:1::10, length 112
>
> May it simply be a missing "goto out" in tcp_v6_err (see below patch) ?
>
> Cheers,
> Christoph
>
> --------
>
> From: Christoph Paasch <christoph.paasch@uclouvain.be>
> Date: Sat, 6 Apr 2013 10:21:01 +0200
> Subject: [PATCH] ipv6/tcp: Stop processing ICMPv6 redirect messages
>
> Upon reception of an ICMPv6 Redirect message, we should not continue
> inside tcp_v6_err. Otherwise, an error will be reported or request-socks
> will be closed.
>
> Adds also some parantheses to respect codingstyle guidelines.
>
> Reported-by: Tetja Rediske <tetja@tetja.de>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> net/ipv6/tcp_ipv6.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 1033d2b..24434c5 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -386,6 +386,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct
> inet6_skb_parm *opt,
>
> if (dst)
> dst->ops->redirect(dst, sk, skb);
> + goto out;
> }
>
OK, it seems bug was added in commit
ec18d9a2691d69cd14b48f9b919fddcef28b7f5c
(ipv6: Add redirect support to all protocol icmp error handlers.)
Not sure why Tetja Rediske bisected to
093d04d42fa094f6740bb188f0ad0c215ff61e2c
Could you send a patch with this single line change (no cleanup), and
a more detailed changelog, once the bug origin is clearly identified ?
Thanks !
^ permalink raw reply
* Re: PROBLEM: IPv6 TCP-Connections resetting
From: Sergei Shtylyov @ 2013-04-06 17:43 UTC (permalink / raw)
To: christoph.paasch
Cc: Hannes Frederic Sowa, Tetja Rediske, djduanjiong, netdev,
steffen.klassert, Neal Cardwell, Eric Dumazet, David Miller
In-Reply-To: <4796401.BXlLaoS7qO@cpaasch-mac>
Hello.
On 06-04-2013 13:18, Christoph Paasch wrote:
> From: Christoph Paasch <christoph.paasch@uclouvain.be>
> Date: Sat, 6 Apr 2013 10:21:01 +0200
> Subject: [PATCH] ipv6/tcp: Stop processing ICMPv6 redirect messages
> Upon reception of an ICMPv6 Redirect message, we should not continue
> inside tcp_v6_err. Otherwise, an error will be reported or request-socks
> will be closed.
> Adds also some parantheses to respect codingstyle guidelines.
When you say "älso", it's often a good indicator there should be another
patch -- like in this case.
> Reported-by: Tetja Rediske <tetja@tetja.de>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> net/ipv6/tcp_ipv6.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 1033d2b..24434c5 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -386,6 +386,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>
> if (dst)
> dst->ops->redirect(dst, sk, skb);
> + goto out;
> }
>
> if (type == ICMPV6_PKT_TOOBIG) {
> @@ -441,16 +442,18 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
> sk->sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */
>
> tcp_done(sk);
> - } else
> + } else {
> sk->sk_err_soft = err;
> + }
> goto out;
> }
>
> if (!sock_owned_by_user(sk) && np->recverr) {
> sk->sk_err = err;
> sk->sk_error_report(sk);
> - } else
> + } else {
> sk->sk_err_soft = err;
> + }
>
> out:
> bh_unlock_sock(sk);
WBR, Sergei
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox