lkml.org 
[lkml]   [2004]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.028 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site