]> git.pld-linux.org Git - packages/qemu.git/blob - qemu-CVE-2008-2004.patch
- up to 0.10.0
[packages/qemu.git] / qemu-CVE-2008-2004.patch
1 --- vl.c        2008-01-06 14:38:42.000000000 -0500
2 +++ vl.c        2008-05-13 09:56:45.000000000 -0400
3 @@ -4877,13 +4877,14 @@
4      int bus_id, unit_id;
5      int cyls, heads, secs, translation;
6      BlockDriverState *bdrv;
7 +    BlockDriver *drv = NULL;
8      int max_devs;
9      int index;
10      int cache;
11      int bdrv_flags;
12      char *params[] = { "bus", "unit", "if", "index", "cyls", "heads",
13                         "secs", "trans", "media", "snapshot", "file",
14 -                       "cache", NULL };
15 +                      "cache", "format", NULL };
16  
17      if (check_params(buf, sizeof(buf), params, str) < 0) {
18           fprintf(stderr, "qemu: unknowm parameter '%s' in '%s'\n",
19 @@ -5051,6 +5052,14 @@
20          }
21      }
22  
23 +    if (get_param_value(buf, sizeof(buf), "format", str)) {
24 +        drv = bdrv_find_format(buf);
25 +        if (!drv) {
26 +           fprintf(stderr, "qemu: '%s' invalid format\n", buf);
27 +           return -1;
28 +         }
29 +    }
30 +
31      get_param_value(file, sizeof(file), "file", str);
32  
33      /* compute bus and unit according index */
34 @@ -5150,7 +5159,7 @@
35          bdrv_flags |= BDRV_O_SNAPSHOT;
36      if (!cache)
37          bdrv_flags |= BDRV_O_DIRECT;
38 -    if (bdrv_open(bdrv, file, bdrv_flags) < 0 || qemu_key_check(bdrv, file)) {
39 +    if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) {
40          fprintf(stderr, "qemu: could not open disk image %s\n",
41                          file);
42          return -1;
43 --- qemu-doc.texi       2008-01-06 14:38:42.000000000 -0500
44 +++ qemu-doc.texi       2008-05-13 09:57:57.000000000 -0400
45 @@ -252,6 +252,10 @@
46  @var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}).
47  @item cache=@var{cache}
48  @var{cache} is "on" or "off" and allows to disable host cache to access data.
49 +@item format=@var{format}
50 +Specify which disk @var{format} will be used rather than detecting
51 +the format.  Can be used to specifiy format=raw to avoid interpreting
52 +an untrusted format header.
53  @end table
54  
55  Instead of @option{-cdrom} you can use:
This page took 0.0762620000000001 seconds and 3 git commands to generate.