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: <6112b19a30160_1c2c820888@john-XPS-13-9370.notmuch>
Date:   Tue, 10 Aug 2021 10:04:26 -0700
From:   John Fastabend <john.fastabend@...il.com>
To:     Cong Wang <xiyou.wangcong@...il.com>,
        John Fastabend <john.fastabend@...il.com>
Cc:     Jiang Wang <jiang.wang@...edance.com>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        "Cong Wang ." <cong.wang@...edance.com>,
        Xiongchun Duan <duanxiongchun@...edance.com>,
        xieyongji@...edance.com, chaiwen.cc@...edance.com,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jakub Sitnicki <jakub@...udflare.com>,
        Lorenz Bauer <lmb@...udflare.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        KP Singh <kpsingh@...nel.org>, Shuah Khan <shuah@...nel.org>,
        Johan Almbladh <johan.almbladh@...finetworks.com>,
        LKML <linux-kernel@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH bpf-next v1 2/5] af_unix: add unix_stream_proto for
 sockmap

Cong Wang wrote:
> On Wed, Jul 28, 2021 at 11:44 AM John Fastabend
> <john.fastabend@...il.com> wrote:
> >
> > Cong Wang wrote:
> > > On Tue, Jul 27, 2021 at 9:37 AM John Fastabend <john.fastabend@...il.com> wrote:
> > > > Do we really need an unhash hook for unix_stream? I'm doing some testing
> > > > now to pull it out of TCP side as well. It seems to be an artifact of old
> > > > code that is no longer necessary. On TCP side at least just using close()
> > > > looks to be enough now.
> > >
> > > How do you handle the disconnection from remote without ->unhash()?
> >
> > Would close() not work for stream/dgram sockets?
> 
> close() is called when the local closes the sockets, but when the remote
> closes or disconnects it, unhash() is called. This is why TCP calls unhash()
> to remove the socket from established socket hash table. unhash() itself
> might not make much sense for AF_UNIX as it probably does not need a
> hash table to track established ones, however, the idea is the same, that
> is, we have to handle remote disconnections here.

Following up on this series. Leaving a socket in the sockmap until close()
happens is not paticularly problematic, but does consume space in the map
so unhash() is slightly better I guess. Thanks.

> 
> Thanks.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ