Skip to contentSkip to conversation

xenguest: Add xsa-25 decompression limit prototypes

PATCH Superseded Andrew Cooper 2 participants 4 messages Jan 25, 2013 – Jan 28, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenguest: Add xsa-25 decompression limit prototypes

To allow xenguest consumers to also make use of the extra protection added as a result of xsa-25.

tools/libxc/xenguest.h +7 -0
diff -r 5af4f2ab06f3 -r daec50a41570 tools/libxc/xenguest.h
@@ -177,6 +177,13 @@ int xc_dom_linux_build(xc_interface *xch
 		       unsigned int console_evtchn,
 		       unsigned long *console_mfn);
 
+#ifndef XC_HAVE_DECOMPRESS_LIMITS
+#define XC_HAVE_DECOMPRESS_LIMITS
+#endif
+
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
+
 /**
  * This function will create a domain for a paravirtualized Linux
  * using buffers for kernel and initrd
#1 lore raw
Quoted 9 lines · Andrew Cooper

To allow xenguest consumers to also make use of the extra protection added as a result of xsa-25.

diff -r 5af4f2ab06f3 -r daec50a41570 tools/libxc/xenguest.h

tools/libxc/xenguest.h int xc_dom_linux_build(xc_interface *xch · line 182

Quoted 6 lines
tools/libxc/xenguest.h +3 -0
@@ -177,6 +177,13 @@ int xc_dom_linux_build(xc_interface *xch
 		       unsigned int console_evtchn,
 		       unsigned long *console_mfn);
 
+#ifndef XC_HAVE_DECOMPRESS_LIMITS
+#define XC_HAVE_DECOMPRESS_LIMITS
+#endif

This sort of thing isn't in general needed for the libxc interface, which already makes very little in the way of API stability guarantees. The only existing example uses XENCTRL_HAS_* so if this is really felt to be useful it should match.

Also this file has multiple inclusion guards so the ifndef really isn't necessary.

tools/libxc/xenguest.h int xc_dom_linux_build(xc_interface *xch · line 185

Quoted 2 lines
tools/libxc/xenguest.h +2 -0
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);

These duplicate the ones in xc_dom.h, if the prototypes there aren't sufficient then they should be moved not repeated.

Quoted 4 lines
tools/libxc/xenguest.h +1 -0
+
 /**
  * This function will create a domain for a paravirtualized Linux
  * using buffers for kernel and initrd
#2 lore raw
Quoted 21 lines · Ian Campbell
Quoted 9 lines · Andrew Cooper

To allow xenguest consumers to also make use of the extra protection added as a result of xsa-25.

diff -r 5af4f2ab06f3 -r daec50a41570 tools/libxc/xenguest.h

tools/libxc/xenguest.h int xc_dom_linux_build(xc_interface *xch · line 182

Quoted 6 lines
tools/libxc/xenguest.h +3 -0
@@ -177,6 +177,13 @@ int xc_dom_linux_build(xc_interface *xch
 		       unsigned int console_evtchn,
 		       unsigned long *console_mfn);
 
+#ifndef XC_HAVE_DECOMPRESS_LIMITS
+#define XC_HAVE_DECOMPRESS_LIMITS
+#endif

This sort of thing isn't in general needed for the libxc interface, which already makes very little in the way of API stability guarantees. The only existing example uses XENCTRL_HAS_* so if this is really felt to be useful it should match.

Quoted 7 lines

Also this file has multiple inclusion guards so the ifndef really isn't necessary.

tools/libxc/xenguest.h int xc_dom_linux_build(xc_interface *xch · line 185

Quoted 2 lines
tools/libxc/xenguest.h +2 -0
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);

These duplicate the ones in xc_dom.h, if the prototypes there aren't sufficient then they should be moved not repeated.

xenguest.h includes no files whatsoever, and every single prototype in it is a duplicate of other functions in xc_*.h header files. This appears to be the point. Furthermore, it is the only file referenced by the ocaml subs for libxc, and the xenguest helper utility for Xapi.

~Andrew

Quoted 6 lines
Quoted 5 lines
tools/libxc/xenguest.h +1 -0
+
 /**
  * This function will create a domain for a paravirtualized Linux
  * using buffers for kernel and initrd
#3 lore raw
Quoted 25 lines · Andrew Cooper
Quoted 24 lines · Ian Campbell
Quoted 9 lines · Andrew Cooper

To allow xenguest consumers to also make use of the extra protection added as a result of xsa-25.

diff -r 5af4f2ab06f3 -r daec50a41570 tools/libxc/xenguest.h

tools/libxc/xenguest.h int xc_dom_linux_build(xc_interface *xch · line 182

Quoted 6 lines
tools/libxc/xenguest.h +3 -0
@@ -177,6 +177,13 @@ int xc_dom_linux_build(xc_interface *xch
 		       unsigned int console_evtchn,
 		       unsigned long *console_mfn);
 
+#ifndef XC_HAVE_DECOMPRESS_LIMITS
+#define XC_HAVE_DECOMPRESS_LIMITS
+#endif

This sort of thing isn't in general needed for the libxc interface, which already makes very little in the way of API stability guarantees. The only existing example uses XENCTRL_HAS_* so if this is really felt to be useful it should match.

Also this file has multiple inclusion guards so the ifndef really isn't necessary.

Quoted 6 lines
Quoted 4 lines

tools/libxc/xenguest.h int xc_dom_linux_build(xc_interface *xch · line 185

Quoted 2 lines
tools/libxc/xenguest.h +2 -0
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);

These duplicate the ones in xc_dom.h, if the prototypes there aren't sufficient then they should be moved not repeated.

xenguest.h includes no files whatsoever,

I said you should move them, not change the #includes. Not that changing the #includes isn't a good idea too.

Quoted 2 lines

and every single prototype in
it is a duplicate of other functions in xc_*.h header files.

I don't know what tree you are looking at but that's not the case in unstable. A random sampling of xc_linux_build, xc_linux_build_mem and xc_await_suspend shows that they are only defined in xenguest.h. Likewise none of the functions in xc_dom.h that I checked were defined anywhere else but in that file.

Quoted 3 lines

This
appears to be the point. Furthermore, it is the only file referenced by the ocaml subs for libxc,

What on earth are you talking about:

$ rgrep \#include tools/ocaml/libs/xc/
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <stdlib.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <errno.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <caml/alloc.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <caml/memory.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <caml/signals.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <caml/fail.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <caml/callback.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <sys/mman.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <stdint.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <string.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include <xenctrl.h>
tools/ocaml/libs/xc/xenctrl_stubs.c:#include "mmap_stubs.h"

Not only is it not the only file referenced, it's not even referenced at all!

Quoted 1 line

and the xenguest helper utility for Xapi.

Possibly, but that doesn't preclude fixing that if that is the right thing to do.

Ian.