Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dec590c1 authored by Thomas Klein's avatar Thomas Klein Committed by Jeff Garzik
Browse files

ehea: Fixed possible kernel panic on VLAN packet recv



This patch fixes a possible kernel panic due to not checking the vlan group
when processing received VLAN packets and a malfunction in VLAN/hypervisor
registration.

Signed-off-by: default avatarThomas Klein <tklein@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 0d04761d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@
#include <asm/io.h>
#include <asm/io.h>


#define DRV_NAME	"ehea"
#define DRV_NAME	"ehea"
#define DRV_VERSION	"EHEA_0061"
#define DRV_VERSION	"EHEA_0064"


#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
	| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
	| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
+5 −7
Original line number Original line Diff line number Diff line
@@ -451,7 +451,8 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev,
				processed_rq3++;
				processed_rq3++;
			}
			}


			if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT)
			if ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT)
			    && port->vgrp)
				vlan_hwaccel_receive_skb(skb, port->vgrp,
				vlan_hwaccel_receive_skb(skb, port->vgrp,
							 cqe->vlan_tag);
							 cqe->vlan_tag);
			else
			else
@@ -1910,10 +1911,7 @@ static void ehea_vlan_rx_register(struct net_device *dev,
		goto out;
		goto out;
	}
	}


	if (grp)
	memset(cb1->vlan_filter, 0, sizeof(cb1->vlan_filter));
	memset(cb1->vlan_filter, 0, sizeof(cb1->vlan_filter));
	else
		memset(cb1->vlan_filter, 0xFF, sizeof(cb1->vlan_filter));


	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
@@ -1947,7 +1945,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
	}
	}


	index = (vid / 64);
	index = (vid / 64);
	cb1->vlan_filter[index] |= ((u64)(1 << (vid & 0x3F)));
	cb1->vlan_filter[index] |= ((u64)(0x8000000000000000 >> (vid & 0x3F)));


	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
@@ -1982,7 +1980,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
	}
	}


	index = (vid / 64);
	index = (vid / 64);
	cb1->vlan_filter[index] &= ~((u64)(1 << (vid & 0x3F)));
	cb1->vlan_filter[index] &= ~((u64)(0x8000000000000000 >> (vid & 0x3F)));


	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);