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

Commit 28a395c7 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: qualcomm: rmnet: Fix use after free while sending command ack"

parents 5c32804e 2a3d83c1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
			       struct rmnet_port *port)
{
	struct rmnet_map_control_command *cmd;
	int xmit_status;
	struct net_device *dev = skb->dev;

	if (port->data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4)
		skb_trim(skb,
@@ -78,9 +78,9 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
	cmd = RMNET_MAP_GET_CMD_START(skb);
	cmd->cmd_type = type & 0x03;

	netif_tx_lock(skb->dev);
	xmit_status = skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev);
	netif_tx_unlock(skb->dev);
	netif_tx_lock(dev);
	dev->netdev_ops->ndo_start_xmit(skb, dev);
	netif_tx_unlock(dev);
}

/* Process MAP command frame and send N/ACK message as appropriate. Message cmd
+4 −0
Original line number Diff line number Diff line
@@ -227,6 +227,10 @@ void rmnet_vnd_setup(struct net_device *rmnet_dev)

	rmnet_dev->needs_free_netdev = true;
	rmnet_dev->ethtool_ops = &rmnet_ethtool_ops;

	/* This perm addr will be used as interface identifier by IPv6 */
	rmnet_dev->addr_assign_type = NET_ADDR_RANDOM;
	eth_random_addr(rmnet_dev->perm_addr);
}

/* Exposed API */
+3 −1
Original line number Diff line number Diff line
@@ -2216,6 +2216,7 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
		return addrconf_ifid_ieee1394(eui, dev);
	case ARPHRD_TUNNEL6:
	case ARPHRD_IP6GRE:
	case ARPHRD_RAWIP:
		return addrconf_ifid_ip6tnl(eui, dev);
	}
	return -1;
@@ -3247,7 +3248,8 @@ static void addrconf_dev_config(struct net_device *dev)
	    (dev->type != ARPHRD_IP6GRE) &&
	    (dev->type != ARPHRD_IPGRE) &&
	    (dev->type != ARPHRD_TUNNEL) &&
	    (dev->type != ARPHRD_NONE)) {
	    (dev->type != ARPHRD_NONE) &&
	    (dev->type != ARPHRD_RAWIP)) {
		/* Alas, we support only Ethernet autoconfiguration. */
		return;
	}