linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: David H?rdeman <david@2gen.com>
Cc: linux-kernel@vger.kernel.org, dhowells@redhat.com, david@2gen.com
Subject: Re: [PATCH 02/04] Add dsa crypto ops
Date: Tue, 24 Jan 2006 12:22:02 +1100	[thread overview]
Message-ID: <E1F1Csk-0000lm-00@gondolin.me.apana.org.au> (raw)
In-Reply-To: <11380489523918@2gen.com>

David H?rdeman <david@2gen.com> wrote:
>
> +static int dsa_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags)
> +{
> +       struct dsa_ctx *dctx = ctx;
> +
> +       if (keylen != sizeof(struct key_payload_dsa *)) {
> +               printk("Invalid key size in dsa_setkey\n");
> +               return -EINVAL;
> +       }
> +
> +       dctx->key = (struct key_payload_dsa *)key;
> +       return 0;
> +}

This is bad.  You're putting a pointer to an object with an unknown
lifetime into the tfm.

Is there anything wrong with allocating the memory for it and storing
the key in the tfm like everyone else?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  parent reply	other threads:[~2006-01-24  1:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11380489522552@2gen.com>
2006-01-23 20:42 ` [PATCH 02/04] Add dsa crypto ops David Härdeman
2006-01-23 20:42   ` [PATCH 03/04] Add encryption ops to the keyctl syscall David Härdeman
2006-01-23 20:42     ` [PATCH 04/04] Add dsa key type David Härdeman
2006-01-24 11:08       ` David Howells
2006-01-25 19:14         ` David Härdeman
2006-01-26  9:41         ` David Howells
2006-01-24  4:33     ` [PATCH 03/04] Add encryption ops to the keyctl syscall Randy.Dunlap
2006-01-24 10:58     ` David Howells
2006-01-25 20:40       ` David Härdeman
2006-01-26  9:43       ` David Howells
2006-01-24 11:09     ` David Howells
2006-01-24  1:22   ` Herbert Xu [this message]
2006-01-24  6:49     ` [PATCH 02/04] Add dsa crypto ops David Härdeman
2006-01-24 10:37 ` [PATCH 01/04] Add multi-precision-integer maths library David Howells
2006-01-25 20:46   ` David Härdeman
2006-01-26  9:45   ` David Howells
2006-01-26 21:58 [PATCH 00/04] Add DSA key type David Härdeman
2006-01-26 21:58 ` [PATCH 02/04] Add dsa crypto ops David Härdeman

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=E1F1Csk-0000lm-00@gondolin.me.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=david@2gen.com \
    --cc=dhowells@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;
as well as URLs for NNTP newsgroup(s).