Skip to contentSkip to conversation

random32: do not feed jiffies as seed from lpfc driver

PATCH In review Daniel Borkmann 5 participants 7 messages Jul 31, 2014 – Aug 11, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 random32: do not feed jiffies as seed from lpfc driver

In prandom we have already reseeding mechanisms that trigger periodically from a much better entropy source than just feeding in jiffies through lpfc_mbx_cmpl_fcf_scan_read_fcf_rec() [what a function name 8-)]. Therefore, just remove this.

Cc James Bottomley <[email protected]>
Cc James Smart <[email protected]>

---
This can also go via James, how you prefer it.

 drivers/scsi/lpfc/lpfc_hbadisc.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/scsi/lpfc/lpfc_hbadisc.c +0 -4
index 2a17e31..5072bb2 100644
@@ -2146,7 +2146,6 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
 	uint16_t fcf_index, next_fcf_index;
 	struct lpfc_fcf_rec *fcf_rec = NULL;
 	uint16_t vlan_id;
-	uint32_t seed;
 	bool select_new_fcf;
 	int rc;
 
@@ -2383,9 +2382,6 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
 		phba->fcf.fcf_flag |= FCF_AVAILABLE;
 		/* Setup initial running random FCF selection count */
 		phba->fcf.eligible_fcf_cnt = 1;
-		/* Seeding the random number generator for random selection */
-		seed = (uint32_t)(0xFFFFFFFF & jiffies);
-		prandom_seed(seed);
 	}
 	spin_unlock_irq(&phba->hbalock);
 	goto read_next_fcf;
Signature · 1 line
1.7.11.7
maintainer
#1 lore raw

From: Daniel Borkmann <[email protected]>
Date: Thu, 31 Jul 2014 22:08:37 +0200

Quoted 10 lines

In prandom we have already reseeding mechanisms that trigger periodically from a much better entropy source than just feeding in jiffies through lpfc_mbx_cmpl_fcf_scan_read_fcf_rec() [what a function name 8-)]. Therefore, just remove this.

Cc James Bottomley <[email protected]>
Cc James Smart <[email protected]>

---
This can also go via James, how you prefer it.

James can pick this up, thanks.

#2 lore raw
In reply to Daniel Borkmann
Quoted 10 lines · Daniel Borkmann

In prandom we have already reseeding mechanisms that trigger periodically from a much better entropy source than just feeding in jiffies through lpfc_mbx_cmpl_fcf_scan_read_fcf_rec() [what a function name 8-)]. Therefore, just remove this.

Cc James Bottomley <[email protected]>
Cc James Smart <[email protected]>

---
This can also go via James, how you prefer it.

Could you send to [email protected]; Christoph Hellwig is gathering patches for SCSI via that list.

Thanks,

James

#3 lore raw

On 08/01/2014 06:12 AM, James Bottomley wrote:
...

Quoted 2 lines

Could you send to [email protected]; Christoph Hellwig is gathering patches for SCSI via that list.

Sure, done, thanks.

Acked-by on v1 2/2
#4 lore raw
In reply to Daniel Borkmann

-- james s

Quoted 36 lines · Daniel Borkmann

In prandom we have already reseeding mechanisms that trigger periodically from a much better entropy source than just feeding in jiffies through lpfc_mbx_cmpl_fcf_scan_read_fcf_rec() [what a function name 8-)]. Therefore, just remove this.

Cc James Bottomley <[email protected]>
Cc James Smart <[email protected]>

---
This can also go via James, how you prefer it.

  drivers/scsi/lpfc/lpfc_hbadisc.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/scsi/lpfc/lpfc_hbadisc.c +0 -4
index 2a17e31..5072bb2 100644
@@ -2146,7 +2146,6 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
  	uint16_t fcf_index, next_fcf_index;
  	struct lpfc_fcf_rec *fcf_rec = NULL;
  	uint16_t vlan_id;
-	uint32_t seed;
  	bool select_new_fcf;
  	int rc;
 
@@ -2383,9 +2382,6 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
  		phba->fcf.fcf_flag |= FCF_AVAILABLE;
  		/* Setup initial running random FCF selection count */
  		phba->fcf.eligible_fcf_cnt = 1;
-		/* Seeding the random number generator for random selection */
-		seed = (uint32_t)(0xFFFFFFFF & jiffies);
-		prandom_seed(seed);
  	}
  	spin_unlock_irq(&phba->hbalock);
  	goto read_next_fcf;
#5 lore raw
Quoted 1 line · James Smart

Can you jsut queue this up (and the pci fix as well) together with anything else you have pending for 3.18?

I'd really like to move towards a model where maintainers of driver collect everything for their area to spread work a bit better.

#6 lore raw

yep. I'll do so.

-- james s

Quoted 10 lines · Christoph Hellwig
Quoted 1 line · James Smart

Can you jsut queue this up (and the pci fix as well) together with anything else you have pending for 3.18?

I'd really like to move towards a model where maintainers of driver collect everything for their area to spread work a bit better.