public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Makarenko <mole@quadra.ru>
To: James Morris <jmorris@redhat.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>,
	davem@davemloft.net, linux-kernel@vger.kernel.org
Subject: Re: using crypto_digest() on non-kmalloc'd memory failures
Date: Tue, 19 Oct 2004 00:05:41 +0400	[thread overview]
Message-ID: <41742215.8020005@quadra.ru> (raw)
In-Reply-To: <Xine.LNX.4.44.0410181534180.24062-100000@thoron.boston.redhat.com>

James Morris wrote:

>On Mon, 18 Oct 2004, Matt Domsch wrote:
>
>  
>
>>James, David,
>>
>>Oleg noted that when we call crypto_digest() on memory allocated as a
>>static array in a module, rather than kmalloc(GFP_KERNEL), it returns
>>incorrect data, and with other functions, a kernel panic.
>>
>>Thoughts as to why this may be?  Oleg's test patch appended.
>>    
>>
>
>I don't recall the exact details, but it's related to using kmap in the 
>core crypto code.
>
>
>- James
>  
>
So to calculate digest on some static data I need to copy them to 
kmalloc'ed memory first, right?

Can this copying be somehow avoided?

And one more question on crypto api. It looks like it is not very 
effective for a single byte "block" ciphers as arc4. The overhead is 
probably too big. Just look at the loop in cipher.c/crypt() and the code 
in arc4.c/arc4_crypt(). All this code is called for every single clear 
text byte. Right? Looks like an overkill for bsize == 1.

Is there any better way to use crypto api for arc4 or similar ciphers? 
Cipher block size is not always a natural choice for the crypto_yield(). 
Especially for fast ciphers (arc4) and small "block" sizes (arc4 again).

Or have I missed something obvious?

=oleg


  reply	other threads:[~2004-10-18 20:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 19:29 using crypto_digest() on non-kmalloc'd memory failures Matt Domsch
2004-10-18 19:35 ` James Morris
2004-10-18 20:05   ` Oleg Makarenko [this message]
2004-10-18 20:16     ` David S. Miller
2004-10-18 23:04     ` James Morris
2004-10-19  5:41       ` Oleg Makarenko
2004-10-18 20:30 ` Brian Gerst
2004-10-18 22:10 ` Gene Heskett
2004-10-18 22:29   ` dupes (was Re: using crypto_digest() on non-kmalloc'd memory failures) Matt Domsch

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=41742215.8020005@quadra.ru \
    --to=mole@quadra.ru \
    --cc=Matt_Domsch@dell.com \
    --cc=davem@davemloft.net \
    --cc=jmorris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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