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

Commit ab392d2d authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by David S. Miller
Browse files

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: default avatarJavier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3abfbd2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2572,7 +2572,7 @@ static s32 atl1_up(struct atl1_adapter *adapter)
{
	struct net_device *netdev = adapter->netdev;
	int err;
	int irq_flags = IRQF_SAMPLE_RANDOM;
	int irq_flags = 0;

	/* hardware has been reset, we need to reload some things */
	atlx_set_multi(netdev);
+2 −2
Original line number Diff line number Diff line
@@ -839,8 +839,8 @@ static int bcm_enet_open(struct net_device *dev)
	if (ret)
		goto out_phy_disconnect;

	ret = request_irq(priv->irq_rx, bcm_enet_isr_dma,
			  IRQF_SAMPLE_RANDOM | IRQF_DISABLED, dev->name, dev);
	ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, IRQF_DISABLED,
			  dev->name, dev);
	if (ret)
		goto out_freeirq;

+2 −2
Original line number Diff line number Diff line
@@ -491,8 +491,8 @@ e100_open(struct net_device *dev)

	/* allocate the irq corresponding to the receiving DMA */

	if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt,
			IRQF_SAMPLE_RANDOM, cardname, (void *)dev)) {
	if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt, 0, cardname,
			(void *)dev)) {
		goto grace_exit0;
	}

+2 −1
Original line number Diff line number Diff line
@@ -782,7 +782,8 @@ static int ibmlana_open(struct net_device *dev)

	/* register resources - only necessary for IRQ */

	result = request_irq(priv->realirq, irq_handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev);
	result = request_irq(priv->realirq, irq_handler, IRQF_SHARED,
			     dev->name, dev);
	if (result != 0) {
		printk(KERN_ERR "%s: failed to register irq %d\n", dev->name, dev->irq);
		return result;
+1 −2
Original line number Diff line number Diff line
@@ -1171,8 +1171,7 @@ static int __init macb_probe(struct platform_device *pdev)
	}

	dev->irq = platform_get_irq(pdev, 0);
	err = request_irq(dev->irq, macb_interrupt, IRQF_SAMPLE_RANDOM,
			  dev->name, dev);
	err = request_irq(dev->irq, macb_interrupt, 0, dev->name, dev);
	if (err) {
		printk(KERN_ERR
		       "%s: Unable to request IRQ %d (error %d)\n",
Loading