search for: sg_num

Displaying 19 results from an estimated 19 matches for "sg_num".

2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...unsigned int in_num, > + struct virtio_pstore_res *res) > +{ > + char path[PATH_MAX]; Don't declare PATH_MAX sized variables > + int fd; > + ssize_t len; > + struct stat stbuf; > + struct dirent *dent; > + int sg_num = in_num; > + struct iovec sg[sg_num]; 'sg_num' is initialized from 'in_num' which comes from the guest, and I'm not seeing anything which is bounds-checking the 'in_num' value. So you've possibly got a security flaw here I think, if the guest can cause QEMU t...
2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...unsigned int in_num, > + struct virtio_pstore_res *res) > +{ > + char path[PATH_MAX]; Don't declare PATH_MAX sized variables > + int fd; > + ssize_t len; > + struct stat stbuf; > + struct dirent *dent; > + int sg_num = in_num; > + struct iovec sg[sg_num]; 'sg_num' is initialized from 'in_num' which comes from the guest, and I'm not seeing anything which is bounds-checking the 'in_num' value. So you've possibly got a security flaw here I think, if the guest can cause QEMU t...
2016 Jul 30
0
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...gt; > +{ > > + char path[PATH_MAX]; > > Don't declare PATH_MAX sized variables Will change to use g_strdup_printf() as you said. > > > + int fd; > > + ssize_t len; > > + struct stat stbuf; > > + struct dirent *dent; > > + int sg_num = in_num; > > + struct iovec sg[sg_num]; > > 'sg_num' is initialized from 'in_num' which comes from the > guest, and I'm not seeing anything which is bounds-checking > the 'in_num' value. So you've possibly got a security flaw here > I think,...
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
This is a subject that came up in the virtio BOF session at OLS. I decided to go forward and implement something that I like, based on the latest virtio proposal at the time, which was draft III. It's not a drop-in replacement, because it's missing a host implementation. I first started my own, which is not done yet, but wanted to do one for lguest and one for emulated PCI next. It's
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
This is a subject that came up in the virtio BOF session at OLS. I decided to go forward and implement something that I like, based on the latest virtio proposal at the time, which was draft III. It's not a drop-in replacement, because it's missing a host implementation. I first started my own, which is not done yet, but wanted to do one for lguest and one for emulated PCI next. It's
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...store_fileinfo *info = &rarg->info; > + VirtIOPstore *vps = rarg->vps; > + VirtQueueElement *elem = rarg->elem; > + struct virtio_pstore_res res; > + size_t offset = sizeof(res) + sizeof(*info); > + struct iovec *sg = elem->in_sg; > + unsigned int sg_num = elem->in_num; > + Error *err = NULL; > + ssize_t len; > + int ret; > + > + /* skip res and fileinfo */ > + iov_discard_front(&sg, &sg_num, sizeof(res) + sizeof(*info)); > + > + len = qio_channel_readv(rarg->ioc, sg, sg_num, &err); > +...
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...store_fileinfo *info = &rarg->info; > + VirtIOPstore *vps = rarg->vps; > + VirtQueueElement *elem = rarg->elem; > + struct virtio_pstore_res res; > + size_t offset = sizeof(res) + sizeof(*info); > + struct iovec *sg = elem->in_sg; > + unsigned int sg_num = elem->in_num; > + Error *err = NULL; > + ssize_t len; > + int ret; > + > + /* skip res and fileinfo */ > + iov_discard_front(&sg, &sg_num, sizeof(res) + sizeof(*info)); > + > + len = qio_channel_readv(rarg->ioc, sg, sg_num, &err); > +...
2016 Aug 20
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...g = data; + struct virtio_pstore_fileinfo *info = &rarg->info; + VirtIOPstore *vps = rarg->vps; + VirtQueueElement *elem = rarg->elem; + struct virtio_pstore_res res; + size_t offset = sizeof(res) + sizeof(*info); + struct iovec *sg = elem->in_sg; + unsigned int sg_num = elem->in_num; + Error *err = NULL; + ssize_t len; + int ret; + + /* skip res and fileinfo */ + iov_discard_front(&sg, &sg_num, sizeof(res) + sizeof(*info)); + + len = qio_channel_readv(rarg->ioc, sg, sg_num, &err); + if (len < 0) { + if (errno == E...
2016 Aug 26
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...rg->info; > > + VirtIOPstore *vps = rarg->vps; > > + VirtQueueElement *elem = rarg->elem; > > + struct virtio_pstore_res res; > > + size_t offset = sizeof(res) + sizeof(*info); > > + struct iovec *sg = elem->in_sg; > > + unsigned int sg_num = elem->in_num; > > + Error *err = NULL; > > + ssize_t len; > > + int ret; > > + > > + /* skip res and fileinfo */ > > + iov_discard_front(&sg, &sg_num, sizeof(res) + sizeof(*info)); > > + > > + len = qio_channel_readv(rar...
2016 Jul 27
0
[PATCH 6/7] qemu: Implement virtio-pstore device
...pstore_do_read(VirtIOPstore *s, struct iovec *in_sg, + unsigned int in_num, + struct virtio_pstore_res *res) +{ + char path[PATH_MAX]; + int fd; + ssize_t len; + struct stat stbuf; + struct dirent *dent; + int sg_num = in_num; + struct iovec sg[sg_num]; + struct virtio_pstore_fileinfo info; + size_t offset = sizeof(*res) + sizeof(info); + + if (s->dirp == NULL) { + return -1; + } + + dent = readdir(s->dirp); + while (dent) { + if (dent->d_name[0] != '.') { +...
2016 Nov 10
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...VirtIOPstore *vps = rarg->vps; > > > + VirtQueueElement *elem = rarg->elem; > > > + struct virtio_pstore_res res; > > > + size_t offset = sizeof(res) + sizeof(*info); > > > + struct iovec *sg = elem->in_sg; > > > + unsigned int sg_num = elem->in_num; > > > + Error *err = NULL; > > > + ssize_t len; > > > + int ret; > > > + > > > + /* skip res and fileinfo */ > > > + iov_discard_front(&sg, &sg_num, sizeof(res) + sizeof(*info)); > > > + > &g...
2016 Jul 27
11
[RFC/PATCHSET 0/7] virtio: Implement virtio pstore device (v2)
Hello, This is v2 of the virtio-pstore work. In this patchset I addressed most of feedbacks from previous version. Limiting disk size is not implemented yet. * changes in v2) - update VIRTIO_ID_PSTORE to 22 (Cornelia, Stefan) - make buffer size configurable (Cornelia) - support PSTORE_TYPE_CONSOLE (Kees) - use separate virtqueues for read and write - support concurrent async
2016 Jul 27
11
[RFC/PATCHSET 0/7] virtio: Implement virtio pstore device (v2)
Hello, This is v2 of the virtio-pstore work. In this patchset I addressed most of feedbacks from previous version. Limiting disk size is not implemented yet. * changes in v2) - update VIRTIO_ID_PSTORE to 22 (Cornelia, Stefan) - make buffer size configurable (Cornelia) - support PSTORE_TYPE_CONSOLE (Kees) - use separate virtqueues for read and write - support concurrent async
2016 Jul 28
3
[PATCH 6/7] qemu: Implement virtio-pstore device
...*in_sg, > + unsigned int in_num, > + struct virtio_pstore_res *res) > +{ > + char path[PATH_MAX]; > + int fd; > + ssize_t len; > + struct stat stbuf; > + struct dirent *dent; > + int sg_num = in_num; > + struct iovec sg[sg_num]; > + struct virtio_pstore_fileinfo info; > + size_t offset = sizeof(*res) + sizeof(info); > + > + if (s->dirp == NULL) { > + return -1; > + } > + > + dent = readdir(s->dirp); > + while (dent) { &gt...
2016 Jul 28
3
[PATCH 6/7] qemu: Implement virtio-pstore device
...*in_sg, > + unsigned int in_num, > + struct virtio_pstore_res *res) > +{ > + char path[PATH_MAX]; > + int fd; > + ssize_t len; > + struct stat stbuf; > + struct dirent *dent; > + int sg_num = in_num; > + struct iovec sg[sg_num]; > + struct virtio_pstore_fileinfo info; > + size_t offset = sizeof(*res) + sizeof(info); > + > + if (s->dirp == NULL) { > + return -1; > + } > + > + dent = readdir(s->dirp); > + while (dent) { &gt...
2016 Aug 20
7
[RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v3)
Hello, This is another iteration of the virtio-pstore work. In this patchset I addressed most of feedbacks from previous version and drooped the support for PSTORE_TYPE_CONSOLE for simplicity. It'll be added once the basic implementation * changes in v3) - use QIOChannel API (Stefan, Daniel) - add bound check for malcious guests (Daniel) - drop support PSTORE_TYPE_CONSOLE for now
2016 Aug 20
7
[RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v3)
Hello, This is another iteration of the virtio-pstore work. In this patchset I addressed most of feedbacks from previous version and drooped the support for PSTORE_TYPE_CONSOLE for simplicity. It'll be added once the basic implementation * changes in v3) - use QIOChannel API (Stefan, Daniel) - add bound check for malcious guests (Daniel) - drop support PSTORE_TYPE_CONSOLE for now
2016 Aug 31
4
[RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v4)
Hello, This is another iteration of the virtio-pstore work. I've addressed all comments from Daniel Berrange on the qemu side. * changes in v4) - use qio_channel_file_new_path() (Daniel) - rename to delete_old_pstore_file (Daniel) - convert G_REMOVE_SOURCE to FALSE (Daniel) * changes in v3) - use QIOChannel API (Stefan, Daniel) - add bound check for malcious guests
2016 Aug 31
4
[RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v4)
Hello, This is another iteration of the virtio-pstore work. I've addressed all comments from Daniel Berrange on the qemu side. * changes in v4) - use qio_channel_file_new_path() (Daniel) - rename to delete_old_pstore_file (Daniel) - convert G_REMOVE_SOURCE to FALSE (Daniel) * changes in v3) - use QIOChannel API (Stefan, Daniel) - add bound check for malcious guests