Re: [PATCH v2 08/11] nl80211: use and/or set socker owner where necessary

Jouni Malinen <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
On Sat, Apr 11, 2020 at 12:25:24PM +0200, Markus Theil wrote:
> Use methods which set or use the connection owner nl_sock*
> where necessary. Initial operations need to register with the
> SOCKET_OWNER attribute set (e.g. connect for STAs). Final operations
> need to use the socket which holds the owner attribute (e.g. disconnect
> for STAs).

> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -6038,12 +6041,9 @@ skip_auth_type:
>  	if (ret)
>  		goto fail;
>  
> -	if (nl_connect_or_ctrl)
> -		ret = send_and_recv(drv->global, nl_connect_or_ctrl, msg,
> -				    NULL, (void *) -1);
> -	else
> -		ret = send_and_recv_msgs(drv, msg, NULL, (void *) -1);
> -
> +	ret = send_and_recv_msgs_as_owner(drv, msg,
> +				  nl_connect_or_ctrl, 1,
> +				  NULL, NULL);

Why is this replacing (void *) -1 with NULL? That would result in not
clearing key material from memory with nl80211_nlmsg_clear() and the end
of send_and_recv().. I removed this undesired change to maintain the
current functionality.

-- 
Jouni Malinen                                            PGP id EFC895FA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.