* grub-core/normal/crypto.c (grub_crypto_autoload): Prevent
infinite recursion using counter. * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_init): Defer s->crc32 init to skip it if the magic check fails. (dec_stream_header): Init s->crc32.
This commit is contained in:
parent
8f9d3a8c36
commit
7816a17ed1
3 changed files with 19 additions and 5 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2012-01-23 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/normal/crypto.c (grub_crypto_autoload): Prevent
|
||||||
|
infinite recursion using counter.
|
||||||
|
* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_init): Defer s->crc32
|
||||||
|
init to skip it if the magic check fails.
|
||||||
|
(dec_stream_header): Init s->crc32.
|
||||||
|
|
||||||
2012-01-22 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-01-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
2012-01-22 Zachary Bedell <pendorbound@gmail.com>
|
2012-01-22 Zachary Bedell <pendorbound@gmail.com>
|
||||||
2012-01-22 Richard Laager <rlaager@wiktel.com>
|
2012-01-22 Richard Laager <rlaager@wiktel.com>
|
||||||
|
|
|
@ -445,6 +445,8 @@ static enum xz_ret dec_stream_header(struct xz_dec *s)
|
||||||
return XZ_FORMAT_ERROR;
|
return XZ_FORMAT_ERROR;
|
||||||
|
|
||||||
#ifndef GRUB_EMBED_DECOMPRESSOR
|
#ifndef GRUB_EMBED_DECOMPRESSOR
|
||||||
|
s->crc32 = grub_crypto_lookup_md_by_name ("CRC32");
|
||||||
|
|
||||||
if (s->crc32)
|
if (s->crc32)
|
||||||
{
|
{
|
||||||
uint64_t hash_context[(s->crc32->contextsize + 7) / 8];
|
uint64_t hash_context[(s->crc32->contextsize + 7) / 8];
|
||||||
|
@ -958,10 +960,6 @@ struct xz_dec * xz_dec_init(uint32_t dict_max)
|
||||||
|
|
||||||
memset (s, 0, sizeof (*s));
|
memset (s, 0, sizeof (*s));
|
||||||
|
|
||||||
#ifndef GRUB_EMBED_DECOMPRESSOR
|
|
||||||
s->crc32 = grub_crypto_lookup_md_by_name ("CRC32");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
s->single_call = dict_max == 0;
|
s->single_call = dict_max == 0;
|
||||||
|
|
||||||
#ifdef XZ_DEC_BCJ
|
#ifdef XZ_DEC_BCJ
|
||||||
|
|
|
@ -38,6 +38,13 @@ grub_crypto_autoload (const char *name)
|
||||||
{
|
{
|
||||||
struct load_spec *cur;
|
struct load_spec *cur;
|
||||||
grub_dl_t mod;
|
grub_dl_t mod;
|
||||||
|
static int depth = 0;
|
||||||
|
|
||||||
|
/* Some bufio of filesystems may want some crypto modules.
|
||||||
|
It may result in infinite recursion. Hence this check. */
|
||||||
|
if (depth)
|
||||||
|
return;
|
||||||
|
depth++;
|
||||||
|
|
||||||
for (cur = crypto_specs; cur; cur = cur->next)
|
for (cur = crypto_specs; cur; cur = cur->next)
|
||||||
if (grub_strcasecmp (name, cur->name) == 0)
|
if (grub_strcasecmp (name, cur->name) == 0)
|
||||||
|
@ -47,6 +54,7 @@ grub_crypto_autoload (const char *name)
|
||||||
grub_dl_ref (mod);
|
grub_dl_ref (mod);
|
||||||
grub_errno = GRUB_ERR_NONE;
|
grub_errno = GRUB_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
depth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue