search for: vmci_dg_siz

Displaying 20 results from an estimated 32 matches for "vmci_dg_siz".

Did you mean: vmci_dg_size
2015 Feb 15
1
vmci: read overrun bug in dg_dispatch_as_host() (drivers/misc/vmw_vmci/vmci_datagram.c)
...() #1 dg_dispatch_as_host () at drivers/misc/vmw_vmci/vmci_datagram.c:245 #2 vmci_datagram_dispatch () at drivers/misc/vmw_vmci/vmci_datagram.c:347 #3 vmci_host_do_send_datagram () at drivers/misc/vmw_vmci/vmci_host.c:404 Here?s the relevant code snippet from dg_dispatch_as_host(): 171: dg_size = VMCI_DG_SIZE(dg); ... 235: dg_info = kmalloc(sizeof(*dg_info) + 236: (size_t) dg->payload_size, GFP_ATOMIC); 237: if (!dg_info) { 238: atomic_dec(&delayed_dg_host_queue_size); 239: vmci_resource_put(resource); 240: return VMCI_ERROR_NO_MEM; 241: } ... 245: mem...
2015 Feb 15
1
vmci: read overrun bug in dg_dispatch_as_host() (drivers/misc/vmw_vmci/vmci_datagram.c)
...() #1 dg_dispatch_as_host () at drivers/misc/vmw_vmci/vmci_datagram.c:245 #2 vmci_datagram_dispatch () at drivers/misc/vmw_vmci/vmci_datagram.c:347 #3 vmci_host_do_send_datagram () at drivers/misc/vmw_vmci/vmci_host.c:404 Here?s the relevant code snippet from dg_dispatch_as_host(): 171: dg_size = VMCI_DG_SIZE(dg); ... 235: dg_info = kmalloc(sizeof(*dg_info) + 236: (size_t) dg->payload_size, GFP_ATOMIC); 237: if (!dg_info) { 238: atomic_dec(&delayed_dg_host_queue_size); 239: vmci_resource_put(resource); 240: return VMCI_ERROR_NO_MEM; 241: } ... 245: mem...
2012 Aug 30
0
[PATCH 02/11] vmci_datagram.patch: VMCI datagram entity handling.
...nt on success, error code otherwise. + */ +static int dg_dispatch_as_host(u32 contextID, + struct vmci_datagram *dg) +{ + int retval; + size_t dgSize; + u32 srcPrivFlags; + + ASSERT(dg); + ASSERT(vmci_host_code_active()); + + dgSize = VMCI_DG_SIZE(dg); + + if (contextID == VMCI_HOST_CONTEXT_ID && + dg->dst.context == VMCI_HYPERVISOR_CONTEXT_ID) + return VMCI_ERROR_DST_UNREACHABLE; + + ASSERT(dg->dst.context != VMCI_HYPERVISOR_CONTEXT_ID); + + /* Check that source handle matches sending...
2012 Aug 30
0
[PATCH 02/11] vmci_datagram.patch: VMCI datagram entity handling.
...nt on success, error code otherwise. + */ +static int dg_dispatch_as_host(u32 contextID, + struct vmci_datagram *dg) +{ + int retval; + size_t dgSize; + u32 srcPrivFlags; + + ASSERT(dg); + ASSERT(vmci_host_code_active()); + + dgSize = VMCI_DG_SIZE(dg); + + if (contextID == VMCI_HOST_CONTEXT_ID && + dg->dst.context == VMCI_HYPERVISOR_CONTEXT_ID) + return VMCI_ERROR_DST_UNREACHABLE; + + ASSERT(dg->dst.context != VMCI_HYPERVISOR_CONTEXT_ID); + + /* Check that source handle matches sending...
2015 Feb 19
0
[PATCH] VMCI: Check userland-provided datagram size
.../misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c index 66fc992..a721b5d 100644 --- a/drivers/misc/vmw_vmci/vmci_host.c +++ b/drivers/misc/vmw_vmci/vmci_host.c @@ -395,6 +395,12 @@ static int vmci_host_do_send_datagram(struct vmci_host_dev *vmci_host_dev, return -EFAULT; } + if (VMCI_DG_SIZE(dg) != send_info.len) { + vmci_ioctl_err("datagram size mismatch\n"); + kfree(dg); + return -EINVAL; + } + pr_devel("Datagram dst (handle=0x%x:0x%x) src (handle=0x%x:0x%x), payload (size=%llu bytes)\n", dg->dst.context, dg->dst.resource, dg->src.context, d...
2015 Feb 19
0
[PATCH] VMCI: Check userland-provided datagram size
.../misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c index 66fc992..a721b5d 100644 --- a/drivers/misc/vmw_vmci/vmci_host.c +++ b/drivers/misc/vmw_vmci/vmci_host.c @@ -395,6 +395,12 @@ static int vmci_host_do_send_datagram(struct vmci_host_dev *vmci_host_dev, return -EFAULT; } + if (VMCI_DG_SIZE(dg) != send_info.len) { + vmci_ioctl_err("datagram size mismatch\n"); + kfree(dg); + return -EINVAL; + } + pr_devel("Datagram dst (handle=0x%x:0x%x) src (handle=0x%x:0x%x), payload (size=%llu bytes)\n", dg->dst.context, dg->dst.resource, dg->src.context, d...
2012 Aug 30
2
[PATCH 01/11] vmci_context.patch: VMCI context list operations.
...appropriate target VM context. + */ +int vmci_ctx_enqueue_datagram(uint32_t cid, struct vmci_datagram *dg) +{ + struct vmci_datagram_queue_entry *dqEntry; + struct vmci_ctx *context; + struct vmci_handle dgSrc; + size_t vmciDgSize; + + ASSERT(dg); + vmciDgSize = VMCI_DG_SIZE(dg); + ASSERT(vmciDgSize <= VMCI_MAX_DG_SIZE); + + /* Get the target VM's VMCI context. */ + context = vmci_ctx_get(cid); + if (context == NULL) { + pr_devel("Invalid context (ID=0x%x).", cid); + return VMCI_ERROR_INVALID_ARGS; +...
2012 Aug 30
2
[PATCH 01/11] vmci_context.patch: VMCI context list operations.
...appropriate target VM context. + */ +int vmci_ctx_enqueue_datagram(uint32_t cid, struct vmci_datagram *dg) +{ + struct vmci_datagram_queue_entry *dqEntry; + struct vmci_ctx *context; + struct vmci_handle dgSrc; + size_t vmciDgSize; + + ASSERT(dg); + vmciDgSize = VMCI_DG_SIZE(dg); + ASSERT(vmciDgSize <= VMCI_MAX_DG_SIZE); + + /* Get the target VM's VMCI context. */ + context = vmci_ctx_get(cid); + if (context == NULL) { + pr_devel("Invalid context (ID=0x%x).", cid); + return VMCI_ERROR_INVALID_ARGS; +...
2013 Jan 08
13
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware to address Greg's and all other's code review comments. Summary of changes: - Rebase our linux kernel tree from v3.5 to v3.7. - Fix all checkpatch warnings and errors. Fix some checkpatch with -strict errors. This addresses Greg's comment: On 15 Nov 2012
2013 Jan 08
13
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware to address Greg's and all other's code review comments. Summary of changes: - Rebase our linux kernel tree from v3.5 to v3.7. - Fix all checkpatch warnings and errors. Fix some checkpatch with -strict errors. This addresses Greg's comment: On 15 Nov 2012
2012 Oct 16
11
[PATCH 00/10] VMCI for Linux upstreaming
* * * In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the Virtual Machine Communication Interface (vmw_vmci) and VMCI Sockets (vmw_vsock) kernel modules for inclusion in the Linux kernel. The purpose of this post is to acquire feedback on the vmw_vmci kernel module. The vmw_vsock kernel module will be presented in a later
2012 Oct 16
11
[PATCH 00/10] VMCI for Linux upstreaming
* * * In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the Virtual Machine Communication Interface (vmw_vmci) and VMCI Sockets (vmw_vsock) kernel modules for inclusion in the Linux kernel. The purpose of this post is to acquire feedback on the vmw_vmci kernel module. The vmw_vsock kernel module will be presented in a later
2012 Aug 30
0
[PATCH 11/11] vmci_headers.patch: VMCI kernel driver public API.
...allowed to be larger. + */ +#define VMCI_MAX_DG_SIZE (17 * 4096) +#define VMCI_MAX_DG_PAYLOAD_SIZE (VMCI_MAX_DG_SIZE - sizeof(struct vmci_datagram)) +#define VMCI_DG_PAYLOAD(_dg) (void *)((char *)(_dg) + sizeof(struct vmci_datagram)) +#define VMCI_DG_HEADERSIZE sizeof(struct vmci_datagram) +#define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payloadSize) +#define VMCI_DG_SIZE_ALIGNED(_dg) ((VMCI_DG_SIZE(_dg) + 7) & (~((size_t) 0x7))) +#define VMCI_MAX_DATAGRAM_QUEUE_SIZE (VMCI_MAX_DG_SIZE * 2) + +/* Flags for VMCI QueuePair API. */ +enum { + /* Fail alloc if QP not created by peer...
2012 Aug 30
0
[PATCH 11/11] vmci_headers.patch: VMCI kernel driver public API.
...allowed to be larger. + */ +#define VMCI_MAX_DG_SIZE (17 * 4096) +#define VMCI_MAX_DG_PAYLOAD_SIZE (VMCI_MAX_DG_SIZE - sizeof(struct vmci_datagram)) +#define VMCI_DG_PAYLOAD(_dg) (void *)((char *)(_dg) + sizeof(struct vmci_datagram)) +#define VMCI_DG_HEADERSIZE sizeof(struct vmci_datagram) +#define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payloadSize) +#define VMCI_DG_SIZE_ALIGNED(_dg) ((VMCI_DG_SIZE(_dg) + 7) & (~((size_t) 0x7))) +#define VMCI_MAX_DATAGRAM_QUEUE_SIZE (VMCI_MAX_DG_SIZE * 2) + +/* Flags for VMCI QueuePair API. */ +enum { + /* Fail alloc if QP not created by peer...
2012 Oct 30
29
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware. -split guest, host and core driver code into different files -use EXPORT_SYMBOLS_GPL -remove vmci_device_get and vmci_device_release APIs -simplify the event deliver mechanism -driver ioctl code cleanup -sparse clean * * * In an effort to improve the out-of-the-box experience with
2012 Oct 30
29
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware. -split guest, host and core driver code into different files -use EXPORT_SYMBOLS_GPL -remove vmci_device_get and vmci_device_release APIs -simplify the event deliver mechanism -driver ioctl code cleanup -sparse clean * * * In an effort to improve the out-of-the-box experience with
2012 Aug 30
1
[PATCH 04/11] vmci_driver.patch: VMCI device driver.
...dgInBuffer + currentDgInBufferSize); + remainingBytes = + (size_t) (dgInBuffer + currentDgInBufferSize - + (uint8_t *)dg); + continue; + } + + dgInSize = VMCI_DG_SIZE_ALIGNED(dg); + + if (dgInSize <= dgInBufferSize) { + int result; + + /* + * If the remaining bytes in the datagram + * buffer doesn't contain the complete + * datag...
2012 Aug 30
1
[PATCH 04/11] vmci_driver.patch: VMCI device driver.
...dgInBuffer + currentDgInBufferSize); + remainingBytes = + (size_t) (dgInBuffer + currentDgInBufferSize - + (uint8_t *)dg); + continue; + } + + dgInSize = VMCI_DG_SIZE_ALIGNED(dg); + + if (dgInSize <= dgInBufferSize) { + int result; + + /* + * If the remaining bytes in the datagram + * buffer doesn't contain the complete + * datag...
2012 Jun 12
11
[vmw_vmci RFCv2 00/11] VMCI for Linux
Second revision of the VMware VMCI RFC patchset. It incorperates fixes for all the feedback about the comment blocks and style and now passes checkpatch with 0 errors and 0 warnings. Thanks to all who have reviewed the code thus far. * * * In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the Virtual Machine Communication
2012 Jun 12
11
[vmw_vmci RFCv2 00/11] VMCI for Linux
Second revision of the VMware VMCI RFC patchset. It incorperates fixes for all the feedback about the comment blocks and style and now passes checkpatch with 0 errors and 0 warnings. Thanks to all who have reviewed the code thus far. * * * In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the Virtual Machine Communication