* [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used. @ 2010-11-08 21:23 Jesse Gross 2010-11-08 21:26 ` David Miller 2010-12-07 19:50 ` [stable] " Greg KH 0 siblings, 2 replies; 5+ messages in thread From: Jesse Gross @ 2010-11-08 21:23 UTC (permalink / raw) To: stable; +Cc: netdev, David Miller Normally hardware accelerated vlan packets are quickly dropped if there is no corresponding vlan device configured. The one exception is promiscuous mode, where we allow all of these packets through so they can be picked up by tcpdump. However, this behavior causes a crash if we actually try to receive these packets. This fixes that crash by ignoring packets with vids not corresponding to a configured device in the vlan hwaccel routines and then dropping them before they get to consumers in the network stack. This patch applies only to 2.6.36 stable. The problem was introduced in that release and is already fixed by larger changes to the vlan code in 2.6.37. Reported-by: Ben Greear <greearb@candelatech.com> Tested-by: Nikola Ciprich <extmaillist@linuxbox.cz> Signed-off-by: Jesse Gross <jesse@nicira.com> --- net/8021q/vlan_core.c | 3 +++ net/core/dev.c | 13 +++++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 0eb96f7..2dcff0b 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c @@ -43,6 +43,9 @@ int vlan_hwaccel_do_receive(struct sk_buff *skb) struct net_device *dev = skb->dev; struct vlan_rx_stats *rx_stats; + if (unlikely(!is_vlan_dev(dev))) + return 0; + skb->dev = vlan_dev_info(dev)->real_dev; netif_nit_deliver(skb); diff --git a/net/core/dev.c b/net/core/dev.c index 660dd41..dd72996 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2891,6 +2891,19 @@ static int __netif_receive_skb(struct sk_buff *skb) ncls: #endif + /* If we got this far with a hardware accelerated VLAN tag, it means + * that we were put in promiscuous mode but nobody is interested in + * this vid. Drop the packet now to prevent it from getting propagated + * to other parts of the stack that won't know how to deal with packets + * tagged in this manner. + */ + if (unlikely(vlan_tx_tag_present(skb))) { + if (pt_prev) + ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); + kfree_skb(skb); + goto out; + } + /* Handle special case of bridge or macvlan */ rx_handler = rcu_dereference(skb->dev->rx_handler); if (rx_handler) { -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used. 2010-11-08 21:23 [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used Jesse Gross @ 2010-11-08 21:26 ` David Miller 2010-12-07 19:50 ` [stable] " Greg KH 1 sibling, 0 replies; 5+ messages in thread From: David Miller @ 2010-11-08 21:26 UTC (permalink / raw) To: jesse; +Cc: stable, netdev From: Jesse Gross <jesse@nicira.com> Date: Mon, 8 Nov 2010 13:23:01 -0800 > Normally hardware accelerated vlan packets are quickly dropped if > there is no corresponding vlan device configured. The one exception > is promiscuous mode, where we allow all of these packets through so > they can be picked up by tcpdump. However, this behavior causes a > crash if we actually try to receive these packets. This fixes that > crash by ignoring packets with vids not corresponding to a configured > device in the vlan hwaccel routines and then dropping them before they > get to consumers in the network stack. > > This patch applies only to 2.6.36 stable. The problem was introduced > in that release and is already fixed by larger changes to the vlan > code in 2.6.37. > > Reported-by: Ben Greear <greearb@candelatech.com> > Tested-by: Nikola Ciprich <extmaillist@linuxbox.cz> > Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: David S. Miller <davem@davemloft.net> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [stable] [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used. 2010-11-08 21:23 [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used Jesse Gross 2010-11-08 21:26 ` David Miller @ 2010-12-07 19:50 ` Greg KH 2010-12-07 20:50 ` Eric Dumazet 1 sibling, 1 reply; 5+ messages in thread From: Greg KH @ 2010-12-07 19:50 UTC (permalink / raw) To: Jesse Gross; +Cc: stable, netdev, David Miller On Mon, Nov 08, 2010 at 01:23:01PM -0800, Jesse Gross wrote: > Normally hardware accelerated vlan packets are quickly dropped if > there is no corresponding vlan device configured. The one exception > is promiscuous mode, where we allow all of these packets through so > they can be picked up by tcpdump. However, this behavior causes a > crash if we actually try to receive these packets. This fixes that > crash by ignoring packets with vids not corresponding to a configured > device in the vlan hwaccel routines and then dropping them before they > get to consumers in the network stack. > > This patch applies only to 2.6.36 stable. The problem was introduced > in that release and is already fixed by larger changes to the vlan > code in 2.6.37. Applied, thanks. greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [stable] [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used. 2010-12-07 19:50 ` [stable] " Greg KH @ 2010-12-07 20:50 ` Eric Dumazet 2010-12-07 21:03 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: Eric Dumazet @ 2010-12-07 20:50 UTC (permalink / raw) To: Greg KH; +Cc: Jesse Gross, stable, netdev, David Miller Le mardi 07 décembre 2010 à 11:50 -0800, Greg KH a écrit : > On Mon, Nov 08, 2010 at 01:23:01PM -0800, Jesse Gross wrote: > > Normally hardware accelerated vlan packets are quickly dropped if > > there is no corresponding vlan device configured. The one exception > > is promiscuous mode, where we allow all of these packets through so > > they can be picked up by tcpdump. However, this behavior causes a > > crash if we actually try to receive these packets. This fixes that > > crash by ignoring packets with vids not corresponding to a configured > > device in the vlan hwaccel routines and then dropping them before they > > get to consumers in the network stack. > > > > This patch applies only to 2.6.36 stable. The problem was introduced > > in that release and is already fixed by larger changes to the vlan > > code in 2.6.37. > > Applied, thanks. > Oh well, which version ? A new version of the patch was submitted 6 days ago . http://patchwork.ozlabs.org/patch/73791/ Thanks ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [stable] [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used. 2010-12-07 20:50 ` Eric Dumazet @ 2010-12-07 21:03 ` Greg KH 0 siblings, 0 replies; 5+ messages in thread From: Greg KH @ 2010-12-07 21:03 UTC (permalink / raw) To: Eric Dumazet; +Cc: netdev, Jesse Gross, stable, David Miller [-- Attachment #1: Type: text/plain, Size: 1198 bytes --] On Tue, Dec 07, 2010 at 09:50:26PM +0100, Eric Dumazet wrote: > Le mardi 07 décembre 2010 à 11:50 -0800, Greg KH a écrit : > > On Mon, Nov 08, 2010 at 01:23:01PM -0800, Jesse Gross wrote: > > > Normally hardware accelerated vlan packets are quickly dropped if > > > there is no corresponding vlan device configured. The one exception > > > is promiscuous mode, where we allow all of these packets through so > > > they can be picked up by tcpdump. However, this behavior causes a > > > crash if we actually try to receive these packets. This fixes that > > > crash by ignoring packets with vids not corresponding to a configured > > > device in the vlan hwaccel routines and then dropping them before they > > > get to consumers in the network stack. > > > > > > This patch applies only to 2.6.36 stable. The problem was introduced > > > in that release and is already fixed by larger changes to the vlan > > > code in 2.6.37. > > > > Applied, thanks. > > > > Oh well, which version ? > > A new version of the patch was submitted 6 days ago . > > http://patchwork.ozlabs.org/patch/73791/ I applied the one below. If that is incorrect, please send me the correct one. thanks, greg k-h [-- Attachment #2: vlan-avoid-hwaccel-vlan-packets-when-vid-not-used.patch --] [-- Type: text/x-patch, Size: 2482 bytes --] >From jesse@nicira.com Tue Dec 7 11:49:39 2010 From: Jesse Gross <jesse@nicira.com> Date: Mon, 8 Nov 2010 13:23:01 -0800 Subject: [stable] [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used. To: stable@kernel.org Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net> Message-ID: <1289251381-6671-1-git-send-email-jesse@nicira.com> From: Jesse Gross <jesse@nicira.com> [This patch applies only to 2.6.36 stable. The problem was introduced in that release and is already fixed by larger changes to the vlan code in 2.6.37.] Normally hardware accelerated vlan packets are quickly dropped if there is no corresponding vlan device configured. The one exception is promiscuous mode, where we allow all of these packets through so they can be picked up by tcpdump. However, this behavior causes a crash if we actually try to receive these packets. This fixes that crash by ignoring packets with vids not corresponding to a configured device in the vlan hwaccel routines and then dropping them before they get to consumers in the network stack. Reported-by: Ben Greear <greearb@candelatech.com> Tested-by: Nikola Ciprich <extmaillist@linuxbox.cz> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: David Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- net/8021q/vlan_core.c | 3 +++ net/core/dev.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c @@ -43,6 +43,9 @@ int vlan_hwaccel_do_receive(struct sk_bu struct net_device *dev = skb->dev; struct vlan_rx_stats *rx_stats; + if (unlikely(!is_vlan_dev(dev))) + return 0; + skb->dev = vlan_dev_info(dev)->real_dev; netif_nit_deliver(skb); --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2891,6 +2891,19 @@ static int __netif_receive_skb(struct sk ncls: #endif + /* If we got this far with a hardware accelerated VLAN tag, it means + * that we were put in promiscuous mode but nobody is interested in + * this vid. Drop the packet now to prevent it from getting propagated + * to other parts of the stack that won't know how to deal with packets + * tagged in this manner. + */ + if (unlikely(vlan_tx_tag_present(skb))) { + if (pt_prev) + ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); + kfree_skb(skb); + goto out; + } + /* Handle special case of bridge or macvlan */ rx_handler = rcu_dereference(skb->dev->rx_handler); if (rx_handler) { ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-12-07 21:03 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-11-08 21:23 [PATCH 2.6.36 stable] vlan: Avoid hwaccel vlan packets when vid not used Jesse Gross 2010-11-08 21:26 ` David Miller 2010-12-07 19:50 ` [stable] " Greg KH 2010-12-07 20:50 ` Eric Dumazet 2010-12-07 21:03 ` Greg KH
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).