search for: virtio_transport_alloc_pkt

Displaying 20 results from an estimated 98 matches for "virtio_transport_alloc_pkt".

2016 Dec 07
2
[PATCH 08/10] vsock/virtio: mark an internal function static
On 2016?12?06? 23:41, Michael S. Tsirkin wrote: > virtio_transport_alloc_pkt is only used locally, make it static. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > --- > net/vmw_vsock/virtio_transport_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vs...
2016 Dec 07
2
[PATCH 08/10] vsock/virtio: mark an internal function static
On 2016?12?06? 23:41, Michael S. Tsirkin wrote: > virtio_transport_alloc_pkt is only used locally, make it static. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > --- > net/vmw_vsock/virtio_transport_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vs...
2019 Mar 06
2
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...ocated just before line 680 and must be free > explicitly for return -ENOTCONN. > > You can avoid the leak and make the code easier to read like this: > > struct virtio_vsock_pkt *reply; > > ... > > ------ avoid reusing 'pkt' > v > reply = virtio_transport_alloc_pkt(&info, 0, ...); > if (!reply) > return -ENOMEM; > > t = virtio_transport_get_ops(); > if (!t) { > virtio_transport_free_pkt(reply); <-- prevent memory leak > return -ENOTCONN; > } > return t->send_pkt(reply); What do you think about...
2019 Mar 06
2
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...ocated just before line 680 and must be free > explicitly for return -ENOTCONN. > > You can avoid the leak and make the code easier to read like this: > > struct virtio_vsock_pkt *reply; > > ... > > ------ avoid reusing 'pkt' > v > reply = virtio_transport_alloc_pkt(&info, 0, ...); > if (!reply) > return -ENOMEM; > > t = virtio_transport_get_ops(); > if (!t) { > virtio_transport_free_pkt(reply); <-- prevent memory leak > return -ENOTCONN; > } > return t->send_pkt(reply); What do you think about...
2019 May 14
3
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...t; diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c >>> index 602715fc9a75..0248d6808755 100644 >>> --- a/net/vmw_vsock/virtio_transport_common.c >>> +++ b/net/vmw_vsock/virtio_transport_common.c >>> @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, >>> pkt->buf = kmalloc(len, GFP_KERNEL); >>> if (!pkt->buf) >>> goto out_pkt; >>> + >>> + pkt->buf_len = len; >>> + >>> err = memcpy_from_msg(pkt->buf, info->msg,...
2019 May 14
3
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...t; diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c >>> index 602715fc9a75..0248d6808755 100644 >>> --- a/net/vmw_vsock/virtio_transport_common.c >>> +++ b/net/vmw_vsock/virtio_transport_common.c >>> @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, >>> pkt->buf = kmalloc(len, GFP_KERNEL); >>> if (!pkt->buf) >>> goto out_pkt; >>> + >>> + pkt->buf_len = len; >>> + >>> err = memcpy_from_msg(pkt->buf, info->msg,...
2019 May 13
2
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...gt;hdr, sizeof(pkt->hdr)); > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c > index 602715fc9a75..0248d6808755 100644 > --- a/net/vmw_vsock/virtio_transport_common.c > +++ b/net/vmw_vsock/virtio_transport_common.c > @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, > pkt->buf = kmalloc(len, GFP_KERNEL); > if (!pkt->buf) > goto out_pkt; > + > + pkt->buf_len = len; > + > err = memcpy_from_msg(pkt->buf, info->msg, len); > if (err) > goto out; > @@ -86,6 +8...
2019 May 13
2
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...gt;hdr, sizeof(pkt->hdr)); > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c > index 602715fc9a75..0248d6808755 100644 > --- a/net/vmw_vsock/virtio_transport_common.c > +++ b/net/vmw_vsock/virtio_transport_common.c > @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, > pkt->buf = kmalloc(len, GFP_KERNEL); > if (!pkt->buf) > goto out_pkt; > + > + pkt->buf_len = len; > + > err = memcpy_from_msg(pkt->buf, info->msg, len); > if (err) > goto out; > @@ -86,6 +8...
2016 Dec 06
0
[PATCH 08/10] vsock/virtio: mark an internal function static
virtio_transport_alloc_pkt is only used locally, make it static. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- net/vmw_vsock/virtio_transport_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index...
2016 Dec 08
0
[PATCH 08/10] vsock/virtio: mark an internal function static
On Wed, Dec 07, 2016 at 12:21:22PM +0800, Jason Wang wrote: > > > On 2016?12?06? 23:41, Michael S. Tsirkin wrote: > > virtio_transport_alloc_pkt is only used locally, make it static. > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > --- > > net/vmw_vsock/virtio_transport_common.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/net/vmw_vsock/v...
2019 Mar 06
2
[PATCH v2] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...k_pkt *reply; struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_RST, .type = le16_to_cpu(pkt->hdr.type), @@ -672,15 +674,21 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) if (le16_to_cpu(pkt->hdr.op) == VIRTIO_VSOCK_OP_RST) return 0; - pkt = virtio_transport_alloc_pkt(&info, 0, - le64_to_cpu(pkt->hdr.dst_cid), - le32_to_cpu(pkt->hdr.dst_port), - le64_to_cpu(pkt->hdr.src_cid), - le32_to_cpu(pkt->hdr.src_port)); - if (!pkt) + reply = virtio_transport_alloc_pkt(&info, 0, + le64_to_cpu(pkt->hdr.dst_cid), + le3...
2019 Mar 06
2
[PATCH v2] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...k_pkt *reply; struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_RST, .type = le16_to_cpu(pkt->hdr.type), @@ -672,15 +674,21 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) if (le16_to_cpu(pkt->hdr.op) == VIRTIO_VSOCK_OP_RST) return 0; - pkt = virtio_transport_alloc_pkt(&info, 0, - le64_to_cpu(pkt->hdr.dst_cid), - le32_to_cpu(pkt->hdr.dst_port), - le64_to_cpu(pkt->hdr.src_cid), - le32_to_cpu(pkt->hdr.src_port)); - if (!pkt) + reply = virtio_transport_alloc_pkt(&info, 0, + le64_to_cpu(pkt->hdr.dst_cid), + le3...
2019 May 12
1
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...gt;hdr, sizeof(pkt->hdr)); > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c > index 602715fc9a75..0248d6808755 100644 > --- a/net/vmw_vsock/virtio_transport_common.c > +++ b/net/vmw_vsock/virtio_transport_common.c > @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, > pkt->buf = kmalloc(len, GFP_KERNEL); > if (!pkt->buf) > goto out_pkt; > + > + pkt->buf_len = len; > + > err = memcpy_from_msg(pkt->buf, info->msg, len); > if (err) > goto out; > @@ -86,6 +89,46 @...
2016 Dec 07
1
[PATCH 09/10] vsock/virtio: fix src/dst cid format
...irtio_transport_common.c > index 6120384..22e99c4 100644 > --- a/net/vmw_vsock/virtio_transport_common.c > +++ b/net/vmw_vsock/virtio_transport_common.c > @@ -606,9 +606,9 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) > return 0; > > pkt = virtio_transport_alloc_pkt(&info, 0, > - le32_to_cpu(pkt->hdr.dst_cid), > + le64_to_cpu(pkt->hdr.dst_cid), > le32_to_cpu(pkt->hdr.dst_port), > - le32_to_cpu(pkt->hdr.src_cid), > + le64_to_cpu(pkt->hdr.src_cid), > le32_to_cpu(pkt->hdr.src_port)); Loo...
2016 Dec 07
1
[PATCH 09/10] vsock/virtio: fix src/dst cid format
...irtio_transport_common.c > index 6120384..22e99c4 100644 > --- a/net/vmw_vsock/virtio_transport_common.c > +++ b/net/vmw_vsock/virtio_transport_common.c > @@ -606,9 +606,9 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) > return 0; > > pkt = virtio_transport_alloc_pkt(&info, 0, > - le32_to_cpu(pkt->hdr.dst_cid), > + le64_to_cpu(pkt->hdr.dst_cid), > le32_to_cpu(pkt->hdr.dst_port), > - le32_to_cpu(pkt->hdr.src_cid), > + le64_to_cpu(pkt->hdr.src_cid), > le32_to_cpu(pkt->hdr.src_port)); Loo...
2019 Mar 05
4
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
Previous to commit 22b5c0b63f32 ("vsock/virtio: fix kernel panic after device hot-unplug"), vsock_core_init() was called from virtio_vsock_probe(). Now, virtio_transport_reset_no_sock() can be called before vsock_core_init() has the chance to run. [Wed Feb 27 14:17:09 2019] BUG: unable to handle kernel NULL pointer dereference at 0000000000000110 [Wed Feb 27 14:17:09 2019] #PF error:
2019 Mar 05
4
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
Previous to commit 22b5c0b63f32 ("vsock/virtio: fix kernel panic after device hot-unplug"), vsock_core_init() was called from virtio_vsock_probe(). Now, virtio_transport_reset_no_sock() can be called before vsock_core_init() has the chance to run. [Wed Feb 27 14:17:09 2019] BUG: unable to handle kernel NULL pointer dereference at 0000000000000110 [Wed Feb 27 14:17:09 2019] #PF error:
2019 May 13
0
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...r)); > > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c > > index 602715fc9a75..0248d6808755 100644 > > --- a/net/vmw_vsock/virtio_transport_common.c > > +++ b/net/vmw_vsock/virtio_transport_common.c > > @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, > > pkt->buf = kmalloc(len, GFP_KERNEL); > > if (!pkt->buf) > > goto out_pkt; > > + > > + pkt->buf_len = len; > > + > > err = memcpy_from_msg(pkt->buf, info->msg, len); > > if (e...
2019 May 14
0
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...k/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c > > > > index 602715fc9a75..0248d6808755 100644 > > > > --- a/net/vmw_vsock/virtio_transport_common.c > > > > +++ b/net/vmw_vsock/virtio_transport_common.c > > > > @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, > > > > pkt->buf = kmalloc(len, GFP_KERNEL); > > > > if (!pkt->buf) > > > > goto out_pkt; > > > > + > > > > + pkt->buf_len = len; > > > > + > > > >...
2019 May 10
0
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
..._one(&hdr, &pkt->hdr, sizeof(pkt->hdr)); diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 602715fc9a75..0248d6808755 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -65,6 +65,9 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, pkt->buf = kmalloc(len, GFP_KERNEL); if (!pkt->buf) goto out_pkt; + + pkt->buf_len = len; + err = memcpy_from_msg(pkt->buf, info->msg, len); if (err) goto out; @@ -86,6 +89,46 @@ virtio_transport_alloc_pkt(struct virtio_vsock_p...