lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241007172029.5d48ea32@kernel.org>
Date: Mon, 7 Oct 2024 17:20:29 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Ignat Korchagin <ignat@...udflare.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org, Marcel Holtmann
 <marcel@...tmann.org>, Johan Hedberg <johan.hedberg@...il.com>, Luiz
 Augusto von Dentz <luiz.dentz@...il.com>, Oliver Hartkopp
 <socketcan@...tkopp.net>, Marc Kleine-Budde <mkl@...gutronix.de>, Alexander
 Aring <alex.aring@...il.com>, Stefan Schmidt <stefan@...enfreihafen.org>,
 Miquel Raynal <miquel.raynal@...tlin.com>, David Ahern
 <dsahern@...nel.org>, Willem de Bruijn <willemdebruijn.kernel@...il.com>,
 linux-bluetooth@...r.kernel.org, linux-can@...r.kernel.org,
 linux-wpan@...r.kernel.org, kernel-team@...udflare.com, kuniyu@...zon.com,
 alibuda@...ux.alibaba.com, stable@...r.kernel.org
Subject: Re: [PATCH v2 1/8] net: explicitly clear the sk pointer, when
 pf->create fails

On Mon,  7 Oct 2024 22:34:55 +0100 Ignat Korchagin wrote:
> diff --git a/net/socket.c b/net/socket.c
> index 601ad74930ef..042451f01c65 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -1574,8 +1574,13 @@ int __sock_create(struct net *net, int family, int type, int protocol,
>  	rcu_read_unlock();
>  
>  	err = pf->create(net, sock, protocol, kern);
> -	if (err < 0)
> +	if (err < 0) {
> +		/* ->create should release the allocated sock->sk object on error
> +		 * but it may leave the dangling pointer
> +		 */
> +		sock->sk = NULL;
>  		goto out_module_put;
> +	}

This chunk is already in net, as part of the fix you posted earlier.
Please resend the cleanup portion with the other patches for net-next
on Friday (IOW after net -> net-next merge).
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ