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: <568f7245-05c9-4061-b2f4-5d9d38b5c212@kernel.org>
Date: Thu, 3 Apr 2025 12:46:43 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...zon.com>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Willem de Bruijn <willemb@...gle.com>
Cc: Simon Horman <horms@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
 Steve French <sfrench@...ba.org>, Enzo Matsumiya <ematsumiya@...e.de>,
 Wang Zhaolong <wangzhaolong1@...wei.com>,
 Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org,
 stable@...r.kernel.org
Subject: Re: [PATCH v1 net] net: Fix null-ptr-deref by
 sock_lock_init_class_and_name() and rmmod.

On 03. 04. 25, 4:07, Kuniyuki Iwashima wrote:
...
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -2324,6 +2324,12 @@ static void __sk_destruct(struct rcu_head *head)
>   		__netns_tracker_free(net, &sk->ns_tracker, false);
>   		net_passive_dec(net);
>   	}
> +
> +#if IS_ENABLED(CONFIG_PROVE_LOCKING) && IS_ENABLED(CONFIG_MODULES)

I don't know if this is the right approach at all (it appears not to 
me), but:

Having this check in random files looks error prone. Perhaps you want to 
introduce some macro like SOCK_NEEDS_OWNER? Or you introduce sk_put_owner().

> +	if (sk->sk_owner)

The if is not needed.

> +		module_put(sk->sk_owner);
> +#endif
> +
>   	sk_prot_free(sk->sk_prot_creator, sk);
>   }
>   

-- 
js
suse labs


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ