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: <20240801072842.69b0cc57@kernel.org>
Date: Thu, 1 Aug 2024 07:28:42 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jeongjun Park <aha310510@...il.com>
Cc: jiri@...nulli.us, davem@...emloft.net, edumazet@...gle.com,
 pabeni@...hat.com, netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 syzbot+b668da2bc4cb9670bf58@...kaller.appspotmail.com
Subject: Re: [PATCH net] team: fix possible deadlock in
 team_port_change_check

On Thu,  1 Aug 2024 20:18:42 +0900 Jeongjun Park wrote:
>  	struct team *team = port->team;
> +	bool flag = true;
>  
> -	mutex_lock(&team->lock);
> +	if (mutex_is_locked(&team->lock)){
> +		unsigned long owner, curr = (unsigned long)current;
> +		owner = atomic_long_read(&team->lock.owner);
> +		if (owner != curr)
> +			mutex_lock(&team->lock);
> +		else
> +			flag = false;
> +	}
> +	else{
> +		mutex_lock(&team->lock);
> +	}
>  	__team_port_change_check(port, linkup);
> -	mutex_unlock(&team->lock);
> +	if (flag)
> +		mutex_unlock(&team->lock);

You didn't even run this thru checkpatch, let alone the fact that its
reimplementing nested locks (or trying to) :(

Some of the syzbot reports are not fixed because they are either hard
or because there is a long standing disagreement on how to solve them.
Please keep that in mind.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ