Re: [RFC PATCH 34/35] Add the Xen virtual network device driver.



+static int setup_device(struct xenbus_device *dev, struct
netfront_info *info) +{
+ struct netif_tx_sring *txs;
+ struct netif_rx_sring *rxs;
+ int err;
+ struct net_device *netdev = info->netdev;
+
+ info->tx_ring_ref = GRANT_INVALID_REF;
+ info->rx_ring_ref = GRANT_INVALID_REF;
+ info->rx.sring = NULL;
+ info->tx.sring = NULL;
+ info->irq = 0;
+
+ txs = (struct netif_tx_sring *)get_zeroed_page(GFP_KERNEL);
+ if (!txs) {
+ err = -ENOMEM;
+ xenbus_dev_fatal(dev, err, "allocating tx ring
page");
+ goto fail;
+ }
+ rxs = (struct netif_rx_sring *)get_zeroed_page(GFP_KERNEL);
+ if (!rxs) {
+ err = -ENOMEM;
+ xenbus_dev_fatal(dev, err, "allocating rx ring
page");
+ free_page((unsigned long)txs);
+ goto fail;
+ }
+ info->backend_state = BEST_DISCONNECTED;
+
+ SHARED_RING_INIT(txs);
+ FRONT_RING_INIT(&info->tx, txs, PAGE_SIZE);
+
+ SHARED_RING_INIT(rxs);
+ FRONT_RING_INIT(&info->rx, rxs, PAGE_SIZE);
+
+ err = xenbus_grant_ring(dev, virt_to_mfn(txs));
+ if (err < 0)
+ goto fail;
+ info->tx_ring_ref = err;
+
+ err = xenbus_grant_ring(dev, virt_to_mfn(rxs));
+ if (err < 0)
+ goto fail;
+ info->rx_ring_ref = err;
+
+ err = xenbus_alloc_evtchn(dev, &info->evtchn);
+ if (err)
+ goto fail;
+
+ memcpy(netdev->dev_addr, info->mac, ETH_ALEN);
+ network_connect(netdev);
+ info->irq = bind_evtchn_to_irqhandler(
+ info->evtchn, netif_int, SA_SAMPLE_RANDOM,
netdev->name,


This doesn't look like a real random entropy source. packets
arriving from another domain are easily timed.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [RFC PATCH 34/35] Add the Xen virtual network device driver.
    ... This doesn't look like a real random entropy source. ... arriving from another domain are easily timed. ... Heh, given the path they take, that sadly may not be the case;-) ...
    (Linux-Kernel)
  • Re: [RFC PATCH 34/35] Add the Xen virtual network device driver.
    ... This doesn't look like a real random entropy source. ... arriving from another domain are easily timed. ... Where should we get our entropy from in a VM environment? ...
    (Linux-Kernel)
  • Re: use keep state(strict) to mitigate tcp issues?
    ... >> When deploying a BSD with IPF in at the network perimeter ... >> connection because it's not unlikely that packets arrive out of order. ... in how many connecties would packets be ... but if they would be arriving out of order ...
    (FreeBSD-Security)
  • Re: Can anyone identify these packets?
    ... >I've just installed a firewall that lets me view packets sent from and ... >arriving at my computer. ... Among the stuff I recognize are some packets ... appropriate to post to if you have a security concern. ...
    (comp.security.unix)
  • Re: Can anyone identify these packets?
    ... >I've just installed a firewall that lets me view packets sent from and ... >arriving at my computer. ... Among the stuff I recognize are some packets ... >National Communications Network. ...
    (comp.security.misc)