public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Maurer <Jens.Maurer@gmx.net>
To: Lee Revell <rlrevell@joe-job.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [1/4] /dev/random: Fix latency in rekeying sequence	number
Date: Sun, 22 Aug 2004 23:31:15 +0200	[thread overview]
Message-ID: <412910A3.6070100@gmx.net> (raw)
In-Reply-To: <1092978626.10063.15.camel@krustophenia.net>


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


      reply	other threads:[~2004-08-22 21:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-20  4:57 [PATCH] [1/4] /dev/random: Fix latency in rekeying sequence number Theodore Ts'o
2004-08-20  5:10 ` Lee Revell
2004-08-22 21:31   ` Jens Maurer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=412910A3.6070100@gmx.net \
    --to=jens.maurer@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlrevell@joe-job.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox