Bug 205583

Summary: vsock(7): description of 'struct sockaddr_vm' is incorrect
Product: Documentation Reporter: Mikhail (golubev.mikhail)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: RESOLVED CODE_FIX    
Severity: normal CC: mtk.manpages
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Mikhail 2019-11-19 16:56:47 UTC
'man 7 vsock' has the following inconsistency with kernel:

The structure 'struct sockaddr_vm' is defined (up to the current master edca87323936e0ffb739ebf83a4d9d8e68800172) as the following:

struct sockaddr_vm {
  sa_family_t    svm_family;     /* Address family: AF_VSOCK */
  unsigned short svm_reserved1;
  unsigned int   svm_port;       /* Port # in host byte order */
  unsigned int   svm_cid;        /* Address in host byte order */
};

In reality it has additional 'unsigned char svm_zero[]' element to for the struct to have the same size as 'struct sockaddr'. This element is not mentioned and it is not mentioned that it must be zeroed. The check is in the kernel: https://elixir.bootlin.com/linux/v5.3.11/source/net/vmw_vsock/vsock_addr.c#L31
Comment 1 Michael Kerrisk 2020-05-04 07:25:18 UTC
Closing, since this issue was resolved by man-pages commits552c1210136b37d69456490d8ebadb9bcb3acf0d and cf4e631c960d3e59c83069830335700f4b112cbd