* [PATCH] tcp repair: Fix unaligned access when repairing options (v2)
From: Pavel Emelyanov @ 2012-04-26 9:43 UTC (permalink / raw)
To: Linux Netdev List
From: Pavel Emelyanov <xemul@parallels.com>
Don't pick __u8/__u16 values directly from raw pointers, but instead use
an array of structures of code:value pairs. This is OK, since the buffer
we take options from is not an skb memory, but a user-to-kernel one.
For those options which don't require any value now, require this to be
zero (for potential future extension of this API).
v2: Changed tcp_repair_opt to use two __u32-s as spotted by David Laight.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
---
include/linux/tcp.h | 5 ++++
net/ipv4/tcp.c | 60 +++++++++++++++++---------------------------------
2 files changed, 26 insertions(+), 39 deletions(-)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 9865936..d0401d9 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -111,6 +111,11 @@ enum {
#define TCP_QUEUE_SEQ 21
#define TCP_REPAIR_OPTIONS 22
+struct tcp_repair_opt {
+ __u32 opt_code;
+ __u32 opt_val;
+};
+
enum {
TCP_NO_QUEUE,
TCP_RECV_QUEUE,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index de6a238..9670af3 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2283,60 +2283,40 @@ static inline int tcp_can_repair_sock(struct sock *sk)
((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_ESTABLISHED));
}
-static int tcp_repair_options_est(struct tcp_sock *tp, char __user *optbuf, unsigned int len)
+static int tcp_repair_options_est(struct tcp_sock *tp,
+ struct tcp_repair_opt __user *optbuf, unsigned int len)
{
- /*
- * Options are stored in CODE:VALUE form where CODE is 8bit and VALUE
- * fits the respective TCPOLEN_ size
- */
+ struct tcp_repair_opt opt;
- while (len > 0) {
- u8 opcode;
-
- if (get_user(opcode, optbuf))
+ while (len >= sizeof(opt)) {
+ if (copy_from_user(&opt, optbuf, sizeof(opt)))
return -EFAULT;
optbuf++;
- len--;
-
- switch (opcode) {
- case TCPOPT_MSS: {
- u16 in_mss;
+ len -= sizeof(opt);
- if (len < sizeof(in_mss))
- return -ENODATA;
- if (get_user(in_mss, optbuf))
- return -EFAULT;
-
- tp->rx_opt.mss_clamp = in_mss;
-
- optbuf += sizeof(in_mss);
- len -= sizeof(in_mss);
+ switch (opt.opt_code) {
+ case TCPOPT_MSS:
+ tp->rx_opt.mss_clamp = opt.opt_val;
break;
- }
- case TCPOPT_WINDOW: {
- u8 wscale;
-
- if (len < sizeof(wscale))
- return -ENODATA;
- if (get_user(wscale, optbuf))
- return -EFAULT;
-
- if (wscale > 14)
+ case TCPOPT_WINDOW:
+ if (opt.opt_val > 14)
return -EFBIG;
- tp->rx_opt.snd_wscale = wscale;
-
- optbuf += sizeof(wscale);
- len -= sizeof(wscale);
+ tp->rx_opt.snd_wscale = opt.opt_val;
break;
- }
case TCPOPT_SACK_PERM:
+ if (opt.opt_val != 0)
+ return -EINVAL;
+
tp->rx_opt.sack_ok |= TCP_SACK_SEEN;
if (sysctl_tcp_fack)
tcp_enable_fack(tp);
break;
case TCPOPT_TIMESTAMP:
+ if (opt.opt_val != 0)
+ return -EINVAL;
+
tp->rx_opt.tstamp_ok = 1;
break;
}
@@ -2557,7 +2537,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
if (!tp->repair)
err = -EINVAL;
else if (sk->sk_state == TCP_ESTABLISHED)
- err = tcp_repair_options_est(tp, optval, optlen);
+ err = tcp_repair_options_est(tp,
+ (struct tcp_repair_opt __user *)optval,
+ optlen);
else
err = -EPERM;
break;
^ permalink raw reply related
* Re: [GIT PULL] net/at91: at91_ether fixes for 3.4-rc
From: Nicolas Ferre @ 2012-04-26 10:07 UTC (permalink / raw)
To: David Miller; +Cc: netdev, avictor.za, plagnioj, linux-kernel, linux-arm-kernel
In-Reply-To: <20120426.052006.1832921763623188173.davem@davemloft.net>
On 04/26/2012 11:20 AM, David Miller :
> From: Nicolas Ferre <nicolas.ferre@atmel.com>
> Date: Thu, 26 Apr 2012 11:14:56 +0200
>
>> Can you please pull those fixes for 3.4-rc? The ARM/AT91 part
>> of modifications is pretty small and bounded to a single SoC so
>> it will not mess with arm-soc git tree.
>
> Please post the patches themselves to netdev.
>
> You can give me pull requests, but those go into the "[PATCH 0/N] ..."
> email, it doesn't preclude you're still having to post the actual
> patches.
>
> Otherwise nobody can review your work.
Both patches have been posted on netdev (but independently):
First has been posted on February 13th:
http://www.spinics.net/lists/netdev/msg188868.html
With a question from myself a few days ago:
http://www.spinics.net/lists/netdev/msg196183.html
And I can find ancestors back in May 2011...
Second one has been posted on April 23rd:
http://www.spinics.net/lists/netdev/msg196002.html
So, should I repost both of them as patch series?
Best regards,
--
Nicolas Ferre
^ permalink raw reply
* Re: [PATCH net-next 0/2][6lowpan] code improvements and refactorings
From: David Miller @ 2012-04-26 10:02 UTC (permalink / raw)
To: alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1335432951-17340-1-git-send-email-alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Thu, 26 Apr 2012 13:35:49 +0400
> The following patches contains 6lowpan code improvements.
Both applied, thanks.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply
* Re: [PATCH v2] smsc95xx: mark link down on startup and let PHY interrupt deal with carrier changes
From: David Miller @ 2012-04-26 9:56 UTC (permalink / raw)
To: steve; +Cc: fillods, paolo.pisati, netdev
In-Reply-To: <CAKh2mn6YM=Jmpmfr7ErM0cRjsMc97DzoBLcA45gh9yzSpQDRJg@mail.gmail.com>
From: Steve Glendinning <steve@shawell.net>
Date: Thu, 26 Apr 2012 10:41:33 +0100
> Hi all,
>
> On 24 April 2012 16:45, Steve Glendinning <steve@shawell.net> wrote:
>> Hi all,
>>
>> On 24 April 2012 05:42, David Miller <davem@davemloft.net> wrote:
>>>
>>> Steve, please send a maintainers etc. update and please provide
>>> feedback on this link status fix.
>
> Good catch Paolo, this patch fixes reporting of link status when the
> device is first connected with no ethernet cable plugged in.
>
> I'll prepare the same patch for smsc75xx as it also suffers from the same issue.
>
> Acked-by: Steve Glendinning <steve.glendinning@shawell.net>
Applied.
^ permalink raw reply
* Re: [PATCH] net: usb: smsc95xx: fix mtu
From: Steve Glendinning @ 2012-04-26 9:56 UTC (permalink / raw)
To: David Miller; +Cc: netdev, fillods
In-Reply-To: <20120426.053850.929602823670004153.davem@davemloft.net>
On 26 April 2012 10:38, David Miller <davem@davemloft.net> wrote:
>
> This is already in the 'net' tree for nearly a week:
Doh! Sorry David, I missed this.
--
Steve Glendinning
^ permalink raw reply
* Re: [PATCH v2] smsc95xx: mark link down on startup and let PHY interrupt deal with carrier changes
From: Steve Glendinning @ 2012-04-26 9:41 UTC (permalink / raw)
To: David Miller; +Cc: fillods, paolo.pisati, netdev
In-Reply-To: <CAKh2mn4JLm8f036d7vNimLdA2wCP+Db7xhgUgfsg760yhs3Yjw@mail.gmail.com>
Hi all,
On 24 April 2012 16:45, Steve Glendinning <steve@shawell.net> wrote:
> Hi all,
>
> On 24 April 2012 05:42, David Miller <davem@davemloft.net> wrote:
>>
>> Steve, please send a maintainers etc. update and please provide
>> feedback on this link status fix.
Good catch Paolo, this patch fixes reporting of link status when the
device is first connected with no ethernet cable plugged in.
I'll prepare the same patch for smsc75xx as it also suffers from the same issue.
Acked-by: Steve Glendinning <steve.glendinning@shawell.net>
--
Steve Glendinning
^ permalink raw reply
* Re: [PATCH] tcp repair: Fix unaligned access when repairing options (v2)
From: Pavel Emelyanov @ 2012-04-26 9:41 UTC (permalink / raw)
To: David Miller; +Cc: netdev@vger.kernel.org, David.Laight@ACULAB.COM
In-Reply-To: <20120426.052336.664675835426476301.davem@davemloft.net>
On 04/26/2012 01:23 PM, David Miller wrote:
> From: Pavel Emelyanov <xemul@parallels.com>
> Date: Thu, 26 Apr 2012 12:50:57 +0400
>
>> Don't pick __u8/__u16 values directly from raw pointers, but instead use
>> an array of structures of code:value pairs. This is OK, since the buffer
>> we take options from is not an skb memory, but a user-to-kernel one.
>>
>> For those options which don't require any value now, require this to be
>> zero (for potential future extension of this API).
>>
>> v2: Changed tcp_repair_opt to use two __u32-s as spotted by David Laight.
>>
>> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
>
> Hmmm, this didn't show up on netdev, I wonder why?
So do I :( I haven't received any mail with errors from netdev, neither
Parallels mail server reported any problems.
I will resubmit this one again.
Thanks,
Pavel
^ permalink raw reply
* Re: [PATCH] dl2k: Clean up rio_ioctl
From: David Miller @ 2012-04-26 9:38 UTC (permalink / raw)
To: jeffm; +Cc: netdev
In-Reply-To: <4F989789.9040405@suse.com>
From: Jeff Mahoney <jeffm@suse.com>
Date: Wed, 25 Apr 2012 20:32:09 -0400
> The dl2k driver's rio_ioctl call has a few issues:
> - No permissions checking
> - Implements SIOCGMIIREG and SIOCGMIIREG using the SIOCDEVPRIVATE numbers
> - Has a few ioctls that may have been used for debugging at one point
> but have no place in the kernel proper.
>
> This patch removes all but the MII ioctls, renumbers them to use the
> standard ones, and adds the proper permission check for SIOCSMIIREG.
>
> We can also get rid of the dl2k-specific struct mii_data in favor of
> the generic struct mii_ioctl_data.
>
> Since we have the phyid on hand, we can add the SIOCGMIIPHY ioctl too.
>
> Most of the MII code for the driver could probably be converted to use
> the generic MII library but I don't have a device to test the results.
>
> Reported-by: Stephan Mueller <stephan.mueller@atsec.com>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] net: usb: smsc95xx: fix mtu
From: David Miller @ 2012-04-26 9:38 UTC (permalink / raw)
To: steve.glendinning; +Cc: netdev, fillods
In-Reply-To: <1335430964-1018-1-git-send-email-steve.glendinning@shawell.net>
This is already in the 'net' tree for nearly a week:
commit 9bbf56609d304e8aae2076610d938206453035de
Author: Stephane Fillod <fillods@users.sf.net>
Date: Fri Apr 20 09:39:23 2012 +0000
net: usb: smsc95xx: fix mtu
Make smsc95xx recalculate the hard_mtu after adjusting the
hard_header_len.
Without this, usbnet adjusts the MTU down to 1488 bytes, and the host is
unable to receive standard 1500-byte frames from the device.
Inspired by same fix on cdc_eem 78fb72f7936c01d5b426c03a691eca082b03f2b9.
Tested on ARM/Beagle.
Signed-off-by: Stephane Fillod <fillods@users.sf.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* [PATCH net-next 2/2] 6lowpan: duplicate definition of IEEE802154_ALEN
From: Alexander Smirnov @ 2012-04-26 9:35 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1335432951-17340-1-git-send-email-alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The same macros is defined in 'include/net/af_ieee802154.h' and is called
IEEE802154_ADDR_LEN. No need another one, so remove it.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
net/ieee802154/6lowpan.c | 4 ++--
net/ieee802154/6lowpan.h | 3 ---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index f406ac8..32eb417 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -196,7 +196,7 @@ lowpan_compress_addr_64(u8 **hc06_ptr, u8 shift, const struct in6_addr *ipaddr,
static void
lowpan_uip_ds6_set_addr_iid(struct in6_addr *ipaddr, unsigned char *lladdr)
{
- memcpy(&ipaddr->s6_addr[8], lladdr, IEEE802154_ALEN);
+ memcpy(&ipaddr->s6_addr[8], lladdr, IEEE802154_ADDR_LEN);
/* second bit-flip (Universe/Local) is done according RFC2464 */
ipaddr->s6_addr[8] ^= 0x02;
}
@@ -221,7 +221,7 @@ lowpan_uncompress_addr(struct sk_buff *skb, struct in6_addr *ipaddr,
if (lladdr)
lowpan_raw_dump_inline(__func__, "linklocal address",
- lladdr, IEEE802154_ALEN);
+ lladdr, IEEE802154_ADDR_LEN);
if (prefcount > 0)
memcpy(ipaddr, prefix, prefcount);
diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h
index aeff3f3..8c2251f 100644
--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -53,9 +53,6 @@
#ifndef __6LOWPAN_H__
#define __6LOWPAN_H__
-/* need to know address length to manipulate with it */
-#define IEEE802154_ALEN 8
-
#define UIP_802154_SHORTADDR_LEN 2 /* compressed ipv6 address length */
#define UIP_IPH_LEN 40 /* ipv6 fixed header size */
#define UIP_PROTO_UDP 17 /* ipv6 next header value for UDP */
--
1.7.2.3
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply related
* [PATCH net-next 1/2] 6lowpan: move frame allocation code to a separate function
From: Alexander Smirnov @ 2012-04-26 9:35 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1335432951-17340-1-git-send-email-alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Separate frame allocation routine from data processing function.
This makes code more human readable and easier for understanding.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
net/ieee802154/6lowpan.c | 81 +++++++++++++++++++++++++++-------------------
1 files changed, 48 insertions(+), 33 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index b570dbf..f406ac8 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -650,6 +650,53 @@ static void lowpan_fragment_timer_expired(unsigned long entry_addr)
kfree(entry);
}
+static struct lowpan_fragment *
+lowpan_alloc_new_frame(struct sk_buff *skb, u8 iphc0, u8 len, u8 tag)
+{
+ struct lowpan_fragment *frame;
+
+ frame = kzalloc(sizeof(struct lowpan_fragment),
+ GFP_ATOMIC);
+ if (!frame)
+ goto frame_err;
+
+ INIT_LIST_HEAD(&frame->list);
+
+ frame->length = (iphc0 & 7) | (len << 3);
+ frame->tag = tag;
+
+ /* allocate buffer for frame assembling */
+ frame->skb = alloc_skb(frame->length +
+ sizeof(struct ipv6hdr), GFP_ATOMIC);
+
+ if (!frame->skb)
+ goto skb_err;
+
+ frame->skb->priority = skb->priority;
+ frame->skb->dev = skb->dev;
+
+ /* reserve headroom for uncompressed ipv6 header */
+ skb_reserve(frame->skb, sizeof(struct ipv6hdr));
+ skb_put(frame->skb, frame->length);
+
+ init_timer(&frame->timer);
+ /* time out is the same as for ipv6 - 60 sec */
+ frame->timer.expires = jiffies + LOWPAN_FRAG_TIMEOUT;
+ frame->timer.data = (unsigned long)frame;
+ frame->timer.function = lowpan_fragment_timer_expired;
+
+ add_timer(&frame->timer);
+
+ list_add_tail(&frame->list, &lowpan_fragments);
+
+ return frame;
+
+skb_err:
+ kfree(frame);
+frame_err:
+ return NULL;
+}
+
static int
lowpan_process_data(struct sk_buff *skb)
{
@@ -692,41 +739,9 @@ lowpan_process_data(struct sk_buff *skb)
/* alloc new frame structure */
if (!found) {
- frame = kzalloc(sizeof(struct lowpan_fragment),
- GFP_ATOMIC);
+ frame = lowpan_alloc_new_frame(skb, iphc0, len, tag);
if (!frame)
goto unlock_and_drop;
-
- INIT_LIST_HEAD(&frame->list);
-
- frame->length = (iphc0 & 7) | (len << 3);
- frame->tag = tag;
-
- /* allocate buffer for frame assembling */
- frame->skb = alloc_skb(frame->length +
- sizeof(struct ipv6hdr), GFP_ATOMIC);
-
- if (!frame->skb) {
- kfree(frame);
- goto unlock_and_drop;
- }
-
- frame->skb->priority = skb->priority;
- frame->skb->dev = skb->dev;
-
- /* reserve headroom for uncompressed ipv6 header */
- skb_reserve(frame->skb, sizeof(struct ipv6hdr));
- skb_put(frame->skb, frame->length);
-
- init_timer(&frame->timer);
- /* time out is the same as for ipv6 - 60 sec */
- frame->timer.expires = jiffies + LOWPAN_FRAG_TIMEOUT;
- frame->timer.data = (unsigned long)frame;
- frame->timer.function = lowpan_fragment_timer_expired;
-
- add_timer(&frame->timer);
-
- list_add_tail(&frame->list, &lowpan_fragments);
}
if ((iphc0 & LOWPAN_DISPATCH_MASK) == LOWPAN_DISPATCH_FRAG1)
--
1.7.2.3
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply related
* [PATCH net-next 0/2][6lowpan] code improvements and refactorings
From: Alexander Smirnov @ 2012-04-26 9:35 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
The following patches contains 6lowpan code improvements.
With best regards,
Alex
8<--
The following changes since commit b89f01c8dab2b2d07729e1e6525272568bca54e0:
6lowpan: add missing spin_lock_init() (2012-04-26 11:35:28 +0400)
are available in the git repository at:
6lowpan_dev ..BRANCH.NOT.VERIFIED..
Alexander Smirnov (2):
6lowpan: move frame allocation code to a separate function
6lowpan: duplicate definition of IEEE802154_ALEN
net/ieee802154/6lowpan.c | 85 +++++++++++++++++++++++++++-------------------
net/ieee802154/6lowpan.h | 3 --
2 files changed, 50 insertions(+), 38 deletions(-)
From: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH net-next 0/2][6lowpan] code improvements and refactorings
In-Reply-To:
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply
* Re: [PATCH net 0/3][6lowpan] fixes for 6lowpan
From: David Miller @ 2012-04-26 9:33 UTC (permalink / raw)
To: alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1335432298-17161-1-git-send-email-alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Thu, 26 Apr 2012 13:24:55 +0400
> The following patch set contains several fixes for the 6lowpan holes which lead
> to unpredictable module state.
All applied, thanks.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply
* Re: [PATCH 0/4] mISDN Fix and enhancements for the HFC 4S/8S/E1 driver
From: David Miller @ 2012-04-26 9:32 UTC (permalink / raw)
To: kkeil; +Cc: netdev
In-Reply-To: <1335336734-25181-1-git-send-email-kkeil@linux-pingi.de>
From: Karsten Keil <kkeil@linux-pingi.de>
Date: Wed, 25 Apr 2012 08:52:10 +0200
> For net-next.
>
> Patchset contains fixes for issues fond in long time testing.
> The LED support now works as proposed by the card documentation.
> For special cases you can now split a E1 line into independ logical
> instances.
All applied, thanks Karsten.
^ permalink raw reply
* [PATCH net 3/3] 6lowpan: add missing spin_lock_init()
From: Alexander Smirnov @ 2012-04-26 9:24 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-zigbee-devel, Alexander Smirnov
In-Reply-To: <1335432298-17161-1-git-send-email-alex.bluesman.smirnov@gmail.com>
Add missing spin_lock_init() for frames list lock.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
---
net/ieee802154/6lowpan.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index a21ca6e..b570dbf 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1168,6 +1168,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
list_add_tail(&entry->list, &lowpan_devices);
mutex_unlock(&lowpan_dev_info(dev)->dev_list_mtx);
+ spin_lock_init(&flist_lock);
+
register_netdevice(dev);
return 0;
--
1.7.2.3
^ permalink raw reply related
* [PATCH net 2/3] 6lowpan: clean up fragments list if module unloaded
From: Alexander Smirnov @ 2012-04-26 9:24 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-zigbee-devel, Alexander Smirnov
In-Reply-To: <1335432298-17161-1-git-send-email-alex.bluesman.smirnov@gmail.com>
Clean all the pending fragments and relative timers if 6lowpan link
is going to be deleted.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
---
net/ieee802154/6lowpan.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 7ce508f..a21ca6e 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1177,11 +1177,20 @@ static void lowpan_dellink(struct net_device *dev, struct list_head *head)
{
struct lowpan_dev_info *lowpan_dev = lowpan_dev_info(dev);
struct net_device *real_dev = lowpan_dev->real_dev;
- struct lowpan_dev_record *entry;
- struct lowpan_dev_record *tmp;
+ struct lowpan_dev_record *entry, *tmp;
+ struct lowpan_fragment *frame, *tframe;
ASSERT_RTNL();
+ spin_lock(&flist_lock);
+ list_for_each_entry_safe(frame, tframe, &lowpan_fragments, list) {
+ del_timer(&frame->timer);
+ list_del(&frame->list);
+ dev_kfree_skb(frame->skb);
+ kfree(frame);
+ }
+ spin_unlock(&flist_lock);
+
mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx);
list_for_each_entry_safe(entry, tmp, &lowpan_devices, list) {
if (entry->ldev == dev) {
--
1.7.2.3
^ permalink raw reply related
* [PATCH net 1/3] 6lowpan: fix segmentation fault caused by mlme request
From: Alexander Smirnov @ 2012-04-26 9:24 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-zigbee-devel, Alexander Smirnov
In-Reply-To: <1335432298-17161-1-git-send-email-alex.bluesman.smirnov@gmail.com>
Add nescesary mlme callbacks to satisfy "iz list" request from user space.
Due to 6lowpan device doesn't have its own phy, mlme implemented as a pipe
to a real phy to which 6lowpan is attached.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
---
net/ieee802154/6lowpan.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 58c8895..7ce508f 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1044,6 +1044,24 @@ static void lowpan_dev_free(struct net_device *dev)
free_netdev(dev);
}
+static struct wpan_phy *lowpan_get_phy(const struct net_device *dev)
+{
+ struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
+ return ieee802154_mlme_ops(real_dev)->get_phy(real_dev);
+}
+
+static u16 lowpan_get_pan_id(const struct net_device *dev)
+{
+ struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
+ return ieee802154_mlme_ops(real_dev)->get_pan_id(real_dev);
+}
+
+static u16 lowpan_get_short_addr(const struct net_device *dev)
+{
+ struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
+ return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev);
+}
+
static struct header_ops lowpan_header_ops = {
.create = lowpan_header_create,
};
@@ -1053,6 +1071,12 @@ static const struct net_device_ops lowpan_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
};
+static struct ieee802154_mlme_ops lowpan_mlme = {
+ .get_pan_id = lowpan_get_pan_id,
+ .get_phy = lowpan_get_phy,
+ .get_short_addr = lowpan_get_short_addr,
+};
+
static void lowpan_setup(struct net_device *dev)
{
pr_debug("(%s)\n", __func__);
@@ -1070,6 +1094,7 @@ static void lowpan_setup(struct net_device *dev)
dev->netdev_ops = &lowpan_netdev_ops;
dev->header_ops = &lowpan_header_ops;
+ dev->ml_priv = &lowpan_mlme;
dev->destructor = lowpan_dev_free;
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH net 0/3][6lowpan] fixes for 6lowpan
From: Alexander Smirnov @ 2012-04-26 9:24 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
The following patch set contains several fixes for the 6lowpan holes which lead
to unpredictable module state.
With best regards,
Alex
8<--
The following changes since commit 872f24dbc604ef585ea7eec73020dcdfaffd1956:
tipc: remove inline instances from C source files. (2012-04-24 00:41:03 -0400)
are available in the git repository at:
6lowpan_dev ..BRANCH.NOT.VERIFIED..
Alexander Smirnov (3):
6lowpan: fix segmentation fault caused by mlme request
6lowpan: clean up fragments list if module unloaded
6lowpan: add missing spin_lock_init()
net/ieee802154/6lowpan.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
From: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH net 0/3][6lowpan] fixes for 6lowpan
In-Reply-To:
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply
* Re: [PATCH] tcp repair: Fix unaligned access when repairing options (v2)
From: David Miller @ 2012-04-26 9:23 UTC (permalink / raw)
To: xemul; +Cc: netdev, David.Laight
In-Reply-To: <4F990C71.3020500@parallels.com>
From: Pavel Emelyanov <xemul@parallels.com>
Date: Thu, 26 Apr 2012 12:50:57 +0400
> Don't pick __u8/__u16 values directly from raw pointers, but instead use
> an array of structures of code:value pairs. This is OK, since the buffer
> we take options from is not an skb memory, but a user-to-kernel one.
>
> For those options which don't require any value now, require this to be
> zero (for potential future extension of this API).
>
> v2: Changed tcp_repair_opt to use two __u32-s as spotted by David Laight.
>
> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Hmmm, this didn't show up on netdev, I wonder why?
^ permalink raw reply
* Re: [RFC] allow skb->head to point/alias to first skb frag
From: Eric Dumazet @ 2012-04-26 9:22 UTC (permalink / raw)
To: David Miller
Cc: ilpo.jarvinen, rick.jones2, netdev, therbert, ncardwell, maze,
ycheng
In-Reply-To: <20120426.051800.637617874638567499.davem@davemloft.net>
On Thu, 2012-04-26 at 05:18 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 26 Apr 2012 11:10:02 +0200
>
> > The 'frag' would have a known size : 2048 bytes
> >
> > But the end of it would be used by struct skb_shared_info
> >
> > so data_len would be 0 in fact.
> >
> > This would look like a regular linear skb.
> >
> > Just a bit set in skb to say : Warning, skb->head was not kmalloced :
> > replace kfree(head) by put_page(...)
> >
> > And this bit would be tested in GRO or tcp merge to 'upgrade' this
> > skb->head to proper page/frag
>
> And what happens if this ends up in a piece of code which wants to
> append a page frag?
>
> Or a piece of code which copies an SKB, including page frag parts?
>
> All I'm saying is that the number of tests necessary to make this work
> properly might become prohibitive.
I'll cook a patch, I believe not so many parts assume skb->head can be
kmalloc()/kfree(). This should be contained in net/core/skbuff.c only.
Elsewhere we use skb->head as a pointer to memory. It will stay the
same.
^ permalink raw reply
* Re: [GIT PULL] net/at91: at91_ether fixes for 3.4-rc
From: David Miller @ 2012-04-26 9:20 UTC (permalink / raw)
To: nicolas.ferre
Cc: netdev, linux-arm-kernel, linux-kernel, avictor.za, plagnioj
In-Reply-To: <4F991210.8060409@atmel.com>
From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Thu, 26 Apr 2012 11:14:56 +0200
> Can you please pull those fixes for 3.4-rc? The ARM/AT91 part
> of modifications is pretty small and bounded to a single SoC so
> it will not mess with arm-soc git tree.
Please post the patches themselves to netdev.
You can give me pull requests, but those go into the "[PATCH 0/N] ..."
email, it doesn't preclude you're still having to post the actual
patches.
Otherwise nobody can review your work.
^ permalink raw reply
* Re: [RFC] allow skb->head to point/alias to first skb frag
From: David Miller @ 2012-04-26 9:18 UTC (permalink / raw)
To: eric.dumazet
Cc: ilpo.jarvinen, rick.jones2, netdev, therbert, ncardwell, maze,
ycheng
In-Reply-To: <1335431402.2775.24.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 26 Apr 2012 11:10:02 +0200
> The 'frag' would have a known size : 2048 bytes
>
> But the end of it would be used by struct skb_shared_info
>
> so data_len would be 0 in fact.
>
> This would look like a regular linear skb.
>
> Just a bit set in skb to say : Warning, skb->head was not kmalloced :
> replace kfree(head) by put_page(...)
>
> And this bit would be tested in GRO or tcp merge to 'upgrade' this
> skb->head to proper page/frag
And what happens if this ends up in a piece of code which wants to
append a page frag?
Or a piece of code which copies an SKB, including page frag parts?
All I'm saying is that the number of tests necessary to make this work
properly might become prohibitive.
^ permalink raw reply
* [GIT PULL] net/at91: at91_ether fixes for 3.4-rc
From: Nicolas Ferre @ 2012-04-26 9:14 UTC (permalink / raw)
To: David Miller, netdev, linux-arm-kernel
Cc: Andrew Victor, Jean-Christophe PLAGNIOL-VILLARD,
Linux Kernel list
Hi David,
Can you please pull those fixes for 3.4-rc? The ARM/AT91 part
of modifications is pretty small and bounded to a single SoC so
it will not mess with arm-soc git tree.
Tell me if you need other information on this signed tag...
The following changes since commit 66f75a5d028beaf67c931435fdc3e7823125730c:
Linux 3.4-rc4 (2012-04-21 14:47:52 -0700)
are available in the git repository at:
git://github.com/at91linux/linux-at91.git tags/at91-3.4-net-fixes
for you to fetch changes up to cfc991548b5b73c8038f41877da1cd0104945cf5:
net/at91_ether: use gpio_to_irq for phy IRQ line (2012-04-26 10:22:40 +0200)
----------------------------------------------------------------
Both fixes are about at91_ether.c driver: It is only used in a single
Atmel AT91 SoC: AT91RM9200.
The removal of fixed mapping is a long standing refinement which will
convert this driver to a more typical resources management.
The gpio fix is needed now that we have moved AT91 to irqdomains.
----------------------------------------------------------------
Andrew Victor (1):
AT91: Remove fixed mapping for AT91RM9200 ethernet
Nicolas Ferre (1):
net/at91_ether: use gpio_to_irq for phy IRQ line
arch/arm/mach-at91/at91rm9200.c | 10 --
arch/arm/mach-at91/at91rm9200_devices.c | 4 +-
arch/arm/mach-at91/include/mach/hardware.h | 1 -
drivers/net/ethernet/cadence/at91_ether.c | 535 ++++++++++++++++++++++++++++++++++++++++++++-------------------------------------
drivers/net/ethernet/cadence/at91_ether.h | 1 +
5 files changed, 291 insertions(+), 260 deletions(-)
Best regards,
--
Nicolas Ferre
^ permalink raw reply
* RE: [PATCH 00/10] atl1c: update hardware settings - v3
From: Huang, Xiong @ 2012-04-26 9:13 UTC (permalink / raw)
To: David Miller
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
qca-linux-team, nic-devel
In-Reply-To: <20120426.050542.243663587525305831.davem@davemloft.net>
Ok, I will update quirks.c for the next patch set. Thanks !
-Xiong
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Thursday, April 26, 2012 17:06
> To: Huang, Xiong
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; qca-linux-team; nic-
> devel
> Subject: Re: [PATCH 00/10] atl1c: update hardware settings - v3
>
> From: xiong <xiong@qca.qualcomm.com>
> Date: Thu, 26 Apr 2012 14:27:08 +0800
>
> > This update contains a serial of patches, most of them are hardware
> > settings related. register definitions are refined (or removed if
> > meaningless) for each patch.
> >
> > This is the third serial patches, after reviewed/applied the fourth
> > serial will be out.
> >
> > The patches have addressed all sparse and checkpatch warnings.
> >
> > Following NICs are tested:
> > AR8131/AR8132/AR8151A/AR8152A/AR8152B
> > Test item includes:
> > build/install/uninstall/dhcp/ping/iperf/wol/reboot/etc.
>
> I've applied patches #1 until #9, patch #10 needs to be done differently.
>
> The PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG bit should be set via a PCI quirk
> entry in drivers/pci/quirks.c just as it is done for other devices which have this
> problem.
>
> Thank you.
^ permalink raw reply
* Re: [net 0/2][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2012-04-26 9:11 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1335333314-6814-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 24 Apr 2012 22:55:12 -0700
> This series of patches contains fixes for e1000e only.
>
> The following are changes since commit 2a5809499e35b53a6044fd34e72b242688b7a862:
> asix: Fix tx transfer padding for full-speed USB
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net master
>
> Jeff Kirsher (1):
> e1000e: Fix default interrupt throttle rate not set in NIC HW
>
> Prasanna S Panchamukhi (1):
> e1000e: MSI interrupt test failed, using legacy interrupt
Pulled, but longer term you guys might want to take Ben's suggestion
and just take the interrupt self-test out altogether.
Thanks.
^ 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