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] [day] [month] [year] [list]
Date:   Thu, 19 Apr 2018 07:18:58 +0200
From:   Steffen Klassert <steffen.klassert@...unet.com>
To:     sunlianwen <sunlw.fnst@...fujitsu.com>
CC:     <netdev@...r.kernel.org>
Subject: Re: [PATCH] net: add mutex_unlock on xfrm4_protocol_register

On Thu, Apr 19, 2018 at 09:08:57AM +0800, sunlianwen wrote:
> The function of xfrm4_protocol_register() don't release
> the mutx lock, which potential cause deadlock.

Can you please explain how this can happen?

> 
> Signed-off-by: Lianwen Sun <sunlw.fnst@...fujitsu.com>
> ---
>  net/ipv4/xfrm4_protocol.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/ipv4/xfrm4_protocol.c b/net/ipv4/xfrm4_protocol.c
> index 8dd0e6ab8606..1ee34edef9d2 100644
> --- a/net/ipv4/xfrm4_protocol.c
> +++ b/net/ipv4/xfrm4_protocol.c
> @@ -240,6 +240,10 @@ int xfrm4_protocol_register(struct xfrm4_protocol *handler,
>  
>  	ret = 0;
>  
> +	mutex_unlock(&xfrm4_protocol_mutex);
> +
> +	return ret;
> +
>  err:
>  	mutex_unlock(&xfrm4_protocol_mutex);

Did you test this patch?

I'm sure you did not. You return before the protocol
is registered, this breaks IPsec for IPv4 completely.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ