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: <60f70ac727c2d_6600820855@john-XPS-13-9370.notmuch>
Date:   Tue, 20 Jul 2021 10:41:27 -0700
From:   John Fastabend <john.fastabend@...il.com>
To:     Jakub Sitnicki <jakub@...udflare.com>,
        John Fastabend <john.fastabend@...il.com>
Cc:     daniel@...earbox.net, xiyou.wangcong@...il.com,
        alexei.starovoitov@...il.com, bpf@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH bpf 1/3] bpf, sockmap: zap ingress queues after stopping
 strparser

Jakub Sitnicki wrote:
> On Mon, Jul 19, 2021 at 11:48 PM CEST, John Fastabend wrote:
> > We don't want strparser to run and pass skbs into skmsg handlers when
> > the psock is null. We just sk_drop them in this case. When removing
> > a live socket from map it means extra drops that we do not need to
> > incur. Move the zap below strparser close to avoid this condition.
> >
> > This way we stop the stream parser first stopping it from processing
> > packets and then delete the psock.
> >
> > Fixes: a136678c0bdbb ("bpf: sk_msg, zap ingress queue on psock down")
> > Signed-off-by: John Fastabend <john.fastabend@...il.com>
> > ---
> 
> To confirm my understanding - the extra drops can happen because
> currently we are racing to clear SK_PSOCK_TX_ENABLED flag in
> sk_psock_drop with sk_psock_verdict_apply, which checks the flag before
> pushing skb onto psock->ingress_skb queue (or possibly straight into
> psock->ingress_msg queue on no redirect).


Correct. If strparser hands a skb to the sk_psock_* handlers then before
they enqueue the packet the flag is checked and the packet will be
dropped in this case. I noticed this while testing. So rather than
letting packets get into sk_psock_* handlers this patch just stops the
strparser.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ