From: Stefan Rompf <stefan@loplof.de>
To: Neil Brown <neilb@suse.de>
Cc: Clemens Fruhwirth <clemens@endorphin.org>, linux-kernel@vger.kernel.org
Subject: Re: [Patch 2.6] dm-crypt: zero key before freeing it
Date: Tue, 24 Jan 2006 22:29:06 +0100 [thread overview]
Message-ID: <200601242229.06995.stefan@loplof.de> (raw)
In-Reply-To: <17365.45558.820747.408425@cse.unsw.edu.au>
Am Dienstag 24 Januar 2006 05:49 schrieb Neil Brown:
> >--- linux-2.6.14.4/drivers/md/dm-crypt.c.old 2005-12-16 18:27:05.000000000
> > +0100 +++ linux-2.6.14.4/drivers/md/dm-crypt.c 2005-12-28
> > 12:49:13.000000000 +0100 @@ -694,6 +694,7 @@ bad3:
> > bad2:
> > crypto_free_tfm(tfm);
> > bad1:
> >+ memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8));
> > kfree(cc);
> > return -EINVAL;
> > }
>
> There is a small problem with this patch.
> If the 'goto bad1' branch is taken, then 'cc->key_size' will not be
> defined.
> I think you need the following patch on top.
Why? This is from today's git, just before the first goto bad1
559 cc->key_size = key_size;
560 if ((!key_size && strcmp(argv[1], "-") != 0) ||
561 (key_size && crypt_decode_key(cc->key, argv[1], key_size) <
0)) {
562 ti->error = PFX "Error decoding key";
563 goto bad1;
564 }
Stefan
next prev parent reply other threads:[~2006-01-24 21:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-04 20:08 [Patch 2.6] dm-crypt: zero key before freeing it Stefan Rompf
2006-01-04 20:09 ` Arjan van de Ven
2006-01-04 20:26 ` Stefan Rompf
2006-01-04 20:28 ` Randy.Dunlap
2006-01-04 20:41 ` Jörn Engel
2006-01-04 20:43 ` Randy.Dunlap
2006-01-04 21:15 ` [stable] " Greg KH
2006-01-04 21:44 ` [Patch 2.6] dm-crypt: Zero key material before free to avoid information leak Stefan Rompf
2006-01-24 4:49 ` [Patch 2.6] dm-crypt: zero key before freeing it Neil Brown
2006-01-24 21:29 ` Stefan Rompf [this message]
2006-01-24 21:44 ` Neil Brown
2006-01-24 23:03 ` Phillip Susi
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=200601242229.06995.stefan@loplof.de \
--to=stefan@loplof.de \
--cc=clemens@endorphin.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
/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