lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CB0FEA6.3030206@netscape.net>
Date:	Sat, 09 Oct 2010 17:45:42 -0600
From:	Patrick Simmons <linuxrocks123@...scape.net>
To:	netdev@...r.kernel.org
Subject: [PATCH] Add IRQF_SAMPLE_RANDOM Flag to forcedeth

This patch adds the IRQF_SAMPLE_RANDOM flag to the forcedeth driver, 
allowing the interrupt timing for forcedeth to be used for entropy 
generation.  This should help /dev/random generate more secure random 
numbers on machines using this driver.

Signed-off-by: Patrick Simmons <linuxrocks123@...scape.net>

Please CC me with any comments as I am not subscribed to the list.

--- linux/drivers/net/forcedeth.c.orig    2010-10-09 17:12:08.400000015 
-0600
+++ linux/drivers/net/forcedeth.c    2010-10-09 17:14:44.880000015 -0600
@@ -3819,7 +3819,7 @@ static int nv_request_irq(struct net_dev
                  /* Request irq for rx handling */
                  sprintf(np->name_rx, "%s-rx", dev->name);
                  if 
(request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector,
-                        nv_nic_irq_rx, IRQF_SHARED, np->name_rx, dev) 
!= 0) {
+                        nv_nic_irq_rx, IRQF_SHARED | 
IRQF_SAMPLE_RANDOM, np->name_rx, dev) != 0) {
                      printk(KERN_INFO "forcedeth: request_irq failed 
for rx %d\n", ret);
                      pci_disable_msix(np->pci_dev);
                      np->msi_flags &= ~NV_MSI_X_ENABLED;
@@ -3828,7 +3828,7 @@ static int nv_request_irq(struct net_dev
                  /* Request irq for tx handling */
                  sprintf(np->name_tx, "%s-tx", dev->name);
                  if 
(request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector,
-                        nv_nic_irq_tx, IRQF_SHARED, np->name_tx, dev) 
!= 0) {
+                        nv_nic_irq_tx, IRQF_SHARED | 
IRQF_SAMPLE_RANDOM, np->name_tx, dev) != 0) {
                      printk(KERN_INFO "forcedeth: request_irq failed 
for tx %d\n", ret);
                      pci_disable_msix(np->pci_dev);
                      np->msi_flags &= ~NV_MSI_X_ENABLED;
@@ -3837,7 +3837,7 @@ static int nv_request_irq(struct net_dev
                  /* Request irq for link and timer handling */
                  sprintf(np->name_other, "%s-other", dev->name);
                  if 
(request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector,
-                        nv_nic_irq_other, IRQF_SHARED, np->name_other, 
dev) != 0) {
+                        nv_nic_irq_other, IRQF_SHARED | 
IRQF_SAMPLE_RANDOM, np->name_other, dev) != 0) {
                      printk(KERN_INFO "forcedeth: request_irq failed 
for link %d\n", ret);
                      pci_disable_msix(np->pci_dev);
                      np->msi_flags &= ~NV_MSI_X_ENABLED;
@@ -3851,7 +3851,7 @@ static int nv_request_irq(struct net_dev
                  set_msix_vector_map(dev, NV_MSI_X_VECTOR_OTHER, 
NVREG_IRQ_OTHER);
              } else {
                  /* Request irq for all interrupts */
-                if 
(request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, handler, 
IRQF_SHARED, dev->name, dev) != 0) {
+                if 
(request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, handler, 
IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev) != 0) {
                      printk(KERN_INFO "forcedeth: request_irq failed 
%d\n", ret);
                      pci_disable_msix(np->pci_dev);
                      np->msi_flags &= ~NV_MSI_X_ENABLED;
@@ -3868,7 +3868,7 @@ static int nv_request_irq(struct net_dev
          if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
              np->msi_flags |= NV_MSI_ENABLED;
              dev->irq = np->pci_dev->irq;
-            if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED, 
dev->name, dev) != 0) {
+            if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED | 
IRQF_SAMPLE_RANDOM, dev->name, dev) != 0) {
                  printk(KERN_INFO "forcedeth: request_irq failed %d\n", 
ret);
                  pci_disable_msi(np->pci_dev);
                  np->msi_flags &= ~NV_MSI_ENABLED;
@@ -3884,7 +3884,7 @@ static int nv_request_irq(struct net_dev
          }
      }
      if (ret != 0) {
-        if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED, 
dev->name, dev) != 0)
+        if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED | 
IRQF_SAMPLE_RANDOM, dev->name, dev) != 0)
              goto out_err;

      }

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists