search for: val_flags

Displaying 6 results from an estimated 6 matches for "val_flags".

2019 Apr 23
4
[PATCH nbdkit 0/2] Be careful not to leak heap memory to the client.
This bug was found by Eric Blake. In the .pread method we allocate a buffer in the server and pass it to the plugin. The plugin is supposed to fill it with data. The buffer was uninitialized so initially contained random heap data, but that's OK provided the plugin fully overwrote it with data. All correctly written plugins ought to do this, however there is the possibility of an
2019 Apr 23
0
[PATCH nbdkit 1/2] ocaml: Initialize pread buffer with zeroes to avoid leaking heap memory.
...uint32_t count, uint64_t offset, caml_leave_blocking_section (); strv = caml_alloc_string (count); + /* Initialize the buffer with zeroes in case the plugin does not + * fill it completely. + */ + memset (String_val (strv), 0, count); offsetv = caml_copy_int64 (offset); flagsv = Val_flags (flags); -- 2.20.1
2019 May 16
0
[nbdkit PATCH v2 08/24] ocaml: Implement .cache script callback
...Int_val (rv)); +} + +static int +cache_wrapper (void *h, uint32_t count, uint64_t offset, uint32_t flags) +{ + CAMLparam0 (); + CAMLlocal4 (rv, countv, offsetv, flagsv); + + caml_leave_blocking_section (); + + countv = caml_copy_int32 (count); + offsetv = caml_copy_int32 (offset); + flagsv = Val_flags (flags); + + value args[] = { *(value *) h, countv, offsetv, flagsv }; + rv = caml_callbackN_exn (cache_fn, sizeof args / sizeof args[0], args); + if (Is_exception_result (rv)) { + nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); + CAMLreturnT (int, -1); + }...
2019 Apr 23
0
[PATCH nbdkit v2 1/2] ocaml: Change pread method to avoid leaking heap memory.
..._t flags) { CAMLparam0 (); - CAMLlocal4 (rv, strv, offsetv, flagsv); + CAMLlocal4 (rv, countv, offsetv, flagsv); + mlsize_t len; caml_leave_blocking_section (); - strv = caml_alloc_string (count); + countv = caml_copy_int32 (count); offsetv = caml_copy_int64 (offset); flagsv = Val_flags (flags); - value args[] = { *(value *) h, strv, offsetv, flagsv }; + value args[] = { *(value *) h, countv, offsetv, flagsv }; rv = caml_callbackN_exn (pread_fn, sizeof args / sizeof args[0], args); if (Is_exception_result (rv)) { nbdkit_error ("%s", caml_format_exception (...
2019 Apr 23
4
[PATCH nbdkit v2 0/2] Be careful not to leak server heap memory to the client.
Version 1 was here: https://www.redhat.com/archives/libguestfs/2019-April/msg00144.html Version 2 makes a couple of much larger changes: The OCaml patch changes the API of the pread method so it matches what other language bindings are already doing, ie. get the language plugin to return a newly allocated buffer, check it is long enough, copy out the data. The server patch implements a
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1: - rework .can_cache to be tri-state, with default of no advertisement (ripple effect through other patches) - add a lot more patches in order to round out filter support And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so in theory we now have a way to test cache commands through the entire stack. Eric Blake (24): server: Internal hooks for implementing