Messages in this thread | | | Date | Sun, 22 Aug 2004 23:31:15 +0200 | From | Jens Maurer <> | Subject | Re: [PATCH] [1/4] /dev/random: Fix latency in rekeying sequence number |
| |
Lee Revell wrote: > This patch does not actually fix the problem, as 3-700usecs is still > spent in the spinlocked region, this just causes it to be done out of a > workqueue.
May I suggest that get_random_bytes() be called *outside* of the spinlocked region on a temporary buffer, assuming that the SHA algorithm is the problem here?
Something like this (untested):
u32 tmp[sizeof(keyptr->secret)/4]; /* on stack */ get_random_bytes(tmp, sizeof(tmp)); spin_lock_bh(&ip_lock); memcpy(keyptr->secret, tmp, sizeof(keyptr->secret)); /* ... other housekeeping ... */ spin_unlock_bh(&ip_lock);
Jens Maurer
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |