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]
Message-ID: <9BADB912-9338-4798-94C4-AA6268C4CA06@gmail.com>
Date:   Wed, 05 Jan 2022 17:19:00 +0800
From:   Ryan Cai <ycaibb@...il.com>
To:     Shoaib Rao <rao.shoaib@...cle.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

Hi, Shoaib

          After further checking, the lock is indeed released at the out_free. My patch is invalid. Sorry for the inconvenience.

Best,
Ryan

On 4/1/2022, 2:47 AM, "Shoaib Rao" <rao.shoaib@...cle.com> wrote:


    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

Powered by Openwall GNU/*/Linux Powered by OpenVZ