search for: in_buf

Displaying 20 results from an estimated 56 matches for "in_buf".

2011 Nov 11
0
[PATCH 9/9] Decompressors: check input size in unlzo.c
...4) + return 0; parse += l + 4; *skip = parse - input; @@ -107,7 +129,8 @@ STATIC int INIT unlzo(u8 *input, unsigne u8 *output, unsigned int *posp, void (*error) (const char *x)) { - u8 skip = 0, r = 0; + u8 r = 0; + int skip = 0; u32 src_len, dst_len; size_t tmp; u8 *in_buf, *in_buf_save, *out_buf; @@ -149,19 +172,25 @@ STATIC int INIT unlzo(u8 *input, unsigne if (fill) fill(in_buf, lzo1x_worst_compress(LZO_BLOCK_SIZE)); - if (!parse_header(input, &skip)) { + if (!parse_header(input, &skip, in_len)) { error("invalid header"); goto exit_2...
2012 Nov 13
1
Integer overflow in opus_packet_parse_impl
...o the decoder, the padding variable overflows which leads to out-of-bounds read. It would be good to add a check for the overflow even if most cases won't allow that much data to be fed to the decoder. Here is a reproducer: #include <string.h> #include "opus.h" unsigned char in_buf[16909318]; unsigned short out_buf[11520]; int main() { OpusDecoder *decoder; int result; int error; in_buf[0] = 0xff; in_buf[1] = 0x41; memset(in_buf + 2, 0xff, 16909315); in_buf[16909317] = 0x0b; decoder = opus_decoder_create(48000, 2, &error); result = opus_decode(decoder...
2006 Aug 21
1
[PATCH 3 of 6] dm-userspace internal libdmu support for userspace tool
...( s, arg... ) +#endif + +struct dmu_events { + status_handler status_fn; + map_req_handler map_fn; +}; + +struct dmu_event_data { + void *status_user_data; + void *map_user_data; +}; + +struct dmu_context { + int fd; + unsigned int buf_size; + unsigned int in_ptr; + unsigned int out_ptr; + uint8_t *in_buf; + uint8_t *out_buf; + uint32_t id_ctr; + struct dmu_events events; + struct dmu_event_data event_data; +}; + +struct dmu_map_data { + uint64_t block; + int64_t offset; + uint32_t id; + uint32_t flags; + dev_t dest_dev; + dev_t copy_src_dev; +}; + +void dmu_map_set_block(struct dmu_map_data *data,...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...fers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + if (is_console_port(port)) + kfree(buf); + else + free_buf(buf); port->outvq_full = false; } } @@ -498,6 +598,7 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, ssize_t ret; unsigned long flags; unsigned int len; + struct port_buffer *buf = in_buf; out_vq = port->out_vq; @@ -505,8 +606,11 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, reclaim_consumed_buffers(port); - sg_init_one(sg, in_b...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...fers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + if (is_console_port(port)) + kfree(buf); + else + free_buf(buf); port->outvq_full = false; } } @@ -498,6 +598,7 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, ssize_t ret; unsigned long flags; unsigned int len; + struct port_buffer *buf = in_buf; out_vq = port->out_vq; @@ -505,8 +606,11 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, reclaim_consumed_buffers(port); - sg_init_one(sg, in_b...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...from the guest to the host */ - struct port_buffer *outbuf; - /* The IO vqs for this port */ struct virtqueue *in_vq, *out_vq; @@ -399,43 +396,23 @@ static ssize_t send_control_msg(struct port *port, unsigned int event, return 0; } -static ssize_t send_buf(struct port *port, const char *in_buf, size_t in_count, - bool from_user) +static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count) { struct scatterlist sg[1]; struct virtqueue *out_vq; - struct port_buffer *buf; ssize_t ret; - unsigned int tmplen; + unsigned int len; out_vq = port->out_vq; - buf = port...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...from the guest to the host */ - struct port_buffer *outbuf; - /* The IO vqs for this port */ struct virtqueue *in_vq, *out_vq; @@ -399,43 +396,23 @@ static ssize_t send_control_msg(struct port *port, unsigned int event, return 0; } -static ssize_t send_buf(struct port *port, const char *in_buf, size_t in_count, - bool from_user) +static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count) { struct scatterlist sg[1]; struct virtqueue *out_vq; - struct port_buffer *buf; ssize_t ret; - unsigned int tmplen; + unsigned int len; out_vq = port->out_vq; - buf = port...
2007 Nov 16
8
[PATCH 0/6] Add online resize for ocfs2-tools,take 1
Add online resize in tunefs.ocfs2 so that user can increase the volume when it is mounted.
2009 Oct 05
3
Questions about app_jack.c
Hello, My configuration is : Card 0 - kernel dummy sound card Card 1 - my soundcard I have a jackd running in background. My jackd launch command is : jackd --port-max 16 --realtime --no-mlock -d alsa --playback hw:1,0 --capture hw:1,0 --rate 8000 --period 1024 --shorts --inchannels 2 --outchannels 2 --dither triangular & 1 ) I open asterisk with chan_alsa.so connected (with asoundrc) to
2017 Jul 01
0
[PATCH] Add new hash.c32 module
...*unrockridge_iso(const char *name) +{ + const struct syslinux_version *sv; + sv = syslinux_version(); + if (sv->filesystem != SYSLINUX_FS_ISOLINUX) { + return unrockridge(name); + } else { + return name; + } +} + +static uint8_t *md5_file(const char *filename) +{ + int src_fd, count; + uint8_t in_buf[4096]; + static uint8_t hash_value[16*2+1]; + static unsigned char hash[16]; + MD5_CTX context; + + src_fd = open(filename, O_RDONLY); + if (src_fd < 0) { + src_fd = open(unrockridge_iso(filename), O_RDONLY); + } + if (src_fd < 0) { + return NULL; + } + + MD5Init(&context); + while ((co...
2007 Aug 24
2
[git patch] klibc bzero, mount fixes + random stuff
...) must always be a multiple of 4 helps us (and our callers) insure this. */ -void disk_empty_output_buffer(int out_des) +static void disk_empty_output_buffer(int out_des) { int bytes_written; @@ -206,7 +193,7 @@ void disk_empty_output_buffer(int out_des) /* Copy NUM_BYTES of buffer IN_BUF to `out_buff', which may be partly full. When `out_buff' fills up, flush it to file descriptor OUT_DES. */ -void disk_buffered_write(char *in_buf, int out_des, long num_bytes) +static void disk_buffered_write(char *in_buf, int out_des, long num_bytes) { register long bytes_left =...
2012 Aug 09
8
[PATCH V2 0/6] virtio-trace: Support virtio-trace
Hi All, The following patch set provides a low-overhead system for collecting kernel tracing data of guests by a host in a virtualization environment. A guest OS generally shares some devices with other guests or a host, so reasons of any problems occurring in a guest may be from other guests or a host. Then, to collect some tracing data of a number of guests and a host is needed when some
2012 Aug 09
8
[PATCH V2 0/6] virtio-trace: Support virtio-trace
Hi All, The following patch set provides a low-overhead system for collecting kernel tracing data of guests by a host in a virtualization environment. A guest OS generally shares some devices with other guests or a host, so reasons of any problems occurring in a guest may be from other guests or a host. Then, to collect some tracing data of a number of guests and a host is needed when some
2011 Nov 03
1
[PATCH 2 of 5] virtio: rename virtqueue_add_buf_gfp to virtqueue_add_buf
...1, 0, &cpkt) >= 0) { + if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) >= 0) { virtqueue_kick(vq); while (!virtqueue_get_buf(vq, &len)) cpu_relax(); @@ -505,7 +505,7 @@ static ssize_t send_buf(struct port *por reclaim_consumed_buffers(port); sg_init_one(sg, in_buf, in_count); - ret = virtqueue_add_buf(out_vq, sg, 1, 0, in_buf); + ret = virtqueue_add_buf(out_vq, sg, 1, 0, in_buf, GFP_ATOMIC); /* Tell Host to go! */ virtqueue_kick(out_vq); diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c +++ b/drivers/net/vi...
2011 Nov 03
1
[PATCH 2 of 5] virtio: rename virtqueue_add_buf_gfp to virtqueue_add_buf
...1, 0, &cpkt) >= 0) { + if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) >= 0) { virtqueue_kick(vq); while (!virtqueue_get_buf(vq, &len)) cpu_relax(); @@ -505,7 +505,7 @@ static ssize_t send_buf(struct port *por reclaim_consumed_buffers(port); sg_init_one(sg, in_buf, in_count); - ret = virtqueue_add_buf(out_vq, sg, 1, 0, in_buf); + ret = virtqueue_add_buf(out_vq, sg, 1, 0, in_buf, GFP_ATOMIC); /* Tell Host to go! */ virtqueue_kick(out_vq); diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c +++ b/drivers/net/vi...
2010 Oct 19
1
[PATCH] virtio: console: Don't block entire guest if host doesn't read data
...1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index c810481..0f69c5e 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -459,9 +459,12 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, /* * Wait till the host acknowledges it pushed out the data we - * sent. This is done for ports in blocking mode or for data - * from the hvc_console; the tty operations are performed with - * spinlocks held so we can't sleep here. + * sent. This is done for data...
2010 Oct 19
1
[PATCH] virtio: console: Don't block entire guest if host doesn't read data
...1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index c810481..0f69c5e 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -459,9 +459,12 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, /* * Wait till the host acknowledges it pushed out the data we - * sent. This is done for ports in blocking mode or for data - * from the hvc_console; the tty operations are performed with - * spinlocks held so we can't sleep here. + * sent. This is done for data...
2010 Apr 12
10
[PATCH 0/6] virtio: virtqueue ops cleanup
virtqueue ops were introduced in the hope that we'll have multiple implementations besides virtio_ring, but none have surfaced so far, and given that existing virtio ring is deployed in production we are likely stuck with it now, so this layer just adds complexity and overhead. Further, the need to pass vq twice to each call (as in dev->vq->vq_ops->kick(dev->vq) ) adds potential
2010 Apr 12
10
[PATCH 0/6] virtio: virtqueue ops cleanup
virtqueue ops were introduced in the hope that we'll have multiple implementations besides virtio_ring, but none have surfaced so far, and given that existing virtio ring is deployed in production we are likely stuck with it now, so this layer just adds complexity and overhead. Further, the need to pass vq twice to each call (as in dev->vq->vq_ops->kick(dev->vq) ) adds potential
2012 Jul 24
13
[RFC PATCH 0/6] virtio-trace: Support virtio-trace
Hi All, The following patch set provides a low-overhead system for collecting kernel tracing data of guests by a host in a virtualization environment. A guest OS generally shares some devices with other guests or a host, so reasons of any problems occurring in a guest may be from other guests or a host. Then, to collect some tracing data of a number of guests and a host is needed when some