aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJavier Martinez Canillas <martinez.javier@gmail.com>2011-03-28 12:27:31 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-31 01:28:14 -0400
commitab392d2d6d4e2e50502985eead545b44ee58802c (patch)
tree7a05c3726db3f95e5efe6bc6314deafa27884158 /drivers/net
parentb3abfbd2951102f5f5b8fe251a672e5223ac972b (diff)
drivers/net: Remove IRQF_SAMPLE_RANDOM flag from network drivers
The IRQF_SAMPLE_RANDOM flag is marked as deprecated and will be removed. Every input point to the kernel's entropy pool have to better document the type of entropy source it is. drivers/char/random.c now implements a set of interfaces that can be used for devices to collect enviromental noise. IRQF_SAMPLE_RANDOM will be replaced with these add_*_randomness exported functions. Network drivers are not a good source of entropy. They use as a source of entropy essentially a remote host. Which means that the source of entropy can be potentially controlled by an attacker. Also, with heavy workloads the entropy decreases due to less hardware interrupts happening thanks to irq mitigation and NAPI. If a system relies in its network interface as a entropy source it has a false sense of security. Systems that don't have devices whose drivers are good sources of entropy, should either use a hardware random number generator or feed the kernel's entropy pool from userspace using other sources of entropy such as EGD, video_entropyd, timer_entropyd and audio-entropyd. Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/atlx/atl1.c2
-rw-r--r--drivers/net/bcm63xx_enet.c4
-rw-r--r--drivers/net/cris/eth_v10.c4
-rw-r--r--drivers/net/ibmlana.c3
-rw-r--r--drivers/net/macb.c3
-rw-r--r--drivers/net/netxen/netxen_nic_main.c2
-rw-r--r--drivers/net/niu.c3
-rw-r--r--drivers/net/qla3xxx.c2
-rw-r--r--drivers/net/tg3.c4
-rw-r--r--drivers/net/xen-netfront.c3
10 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 67f40b9c16ed..e973d056dc8f 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2572,7 +2572,7 @@ static s32 atl1_up(struct atl1_adapter *adapter)
2572{ 2572{
2573 struct net_device *netdev = adapter->netdev; 2573 struct net_device *netdev = adapter->netdev;
2574 int err; 2574 int err;
2575 int irq_flags = IRQF_SAMPLE_RANDOM; 2575 int irq_flags = 0;
2576 2576
2577 /* hardware has been reset, we need to reload some things */ 2577 /* hardware has been reset, we need to reload some things */
2578 atlx_set_multi(netdev); 2578 atlx_set_multi(netdev);
diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c
index e94a966af418..2af413fbfb0e 100644
--- a/drivers/net/bcm63xx_enet.c
+++ b/drivers/net/bcm63xx_enet.c
@@ -839,8 +839,8 @@ static int bcm_enet_open(struct net_device *dev)
839 if (ret) 839 if (ret)
840 goto out_phy_disconnect; 840 goto out_phy_disconnect;
841 841
842 ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, 842 ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, IRQF_DISABLED,
843 IRQF_SAMPLE_RANDOM | IRQF_DISABLED, dev->name, dev); 843 dev->name, dev);
844 if (ret) 844 if (ret)
845 goto out_freeirq; 845 goto out_freeirq;
846 846
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 80c2feeefec5..e759d74edd01 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -491,8 +491,8 @@ e100_open(struct net_device *dev)
491 491
492 /* allocate the irq corresponding to the receiving DMA */ 492 /* allocate the irq corresponding to the receiving DMA */
493 493
494 if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt, 494 if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt, 0, cardname,
495 IRQF_SAMPLE_RANDOM, cardname, (void *)dev)) { 495 (void *)dev)) {
496 goto grace_exit0; 496 goto grace_exit0;
497 } 497 }
498 498
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index 94d9969ec0bb..f872f966927a 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -782,7 +782,8 @@ static int ibmlana_open(struct net_device *dev)
782 782
783 /* register resources - only necessary for IRQ */ 783 /* register resources - only necessary for IRQ */
784 784
785 result = request_irq(priv->realirq, irq_handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); 785 result = request_irq(priv->realirq, irq_handler, IRQF_SHARED,
786 dev->name, dev);
786 if (result != 0) { 787 if (result != 0) {
787 printk(KERN_ERR "%s: failed to register irq %d\n", dev->name, dev->irq); 788 printk(KERN_ERR "%s: failed to register irq %d\n", dev->name, dev->irq);
788 return result; 789 return result;
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 79ccb54ab00c..2cb4e792f871 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1171,8 +1171,7 @@ static int __init macb_probe(struct platform_device *pdev)
1171 } 1171 }
1172 1172
1173 dev->irq = platform_get_irq(pdev, 0); 1173 dev->irq = platform_get_irq(pdev, 0);
1174 err = request_irq(dev->irq, macb_interrupt, IRQF_SAMPLE_RANDOM, 1174 err = request_irq(dev->irq, macb_interrupt, 0, dev->name, dev);
1175 dev->name, dev);
1176 if (err) { 1175 if (err) {
1177 printk(KERN_ERR 1176 printk(KERN_ERR
1178 "%s: Unable to request IRQ %d (error %d)\n", 1177 "%s: Unable to request IRQ %d (error %d)\n",
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 83348dc4b184..933671556c15 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -905,7 +905,7 @@ netxen_nic_request_irq(struct netxen_adapter *adapter)
905 struct nx_host_sds_ring *sds_ring; 905 struct nx_host_sds_ring *sds_ring;
906 int err, ring; 906 int err, ring;
907 907
908 unsigned long flags = IRQF_SAMPLE_RANDOM; 908 unsigned long flags = 0;
909 struct net_device *netdev = adapter->netdev; 909 struct net_device *netdev = adapter->netdev;
910 struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; 910 struct netxen_recv_context *recv_ctx = &adapter->recv_ctx;
911 911
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 32678b6c6b39..681a42ca5c51 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6071,8 +6071,7 @@ static int niu_request_irq(struct niu *np)
6071 for (i = 0; i < np->num_ldg; i++) { 6071 for (i = 0; i < np->num_ldg; i++) {
6072 struct niu_ldg *lp = &np->ldg[i]; 6072 struct niu_ldg *lp = &np->ldg[i];
6073 6073
6074 err = request_irq(lp->irq, niu_interrupt, 6074 err = request_irq(lp->irq, niu_interrupt, IRQF_SHARED,
6075 IRQF_SHARED | IRQF_SAMPLE_RANDOM,
6076 np->irq_name[i], lp); 6075 np->irq_name[i], lp);
6077 if (err) 6076 if (err)
6078 goto out_free_irqs; 6077 goto out_free_irqs;
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 348b4f1367c9..f3f737b91248 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -3468,7 +3468,7 @@ static int ql_adapter_up(struct ql3_adapter *qdev)
3468{ 3468{
3469 struct net_device *ndev = qdev->ndev; 3469 struct net_device *ndev = qdev->ndev;
3470 int err; 3470 int err;
3471 unsigned long irq_flags = IRQF_SAMPLE_RANDOM | IRQF_SHARED; 3471 unsigned long irq_flags = IRQF_SHARED;
3472 unsigned long hw_flags; 3472 unsigned long hw_flags;
3473 3473
3474 if (ql_alloc_mem_resources(qdev)) { 3474 if (ql_alloc_mem_resources(qdev)) {
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 73c942d85f07..b7e03a6ebf25 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8839,12 +8839,12 @@ static int tg3_request_irq(struct tg3 *tp, int irq_num)
8839 fn = tg3_msi; 8839 fn = tg3_msi;
8840 if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) 8840 if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
8841 fn = tg3_msi_1shot; 8841 fn = tg3_msi_1shot;
8842 flags = IRQF_SAMPLE_RANDOM; 8842 flags = 0;
8843 } else { 8843 } else {
8844 fn = tg3_interrupt; 8844 fn = tg3_interrupt;
8845 if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) 8845 if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)
8846 fn = tg3_interrupt_tagged; 8846 fn = tg3_interrupt_tagged;
8847 flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM; 8847 flags = IRQF_SHARED;
8848 } 8848 }
8849 8849
8850 return request_irq(tnapi->irq_vec, fn, flags, name, tnapi); 8850 return request_irq(tnapi->irq_vec, fn, flags, name, tnapi);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 5c8d9c385be0..c06f5a09b263 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1416,8 +1416,7 @@ static int setup_netfront(struct xenbus_device *dev, struct netfront_info *info)
1416 goto fail; 1416 goto fail;
1417 1417
1418 err = bind_evtchn_to_irqhandler(info->evtchn, xennet_interrupt, 1418 err = bind_evtchn_to_irqhandler(info->evtchn, xennet_interrupt,
1419 IRQF_SAMPLE_RANDOM, netdev->name, 1419 0, netdev->name, netdev);
1420 netdev);
1421 if (err < 0) 1420 if (err < 0)
1422 goto fail; 1421 goto fail;
1423 netdev->irq = err; 1422 netdev->irq = err;