[PATCH] Implement decoding of IOCTL_VM_SOCKETS_GET_LOCAL_CID

Alyssa Ross hi at alyssa.is
Thu Jul 25 13:24:45 UTC 2024


On Thu, Jul 25, 2024 at 03:06:40PM GMT, Alyssa Ross wrote:
> diff --git a/src/ioctl.c b/src/ioctl.c
> index 8ebaea10a..602f23798 100644
> --- a/src/ioctl.c
> +++ b/src/ioctl.c
> @@ -361,6 +361,8 @@ ioctl_decode(struct tcb *tcp, const struct finfo *finfo)
>  	switch (_IOC_TYPE(code)) {
>  	case 0x03:
>  		return hdio_ioctl(tcp, code, arg);
> +	case 0x07:
> +		return vsock_ioctl(tcp, code, arg);

Just noticed the following comment in linux/vmw_vmci_defs.h:

/*
 * The VMCI IOCTLs.  We use identity code 7, as noted in ioctl-number.h, and
 * we start at sequence 9f.  This gives us the same values that our shipping
 * products use, starting at 1951, provided we leave out the direction and
 * structure size.  Note that VMMon occupies the block following us, starting
 * at 2001.
 */

(Despite what the comment says, this is not in fact noted in
ioctl-number.h as far as I can see.)

So I guess this would be more accurately named vmw_vmci_ioctl.
I'll send a new version tomorrow or something with this renamed, and
maybe a kernel patch to fix ioctl-number.h…

>  	case 0x12:
>  		return block_ioctl(tcp, code, arg);
>  	case '!': /* 0x21 */

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20240725/443d2c34/attachment.bin>


More information about the Strace-devel mailing list