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: <CAF=yD-KG+wyHkX40FXPXNiNEHeKjOd5hPSDFuh-z0pUAnLehLg@mail.gmail.com>
Date:   Mon, 26 Nov 2018 13:19:23 -0500
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Paolo Abeni <pabeni@...hat.com>
Cc:     Network Development <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>,
        Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net-next v2 1/2] udp: msg_zerocopy

On Mon, Nov 26, 2018 at 1:04 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On Mon, 2018-11-26 at 12:59 -0500, Willem de Bruijn wrote:
> > The callers of this function do flush the queue of the other skbs on
> > error, but only after the call to sock_zerocopy_put_abort.
> >
> > sock_zerocopy_put_abort depends on total rollback to revert the
> > sk_zckey increment and suppress the completion notification (which
> > must not happen on return with error).
> >
> > I don't immediately have a fix. Need to think about this some more..
>
> [still out of sheer ignorance] How about tacking a refcnt for the whole
> ip_append_data() scope, like in the tcp case? that will add an atomic
> op per loop (likely, hitting the cache) but will remove some code hunk
> in sock_zerocopy_put_abort() and sock_zerocopy_alloc().

The atomic op pair is indeed what I was trying to avoid. But I also need
to solve the problem that the final decrement will happen from the freeing
of the other skbs in __ip_flush_pending_frames, and will not suppress
the notification.

Freeing the entire queue inside __ip_append_data, effectively making it
a true noop on error is one approach. But that is invasive, also to non
zerocopy codepaths, so I would rather avoid that.

Perhaps I need to handle the abort logic in udp_sendmsg directly,
after both __ip_append_data and __ip_flush_pending_frames.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ