All of lore.kernel.org
 help / color / mirror / Atom feed
* Current wireless-testing breaks libpcap: mr_alen should be set
@ 2010-03-03  1:00 Pavel Roskin
  2010-03-03  2:36   ` John W. Linville
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Pavel Roskin @ 2010-03-03  1:00 UTC (permalink / raw)
  To: linux-wireless, netdev, tcpdump-workers; +Cc: Jiri Pirko

Hello!

The current wireless-testing appears to have some non-wireless bits from
the upcoming Linux 2.6.34.  As a result, libpcap and all capture
programs that use it are broken.

This patch to libpcap helps:

--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
 			memset(&mr, 0, sizeof(mr));
 			mr.mr_ifindex = handle->md.ifindex;
 			mr.mr_type    = PACKET_MR_PROMISC;
+			mr.mr_alen    = 6;
 			if (setsockopt(sock_fd, SOL_PACKET,
 				PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) == -1)
 			{

libpcap git doesn't have the fix yet.

The breakage must be coming from the commit 914c8ad2 by Jiri Pirko to
net/packet/af_packet.c

I think it's very unhelpful to introduce patches that break significant
userspace functionality without giving the affected programs an advance
warning.

Also, pulling bleeding edge stuff into wireless-testing before rc1
appears to be either a mistake or a bad decision.

Sorry for cross-post, but it's an urgent issue.  Repliers are encouraged
to trim the recipient list as necessary.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Current wireless-testing breaks libpcap: mr_alen should be set
  2010-03-03  1:00 Current wireless-testing breaks libpcap: mr_alen should be set Pavel Roskin
@ 2010-03-03  2:36   ` John W. Linville
  2010-03-03  6:24   ` Jiri Pirko
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 22+ messages in thread
From: John W. Linville @ 2010-03-03  2:36 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless, netdev, tcpdump-workers, Jiri Pirko

On Tue, Mar 02, 2010 at 08:00:48PM -0500, Pavel Roskin wrote:

> Also, pulling bleeding edge stuff into wireless-testing before rc1
> appears to be either a mistake or a bad decision.

Feel free to use an earlier commit...

-- 
John W. Linville                Someday the world will need a hero, and you
linville@tuxdriver.com                  might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Current wireless-testing breaks libpcap: mr_alen should be set
@ 2010-03-03  2:36   ` John W. Linville
  0 siblings, 0 replies; 22+ messages in thread
From: John W. Linville @ 2010-03-03  2:36 UTC (permalink / raw)
  To: Pavel Roskin
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	tcpdump-workers-YE1jQ5a0g24KACXWX4p+q9i2O/JbrIOy, Jiri Pirko

On Tue, Mar 02, 2010 at 08:00:48PM -0500, Pavel Roskin wrote:

> Also, pulling bleeding edge stuff into wireless-testing before rc1
> appears to be either a mistake or a bad decision.

Feel free to use an earlier commit...

-- 
John W. Linville                Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org                  might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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	[flat|nested] 22+ messages in thread

* Re: Current wireless-testing breaks libpcap: mr_alen should be set
  2010-03-03  1:00 Current wireless-testing breaks libpcap: mr_alen should be set Pavel Roskin
@ 2010-03-03  6:24   ` Jiri Pirko
  2010-03-03  6:24   ` Jiri Pirko
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-03  6:24 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless, netdev, tcpdump-workers

Wed, Mar 03, 2010 at 02:00:48AM CET, proski@gnu.org wrote:
>Hello!
>
>The current wireless-testing appears to have some non-wireless bits from
>the upcoming Linux 2.6.34.  As a result, libpcap and all capture
>programs that use it are broken.
>
>This patch to libpcap helps:
>
>--- a/pcap-linux.c
>+++ b/pcap-linux.c
>@@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
> 			memset(&mr, 0, sizeof(mr));
> 			mr.mr_ifindex = handle->md.ifindex;
> 			mr.mr_type    = PACKET_MR_PROMISC;
>+			mr.mr_alen    = 6;
> 			if (setsockopt(sock_fd, SOL_PACKET,
> 				PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) == -1)
> 			{
>
>libpcap git doesn't have the fix yet.
>
>The breakage must be coming from the commit 914c8ad2 by Jiri Pirko to
>net/packet/af_packet.c
>
>I think it's very unhelpful to introduce patches that break significant
>userspace functionality without giving the affected programs an advance
>warning.
>
>Also, pulling bleeding edge stuff into wireless-testing before rc1
>appears to be either a mistake or a bad decision.
>
>Sorry for cross-post, but it's an urgent issue.  Repliers are encouraged
>to trim the recipient list as necessary.

Sorry about this. Corrected patch will follow.

Jirka
>
>-- 
>Regards,
>Pavel Roskin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Current wireless-testing breaks libpcap: mr_alen should be set
@ 2010-03-03  6:24   ` Jiri Pirko
  0 siblings, 0 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-03  6:24 UTC (permalink / raw)
  To: Pavel Roskin
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	tcpdump-workers-YE1jQ5a0g24KACXWX4p+q9i2O/JbrIOy

Wed, Mar 03, 2010 at 02:00:48AM CET, proski-mXXj517/zsQ@public.gmane.org wrote:
>Hello!
>
>The current wireless-testing appears to have some non-wireless bits from
>the upcoming Linux 2.6.34.  As a result, libpcap and all capture
>programs that use it are broken.
>
>This patch to libpcap helps:
>
>--- a/pcap-linux.c
>+++ b/pcap-linux.c
>@@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
> 			memset(&mr, 0, sizeof(mr));
> 			mr.mr_ifindex = handle->md.ifindex;
> 			mr.mr_type    = PACKET_MR_PROMISC;
>+			mr.mr_alen    = 6;
> 			if (setsockopt(sock_fd, SOL_PACKET,
> 				PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) == -1)
> 			{
>
>libpcap git doesn't have the fix yet.
>
>The breakage must be coming from the commit 914c8ad2 by Jiri Pirko to
>net/packet/af_packet.c
>
>I think it's very unhelpful to introduce patches that break significant
>userspace functionality without giving the affected programs an advance
>warning.
>
>Also, pulling bleeding edge stuff into wireless-testing before rc1
>appears to be either a mistake or a bad decision.
>
>Sorry for cross-post, but it's an urgent issue.  Repliers are encouraged
>to trim the recipient list as necessary.

Sorry about this. Corrected patch will follow.

Jirka
>
>-- 
>Regards,
>Pavel Roskin
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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	[flat|nested] 22+ messages in thread

* [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
  2010-03-03  1:00 Current wireless-testing breaks libpcap: mr_alen should be set Pavel Roskin
  2010-03-03  2:36   ` John W. Linville
  2010-03-03  6:24   ` Jiri Pirko
@ 2010-03-03  6:40 ` Jiri Pirko
  2010-03-03  6:57     ` Eric Dumazet
                     ` (3 more replies)
  2010-03-03 15:31   ` Frank W. Miller
  2010-03-06 21:23 ` Guy Harris
  4 siblings, 4 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-03  6:40 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-wireless, netdev, tcpdump-workers, proski

Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]

My previous patch 914c8ad2d18b62ad1420f518c0cab0b0b90ab308 incorrectly changed
the length check in packet_mc_add to be more strict. The problem is that
userspace is not filling this field (and it stays zeroed) in case of setting
PACKET_MR_PROMISC or PACKET_MR_ALLMULTI. So move the strict check to the point
in path where the addr_len must be set correctly.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 031a5e6..1612d41 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1688,6 +1688,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
 {
 	switch (i->type) {
 	case PACKET_MR_MULTICAST:
+		if (i->alen != dev->addr_len)
+			return -EINVAL;
 		if (what > 0)
 			return dev_mc_add(dev, i->addr, i->alen, 0);
 		else
@@ -1700,6 +1702,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
 		return dev_set_allmulti(dev, what);
 		break;
 	case PACKET_MR_UNICAST:
+		if (i->alen != dev->addr_len)
+			return -EINVAL;
 		if (what > 0)
 			return dev_unicast_add(dev, i->addr);
 		else
@@ -1734,7 +1738,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq)
 		goto done;
 
 	err = -EINVAL;
-	if (mreq->mr_alen != dev->addr_len)
+	if (mreq->mr_alen > dev->addr_len)
 		goto done;
 
 	err = -ENOBUFS;

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: Current wireless-testing breaks libpcap: mr_alen should be set
  2010-03-03  6:24   ` Jiri Pirko
  (?)
@ 2010-03-03  6:57   ` Pavel Roskin
  -1 siblings, 0 replies; 22+ messages in thread
From: Pavel Roskin @ 2010-03-03  6:57 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev

Quoting Jiri Pirko <jpirko@redhat.com>:

> Sorry about this. Corrected patch will follow.

I guess the address length should not be checked if the address is not  
supplied, as in this case.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  6:57     ` Eric Dumazet
  0 siblings, 0 replies; 22+ messages in thread
From: Eric Dumazet @ 2010-03-03  6:57 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, linux-wireless, tcpdump-workers, proski

Le mercredi 03 mars 2010 à 07:40 +0100, Jiri Pirko a écrit :
> Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
> 
> My previous patch 914c8ad2d18b62ad1420f518c0cab0b0b90ab308 incorrectly changed
> the length check in packet_mc_add to be more strict. The problem is that
> userspace is not filling this field (and it stays zeroed) in case of setting
> PACKET_MR_PROMISC or PACKET_MR_ALLMULTI. So move the strict check to the point
> in path where the addr_len must be set correctly.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> 

I am not sure it solves Pavel Roskin concern, but some credit should be
given to him :)

Reported-by: Pavel Roskin <proski@gnu.org>

Thanks



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  6:57     ` Eric Dumazet
  0 siblings, 0 replies; 22+ messages in thread
From: Eric Dumazet @ 2010-03-03  6:57 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	tcpdump-workers-YE1jQ5a0g24KACXWX4p+q9i2O/JbrIOy,
	proski-mXXj517/zsQ

Le mercredi 03 mars 2010 à 07:40 +0100, Jiri Pirko a écrit :
> Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
> 
> My previous patch 914c8ad2d18b62ad1420f518c0cab0b0b90ab308 incorrectly changed
> the length check in packet_mc_add to be more strict. The problem is that
> userspace is not filling this field (and it stays zeroed) in case of setting
> PACKET_MR_PROMISC or PACKET_MR_ALLMULTI. So move the strict check to the point
> in path where the addr_len must be set correctly.
> 
> Signed-off-by: Jiri Pirko <jpirko-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 

I am not sure it solves Pavel Roskin concern, but some credit should be
given to him :)

Reported-by: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>

Thanks


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
  2010-03-03  6:40 ` [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del] Jiri Pirko
  2010-03-03  6:57     ` Eric Dumazet
@ 2010-03-03  7:01   ` Pavel Roskin
  2010-03-03  7:36     ` Jiri Pirko
  2010-03-03  9:05     ` Jiri Pirko
  2010-03-03  9:06     ` David Miller
  3 siblings, 1 reply; 22+ messages in thread
From: Pavel Roskin @ 2010-03-03  7:01 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem

Quoting Jiri Pirko <jpirko@redhat.com>:

> @@ -1734,7 +1738,7 @@ static int packet_mc_add(struct sock *sk,   
> struct packet_mreq_max *mreq)
>  		goto done;
>
>  	err = -EINVAL;
> -	if (mreq->mr_alen != dev->addr_len)
> +	if (mreq->mr_alen > dev->addr_len)
>  		goto done;
>
>  	err = -ENOBUFS;

The patch looks good, but did you mean to include this change?  It's  
not described.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
  2010-03-03  7:01   ` Pavel Roskin
@ 2010-03-03  7:36     ` Jiri Pirko
  0 siblings, 0 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-03  7:36 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: netdev, davem

Wed, Mar 03, 2010 at 08:01:10AM CET, proski@gnu.org wrote:
>Quoting Jiri Pirko <jpirko@redhat.com>:
>
>>@@ -1734,7 +1738,7 @@ static int packet_mc_add(struct sock *sk,
>>struct packet_mreq_max *mreq)
>> 		goto done;
>>
>> 	err = -EINVAL;
>>-	if (mreq->mr_alen != dev->addr_len)
>>+	if (mreq->mr_alen > dev->addr_len)
>> 		goto done;
>>
>> 	err = -ENOBUFS;
>
>The patch looks good, but did you mean to include this change?  It's
>not described.

Sure - this is revert of the bit from my original patch. I think it's clear from
description.

Jirka

>
>-- 
>Regards,
>Pavel Roskin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  9:05     ` Jiri Pirko
  0 siblings, 0 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-03  9:05 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, tcpdump-workers, proski, netdev

Wed, Mar 03, 2010 at 07:40:01AM CET, jpirko@redhat.com wrote:
>Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]

Dave please apply this against net-next-2.6. I see that 914c8ad2d18b is still not in
net-2.6.

Thanks a lot

Jirka

>
>My previous patch 914c8ad2d18b62ad1420f518c0cab0b0b90ab308 incorrectly changed
>the length check in packet_mc_add to be more strict. The problem is that
>userspace is not filling this field (and it stays zeroed) in case of setting
>PACKET_MR_PROMISC or PACKET_MR_ALLMULTI. So move the strict check to the point
>in path where the addr_len must be set correctly.
>
>Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
>index 031a5e6..1612d41 100644
>--- a/net/packet/af_packet.c
>+++ b/net/packet/af_packet.c
>@@ -1688,6 +1688,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
> {
> 	switch (i->type) {
> 	case PACKET_MR_MULTICAST:
>+		if (i->alen != dev->addr_len)
>+			return -EINVAL;
> 		if (what > 0)
> 			return dev_mc_add(dev, i->addr, i->alen, 0);
> 		else
>@@ -1700,6 +1702,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
> 		return dev_set_allmulti(dev, what);
> 		break;
> 	case PACKET_MR_UNICAST:
>+		if (i->alen != dev->addr_len)
>+			return -EINVAL;
> 		if (what > 0)
> 			return dev_unicast_add(dev, i->addr);
> 		else
>@@ -1734,7 +1738,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq)
> 		goto done;
> 
> 	err = -EINVAL;
>-	if (mreq->mr_alen != dev->addr_len)
>+	if (mreq->mr_alen > dev->addr_len)
> 		goto done;
> 
> 	err = -ENOBUFS;

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  9:05     ` Jiri Pirko
  0 siblings, 0 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-03  9:05 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	tcpdump-workers-YE1jQ5a0g24KACXWX4p+q9i2O/JbrIOy,
	proski-mXXj517/zsQ, netdev-u79uwXL29TY76Z2rM5mHXA

Wed, Mar 03, 2010 at 07:40:01AM CET, jpirko-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
>Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]

Dave please apply this against net-next-2.6. I see that 914c8ad2d18b is still not in
net-2.6.

Thanks a lot

Jirka

>
>My previous patch 914c8ad2d18b62ad1420f518c0cab0b0b90ab308 incorrectly changed
>the length check in packet_mc_add to be more strict. The problem is that
>userspace is not filling this field (and it stays zeroed) in case of setting
>PACKET_MR_PROMISC or PACKET_MR_ALLMULTI. So move the strict check to the point
>in path where the addr_len must be set correctly.
>
>Signed-off-by: Jiri Pirko <jpirko-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>
>diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
>index 031a5e6..1612d41 100644
>--- a/net/packet/af_packet.c
>+++ b/net/packet/af_packet.c
>@@ -1688,6 +1688,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
> {
> 	switch (i->type) {
> 	case PACKET_MR_MULTICAST:
>+		if (i->alen != dev->addr_len)
>+			return -EINVAL;
> 		if (what > 0)
> 			return dev_mc_add(dev, i->addr, i->alen, 0);
> 		else
>@@ -1700,6 +1702,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
> 		return dev_set_allmulti(dev, what);
> 		break;
> 	case PACKET_MR_UNICAST:
>+		if (i->alen != dev->addr_len)
>+			return -EINVAL;
> 		if (what > 0)
> 			return dev_unicast_add(dev, i->addr);
> 		else
>@@ -1734,7 +1738,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq)
> 		goto done;
> 
> 	err = -EINVAL;
>-	if (mreq->mr_alen != dev->addr_len)
>+	if (mreq->mr_alen > dev->addr_len)
> 		goto done;
> 
> 	err = -ENOBUFS;
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  9:06       ` David Miller
  0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2010-03-03  9:06 UTC (permalink / raw)
  To: jpirko; +Cc: linux-wireless, tcpdump-workers, proski, netdev

From: Jiri Pirko <jpirko@redhat.com>
Date: Wed, 3 Mar 2010 10:05:13 +0100

> Wed, Mar 03, 2010 at 07:40:01AM CET, jpirko@redhat.com wrote:
>>Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
> 
> Dave please apply this against net-next-2.6. I see that 914c8ad2d18b is still not in
> net-2.6.

Would you relax?

I just rebased net-2.6 and net-next-2.6 after Linus took in my
changes and I just applied your regression fix to my tree and
was about to let you know I applied it.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  9:06       ` David Miller
  0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2010-03-03  9:06 UTC (permalink / raw)
  To: jpirko-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	tcpdump-workers-YE1jQ5a0g24KACXWX4p+q9i2O/JbrIOy,
	proski-mXXj517/zsQ, netdev-u79uwXL29TY76Z2rM5mHXA

From: Jiri Pirko <jpirko-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Wed, 3 Mar 2010 10:05:13 +0100

> Wed, Mar 03, 2010 at 07:40:01AM CET, jpirko-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
>>Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
> 
> Dave please apply this against net-next-2.6. I see that 914c8ad2d18b is still not in
> net-2.6.

Would you relax?

I just rebased net-2.6 and net-next-2.6 after Linus took in my
changes and I just applied your regression fix to my tree and
was about to let you know I applied it.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  9:06     ` David Miller
  0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2010-03-03  9:06 UTC (permalink / raw)
  To: jpirko; +Cc: netdev, linux-wireless, tcpdump-workers, proski

From: Jiri Pirko <jpirko@redhat.com>
Date: Wed, 3 Mar 2010 07:40:01 +0100

> Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
> 
> My previous patch 914c8ad2d18b62ad1420f518c0cab0b0b90ab308 incorrectly changed
> the length check in packet_mc_add to be more strict. The problem is that
> userspace is not filling this field (and it stays zeroed) in case of setting
> PACKET_MR_PROMISC or PACKET_MR_ALLMULTI. So move the strict check to the point
> in path where the addr_len must be set correctly.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>

Applied.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
@ 2010-03-03  9:06     ` David Miller
  0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2010-03-03  9:06 UTC (permalink / raw)
  To: jpirko-H+wXaHxf7aLQT0dZR+AlfA
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	tcpdump-workers-YE1jQ5a0g24KACXWX4p+q9i2O/JbrIOy,
	proski-mXXj517/zsQ

From: Jiri Pirko <jpirko-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Wed, 3 Mar 2010 07:40:01 +0100

> Subject: [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
> 
> My previous patch 914c8ad2d18b62ad1420f518c0cab0b0b90ab308 incorrectly changed
> the length check in packet_mc_add to be more strict. The problem is that
> userspace is not filling this field (and it stays zeroed) in case of setting
> PACKET_MR_PROMISC or PACKET_MR_ALLMULTI. So move the strict check to the point
> in path where the addr_len must be set correctly.
> 
> Signed-off-by: Jiri Pirko <jpirko-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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	[flat|nested] 22+ messages in thread

* RE: [tcpdump-workers] Current wireless-testing breaks libpcap: mr_alen should be set
  2010-03-03  1:00 Current wireless-testing breaks libpcap: mr_alen should be set Pavel Roskin
@ 2010-03-03 15:31   ` Frank W. Miller
  2010-03-03  6:24   ` Jiri Pirko
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 22+ messages in thread
From: Frank W. Miller @ 2010-03-03 15:31 UTC (permalink / raw)
  To: tcpdump-workers, linux-wireless, netdev; +Cc: 'Jiri Pirko'


Would this be preventing pcap_inject() from working say in kernel 2.6.31
(stock FC12 kernel)?

Thanks,
FM


> -----Original Message-----
> From: tcpdump-workers-owner@lists.tcpdump.org [mailto:tcpdump-workers-
> owner@lists.tcpdump.org] On Behalf Of Pavel Roskin
> Sent: Tuesday, March 02, 2010 6:01 PM
> To: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; tcpdump-
> workers@lists.tcpdump.org
> Cc: Jiri Pirko
> Subject: [tcpdump-workers] Current wireless-testing breaks libpcap:
> mr_alen should be set
> 
> Hello!
> 
> The current wireless-testing appears to have some non-wireless bits from
> the upcoming Linux 2.6.34.  As a result, libpcap and all capture
> programs that use it are broken.
> 
> This patch to libpcap helps:
> 
> --- a/pcap-linux.c
> +++ b/pcap-linux.c
> @@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
>  			memset(&mr, 0, sizeof(mr));
>  			mr.mr_ifindex = handle->md.ifindex;
>  			mr.mr_type    = PACKET_MR_PROMISC;
> +			mr.mr_alen    = 6;
>  			if (setsockopt(sock_fd, SOL_PACKET,
>  				PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) ==
-1)
>  			{
> 
> libpcap git doesn't have the fix yet.
> 
> The breakage must be coming from the commit 914c8ad2 by Jiri Pirko to
> net/packet/af_packet.c
> 
> I think it's very unhelpful to introduce patches that break significant
> userspace functionality without giving the affected programs an advance
> warning.
> 
> Also, pulling bleeding edge stuff into wireless-testing before rc1
> appears to be either a mistake or a bad decision.
> 
> Sorry for cross-post, but it's an urgent issue.  Repliers are encouraged
> to trim the recipient list as necessary.
> 
> --
> Regards,
> Pavel Roskin
> -
> This is the tcpdump-workers list.
> Visit https://cod.sandelman.ca/ to unsubscribe.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Current wireless-testing breaks libpcap: mr_alen should be set
@ 2010-03-03 15:31   ` Frank W. Miller
  0 siblings, 0 replies; 22+ messages in thread
From: Frank W. Miller @ 2010-03-03 15:31 UTC (permalink / raw)
  To: tcpdump-workers, linux-wireless, netdev; +Cc: 'Jiri Pirko'


Would this be preventing pcap_inject() from working say in kernel 2.6.31
(stock FC12 kernel)?

Thanks,
FM


> -----Original Message-----
> From: tcpdump-workers-owner@lists.tcpdump.org [mailto:tcpdump-workers-
> owner@lists.tcpdump.org] On Behalf Of Pavel Roskin
> Sent: Tuesday, March 02, 2010 6:01 PM
> To: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; tcpdump-
> workers@lists.tcpdump.org
> Cc: Jiri Pirko
> Subject: [tcpdump-workers] Current wireless-testing breaks libpcap:
> mr_alen should be set
> 
> Hello!
> 
> The current wireless-testing appears to have some non-wireless bits from
> the upcoming Linux 2.6.34.  As a result, libpcap and all capture
> programs that use it are broken.
> 
> This patch to libpcap helps:
> 
> --- a/pcap-linux.c
> +++ b/pcap-linux.c
> @@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
>  			memset(&mr, 0, sizeof(mr));
>  			mr.mr_ifindex = handle->md.ifindex;
>  			mr.mr_type    = PACKET_MR_PROMISC;
> +			mr.mr_alen    = 6;
>  			if (setsockopt(sock_fd, SOL_PACKET,
>  				PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) ==
-1)
>  			{
> 
> libpcap git doesn't have the fix yet.
> 
> The breakage must be coming from the commit 914c8ad2 by Jiri Pirko to
> net/packet/af_packet.c
> 
> I think it's very unhelpful to introduce patches that break significant
> userspace functionality without giving the affected programs an advance
> warning.
> 
> Also, pulling bleeding edge stuff into wireless-testing before rc1
> appears to be either a mistake or a bad decision.
> 
> Sorry for cross-post, but it's an urgent issue.  Repliers are encouraged
> to trim the recipient list as necessary.
> 
> --
> Regards,
> Pavel Roskin
> -
> This is the tcpdump-workers list.
> Visit https://cod.sandelman.ca/ to unsubscribe.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [tcpdump-workers] Current wireless-testing breaks libpcap: mr_alen should be set
  2010-03-03 15:31   ` Frank W. Miller
  (?)
@ 2010-03-03 15:54   ` Jiri Pirko
  -1 siblings, 0 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-03 15:54 UTC (permalink / raw)
  To: Frank W. Miller; +Cc: tcpdump-workers, linux-wireless, netdev

Wed, Mar 03, 2010 at 04:31:07PM CET, frankwmiller@frankwmiller.net wrote:
>
>Would this be preventing pcap_inject() from working say in kernel 2.6.31
>(stock FC12 kernel)?

Nope. The patch went in just recently.

>
>Thanks,
>FM
>
>
>> -----Original Message-----
>> From: tcpdump-workers-owner@lists.tcpdump.org [mailto:tcpdump-workers-
>> owner@lists.tcpdump.org] On Behalf Of Pavel Roskin
>> Sent: Tuesday, March 02, 2010 6:01 PM
>> To: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; tcpdump-
>> workers@lists.tcpdump.org
>> Cc: Jiri Pirko
>> Subject: [tcpdump-workers] Current wireless-testing breaks libpcap:
>> mr_alen should be set
>> 
>> Hello!
>> 
>> The current wireless-testing appears to have some non-wireless bits from
>> the upcoming Linux 2.6.34.  As a result, libpcap and all capture
>> programs that use it are broken.
>> 
>> This patch to libpcap helps:
>> 
>> --- a/pcap-linux.c
>> +++ b/pcap-linux.c
>> @@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
>>  			memset(&mr, 0, sizeof(mr));
>>  			mr.mr_ifindex = handle->md.ifindex;
>>  			mr.mr_type    = PACKET_MR_PROMISC;
>> +			mr.mr_alen    = 6;
>>  			if (setsockopt(sock_fd, SOL_PACKET,
>>  				PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) ==
>-1)
>>  			{
>> 
>> libpcap git doesn't have the fix yet.
>> 
>> The breakage must be coming from the commit 914c8ad2 by Jiri Pirko to
>> net/packet/af_packet.c
>> 
>> I think it's very unhelpful to introduce patches that break significant
>> userspace functionality without giving the affected programs an advance
>> warning.
>> 
>> Also, pulling bleeding edge stuff into wireless-testing before rc1
>> appears to be either a mistake or a bad decision.
>> 
>> Sorry for cross-post, but it's an urgent issue.  Repliers are encouraged
>> to trim the recipient list as necessary.
>> 
>> --
>> Regards,
>> Pavel Roskin
>> -
>> This is the tcpdump-workers list.
>> Visit https://cod.sandelman.ca/ to unsubscribe.
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [tcpdump-workers] Current wireless-testing breaks libpcap: mr_alen should be set
  2010-03-03  1:00 Current wireless-testing breaks libpcap: mr_alen should be set Pavel Roskin
                   ` (3 preceding siblings ...)
  2010-03-03 15:31   ` Frank W. Miller
@ 2010-03-06 21:23 ` Guy Harris
  2010-03-08  8:11   ` Jiri Pirko
  4 siblings, 1 reply; 22+ messages in thread
From: Guy Harris @ 2010-03-06 21:23 UTC (permalink / raw)
  To: tcpdump-workers; +Cc: linux-wireless, netdev, Jiri Pirko


On Mar 2, 2010, at 5:00 PM, Pavel Roskin wrote:

> This patch to libpcap helps:
> 
> --- a/pcap-linux.c
> +++ b/pcap-linux.c
> @@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
> 			memset(&mr, 0, sizeof(mr));
> 			mr.mr_ifindex = handle->md.ifindex;
> 			mr.mr_type    = PACKET_MR_PROMISC;
> +			mr.mr_alen    = 6;

If there are any network types that support promiscuous mode and have link-layer addresses that aren't 6 octets long, that would still fail.

It sounds as if the fix is not to care about the address length if the address isn't used, so you don't need to get the length right for PACKET_MR_PROMISC or PACKET_MR_ALLMULTI, so libpcap, and other clients setting promiscuous or "show me all multicast packets" mode, don't need to change.  Is that the case?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [tcpdump-workers] Current wireless-testing breaks libpcap: mr_alen should be set
  2010-03-06 21:23 ` Guy Harris
@ 2010-03-08  8:11   ` Jiri Pirko
  0 siblings, 0 replies; 22+ messages in thread
From: Jiri Pirko @ 2010-03-08  8:11 UTC (permalink / raw)
  To: Guy Harris; +Cc: tcpdump-workers, linux-wireless, netdev

Sat, Mar 06, 2010 at 10:23:12PM CET, guy@alum.mit.edu wrote:
>
>On Mar 2, 2010, at 5:00 PM, Pavel Roskin wrote:
>
>> This patch to libpcap helps:
>> 
>> --- a/pcap-linux.c
>> +++ b/pcap-linux.c
>> @@ -1563,6 +1563,7 @@ live_open_new(pcap_t *handle, const char
>> 			memset(&mr, 0, sizeof(mr));
>> 			mr.mr_ifindex = handle->md.ifindex;
>> 			mr.mr_type    = PACKET_MR_PROMISC;
>> +			mr.mr_alen    = 6;
>
>If there are any network types that support promiscuous mode and have link-layer addresses that aren't 6 octets long, that would still fail.
>
>It sounds as if the fix is not to care about the address length if the address isn't used, so you don't need to get the length right for PACKET_MR_PROMISC or PACKET_MR_ALLMULTI, so libpcap, and other clients setting promiscuous or "show me all multicast packets" mode, don't need to change.  Is that the case?

This should be fixed in kernel (net-2.6
1162563f82b434e3099c9e6c1bbdba846d792f0d)

Jirka

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-03-08  8:11 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03  1:00 Current wireless-testing breaks libpcap: mr_alen should be set Pavel Roskin
2010-03-03  2:36 ` John W. Linville
2010-03-03  2:36   ` John W. Linville
2010-03-03  6:24 ` Jiri Pirko
2010-03-03  6:24   ` Jiri Pirko
2010-03-03  6:57   ` Pavel Roskin
2010-03-03  6:40 ` [net-2.6 PATCH] af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del] Jiri Pirko
2010-03-03  6:57   ` Eric Dumazet
2010-03-03  6:57     ` Eric Dumazet
2010-03-03  7:01   ` Pavel Roskin
2010-03-03  7:36     ` Jiri Pirko
2010-03-03  9:05   ` Jiri Pirko
2010-03-03  9:05     ` Jiri Pirko
2010-03-03  9:06     ` David Miller
2010-03-03  9:06       ` David Miller
2010-03-03  9:06   ` David Miller
2010-03-03  9:06     ` David Miller
2010-03-03 15:31 ` [tcpdump-workers] Current wireless-testing breaks libpcap: mr_alen should be set Frank W. Miller
2010-03-03 15:31   ` Frank W. Miller
2010-03-03 15:54   ` [tcpdump-workers] " Jiri Pirko
2010-03-06 21:23 ` Guy Harris
2010-03-08  8:11   ` Jiri Pirko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.