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: <CAM_iQpXcqpEFpnyX=wLQFTWJBjWiAMofighQkpnrV2a0Fh83AQ@mail.gmail.com>
Date:   Sun, 19 Sep 2021 16:52:35 -0700
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     Yajun Deng <yajun.deng@...ux.dev>
Cc:     Jakub Kicinski <kuba@...nel.org>,
        David Miller <davem@...emloft.net>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: socket: add the case sock_no_xxx support

On Sat, Sep 18, 2021 at 5:11 AM <yajun.deng@...ux.dev> wrote:
>
> September 18, 2021 9:33 AM, "Jakub Kicinski" <kuba@...nel.org> wrote:
>
> > On Thu, 16 Sep 2021 20:29:43 +0800 Yajun Deng wrote:
> >
> >> Those sock_no_{mmap, socketpair, listen, accept, connect, shutdown,
> >> sendpage} functions are used many times in struct proto_ops, but they are
> >> meaningless. So we can add them support in socket and delete them in struct
> >> proto_ops.
> >
> > So the reason to do this is.. what exactly?
> >
> > Removing a couple empty helpers (which is not even part of this patch)?
> >
> > I'm not sold, sorry.
>
> When we define a struct proto_ops xxx, we only need to assign meaningful member variables that we need.
> Those {mmap, socketpair, listen, accept, connect, shutdown, sendpage} members we don't need assign
> it if we don't need. We just need do once in socket, not in every struct proto_ops.
>
> These members are assigned meaningless values far more often than meaningful ones, so this patch I used likely(!!sock->ops->xxx) for this case. This is the reason why I send this patch.

But you end up adding more code:

 1 file changed, 58 insertions(+), 13 deletions(-)

I don't see this as a gain from any perspective.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ