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-next>] [day] [month] [year] [list]
Date:   Mon, 3 Jan 2022 10:43:35 -0800
From:   Shoaib Rao <rao.shoaib@...cle.com>
To:     Ryan Cai <ycaibb@...il.com>, davem@...emloft.net, kuba@...nel.org,
        ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
        kafai@...com, songliubraving@...com, yhs@...com,
        john.fastabend@...il.com, kpsingh@...nel.org,
        cong.wang@...edance.com, viro@...iv.linux.org.uk,
        edumazet@...gle.com, jiang.wang@...edance.com,
        christian.brauner@...ntu.com, kuniyu@...zon.co.jp
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org
Subject: Re: [PATCH] af_unix: missing lock releases in af_unix.c


On 1/3/22 05:58, Ryan Cai wrote:
> In method __unix_dgram_recvmsg, the lock u->iolock is not released when skb is true and loop breaks.
>
> Signed-off-by: Ryan Cai <ycaibb@...il.com>
> ---
>   net/unix/af_unix.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index b0bfc78e421c..b97972948d9d 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -2305,6 +2305,7 @@ int __unix_dgram_recvmsg(struct sock *sk, struct msghdr *msg, size_t size,
>   		if (skb) {
>   			if (!(flags & MSG_PEEK))
>   				scm_stat_del(sk, skb);
> +			mutex_unlock(&u->iolock);
>   			break;
>   		}
>   

It seems to me that the unlock at the end will release the mutex?

out_free:
         skb_free_datagram(sk, skb);
         mutex_unlock(&u->iolock);

Shoaib

Powered by blists - more mailing lists