[dpdk-dev] [PATCH] net/memif: fix invalid unix domain address length

Ferruh Yigit ferruh.yigit at intel.com
Tue Oct 22 18:32:54 CEST 2019


On 10/22/2019 5:08 PM, Jakub Grajciar wrote:
> Define MEMIF_SOCKET_UN_SIZE to size of unix domain socket address.
> Report error in case of longer path.
> 
> Fixes: b923866c6974 ("net/memif: allow for full key size in socket name")
> Cc: stephen at networkplumber.org
> 
> Signed-off-by: Jakub Grajciar <jgrajcia at cisco.com>

<...>

> +  if (strlen(filename) != MEMIF_SOCKET_UN_SIZE) {
> +		MIF_LOG(ERR, "Unix socket address too long (max 108).");
> +		return -1;
> +	}

Are you sure about this check, I didn't test it but intention looks like ">=".

btw, it is possible to print 'MEMIF_SOCKET_UN_SIZE' as max value, instead of
hardcoded '108'.


More information about the dev mailing list