Re: [PATCH net-next v2 1/4] vm_sockets: Include flags field in the vsock address data structure

From: Jakub Kicinski
Date: Mon Dec 07 2020 - 16:30:07 EST


On Fri, 4 Dec 2020 19:02:32 +0200 Andra Paraschiv wrote:
> diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h
> index fd0ed7221645d..46735376a57a8 100644
> --- a/include/uapi/linux/vm_sockets.h
> +++ b/include/uapi/linux/vm_sockets.h
> @@ -145,7 +145,7 @@
>
> struct sockaddr_vm {
> __kernel_sa_family_t svm_family;
> - unsigned short svm_reserved1;
> + unsigned short svm_flags;
> unsigned int svm_port;
> unsigned int svm_cid;
> unsigned char svm_zero[sizeof(struct sockaddr) -

Since this is a uAPI header I gotta ask - are you 100% sure that it's
okay to rename this field?

I didn't grasp from just reading the patches whether this is a uAPI or
just internal kernel flag, seems like the former from the reading of
the comment in patch 2. In which case what guarantees that existing
users don't pass in garbage since the kernel doesn't check it was 0?