From: John Fastabend <john.fastabend@gmail.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>,
John Fastabend <john.fastabend@gmail.com>
Cc: Hillf Danton <hdanton@sina.com>,
syzbot <syzbot+7a6ee4d0078eac6bf782@syzkaller.appspotmail.com>,
aviadye@mellanox.com, borisp@mellanox.com, daniel@iogearbox.net,
davejwatson@fb.com, davem@davemloft.net,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: general protection fault in tls_sk_proto_close (2)
Date: Thu, 29 Aug 2019 15:18:46 -0700 [thread overview]
Message-ID: <5d684f46b5c51_6192b27353185bcf7@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <20190829115315.5686c18f@cakuba.netronome.com>
Jakub Kicinski wrote:
> On Thu, 29 Aug 2019 11:48:32 -0700, John Fastabend wrote:
> > Jakub Kicinski wrote:
> > > On Thu, 29 Aug 2019 11:52:00 +0800, Hillf Danton wrote:
> > > > Alternatively work is done if sock is closed again. Anyway ctx is reset
> > > > under sock's callback lock in write mode.
> > > >
> > > > --- a/net/tls/tls_main.c
> > > > +++ b/net/tls/tls_main.c
> > > > @@ -295,6 +295,8 @@ static void tls_sk_proto_close(struct so
> > > > long timeo = sock_sndtimeo(sk, 0);
> > > > bool free_ctx;
> > > >
> > > > + if (!ctx)
> > > > + return;
> > > > if (ctx->tx_conf == TLS_SW)
> > > > tls_sw_cancel_work_tx(ctx);
> > >
> > > That's no bueno, the real socket's close will never get called.
> >
> > Seems when we refactored BPF side we dropped the check for ULP on one
> > path so I'll add that back now. It would be nice and seems we are
> > getting closer now that tls side is a bit more dynamic if the ordering
> > didn't matter.
>
> We'd probably need some more generic way of communicating the changes
> in sk_proto stack, e.g. by moving the update into one of sk_proto
> callbacks? but yes.
>
> > diff --git a/net/core/sock_map.c b/net/core/sock_map.c
> > index 1330a7442e5b..30d11558740e 100644
> > --- a/net/core/sock_map.c
> > +++ b/net/core/sock_map.c
> > @@ -666,6 +666,8 @@ static int sock_hash_update_common(struct bpf_map *map, void *key,
> > WARN_ON_ONCE(!rcu_read_lock_held());
> > if (unlikely(flags > BPF_EXIST))
> > return -EINVAL;
> > + if (unlikely(icsk->icsk_ulp_data))
> > + return -EINVAL;
> >
> > link = sk_psock_init_link();
> > if (!link)
>
> Thanks! That looks good, if you feel like submitting officially feel
> free to add my Reviewed-by!
I'll send it out this evening after running the selftests.
.John
prev parent reply other threads:[~2019-08-29 22:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-28 6:38 syzbot
2019-08-28 22:26 ` Jakub Kicinski
[not found] ` <20190829035200.3340-1-hdanton@sina.com>
2019-08-29 16:43 ` Jakub Kicinski
2019-08-29 18:48 ` John Fastabend
2019-08-29 18:53 ` Jakub Kicinski
2019-08-29 22:18 ` John Fastabend [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d684f46b5c51_6192b27353185bcf7@john-XPS-13-9370.notmuch \
--to=john.fastabend@gmail.com \
--cc=aviadye@mellanox.com \
--cc=borisp@mellanox.com \
--cc=daniel@iogearbox.net \
--cc=davejwatson@fb.com \
--cc=davem@davemloft.net \
--cc=hdanton@sina.com \
--cc=jakub.kicinski@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=syzbot+7a6ee4d0078eac6bf782@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®