lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <jqgnivkquty3gdhhedbx3vub7wguhuxyorelkpvwhu6r3mfvzm@q7voouptegpt>
Date: Tue, 5 Aug 2025 09:15:44 +0200
From: Stefano Garzarella <sgarzare@...hat.com>
To: bsdhenrymartin@...il.com
Cc: huntazhang@...cent.com, jitxie@...cent.com, landonsun@...cent.com, 
	bryan-bt.tan@...adcom.com, vishnu.dasa@...adcom.com, bcm-kernel-feedback-list@...adcom.com, 
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, 
	horms@...nel.org, linux-kernel@...r.kernel.org, virtualization@...ts.linux.dev, 
	netdev@...r.kernel.org, Henry Martin <bsdhenryma@...cent.com>, 
	TCS Robot <tcs_robot@...cent.com>
Subject: Re: [PATCH v1] VSOCK: fix Out-of-Bounds Read in
 vmci_transport_dgram_dequeue()

On Tue, Aug 05, 2025 at 02:20:41PM +0800, bsdhenrymartin@...il.com wrote:
>From: Henry Martin <bsdhenryma@...cent.com>
>
>vmci_transport_dgram_dequeue lack of buffer length validation before
>accessing `vmci_datagram` header.
>
>Trigger Path:
>1. Attacker sends a datagram with length < sizeof(struct
>   vmci_datagram).

How?

>2. `skb_recv_datagram()` returns the malformed sk_buff (skb->len <
>   sizeof(struct vmci_datagram)).

The sk_buff is queued by vmci_transport_recv_dgram_cb() calling
sk_receive_skb(). And It is allocated with this code:

#define VMCI_DG_HEADERSIZE sizeof(struct vmci_datagram)
#define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payload_size)

static int vmci_transport_recv_dgram_cb(void *data, struct vmci_datagram *dg)
{
	...
	size = VMCI_DG_SIZE(dg);

	/* Attach the packet to the socket's receive queue as an sk_buff. */
	skb = alloc_skb(size, GFP_ATOMIC);
	...
	skb_put(skb, size);
	...
}

So I don't understand what this patch is fixing...

>3. Code casts skb->data to struct vmci_datagram *dg without verifying
>   skb->len.
>4. Accessing `dg->payload_size` (Line: `payload_len =
>   dg->payload_size;`) reads out-of-bounds memory.
>
>Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
>Reported-by: TCS Robot <tcs_robot@...cent.com>

Please fix your robot and also check your patches.
This is the second no-sense patch from you I reviewed today, I'll start
to ignore if you continue.

Stefano

>Signed-off-by: Henry Martin <bsdhenryma@...cent.com>
>---
> net/vmw_vsock/vmci_transport.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
>index 7eccd6708d66..0be605e19b2e 100644
>--- a/net/vmw_vsock/vmci_transport.c
>+++ b/net/vmw_vsock/vmci_transport.c
>@@ -1749,6 +1749,11 @@ static int vmci_transport_dgram_dequeue(struct vsock_sock *vsk,
> 	if (!skb)
> 		return err;
>
>+	if (skb->len < sizeof(struct vmci_datagram)) {
>+		err = -EINVAL;
>+		goto out;
>+	}
>+
> 	dg = (struct vmci_datagram *)skb->data;
> 	if (!dg)
> 		/* err is 0, meaning we read zero bytes. */
>-- 
>2.41.3
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ