All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] tls, add unhash callback
@ 2019-06-27 17:36 John Fastabend
  2019-06-27 17:36 ` [PATCH 1/2] tls: remove close callback sock unlock/lock and flush_sync John Fastabend
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: John Fastabend @ 2019-06-27 17:36 UTC (permalink / raw)
  To: daniel, jakub.kicinski, ast; +Cc: netdev, edumazet, john.fastabend, bpf

Resolve a series of splats discovered by syzbot and noted by
Eric Dumazet. The primary problem here is we resolved an issue on
the BPF sockmap side by adding an unhash callback. This is
required to ensure sockmap sockets do not transition out of
ESTABLISHED state into a LISTEN state. When we did this it
created a case where the interaction between callbacks in TLS
and sockmap when used together could break. This resulted in
leaking TLS memory and potential to build loops of callbacks
where sockmap called into TLS and TLS called back into BPF.

Additionally, TLS was releasing the sock lock and then
reaquiring it during the tear down process which could hang
if another sock operation happened while the lock was not
held.

To fix this first refactor TLS code so lock is held for the
entire teardown operation. Then add an unhash callback to ensure
TLS can not transition from ESTABLISHED to LISTEN state. This
transition is a similar bug to the one found and fixed previously
in sockmap. And cleans up the callbacks to fix the syzbot
errors.

---

John Fastabend (2):
      tls: remove close callback sock unlock/lock and flush_sync
      bpf: tls, implement unhash to avoid transition out of ESTABLISHED


 include/net/tls.h  |    6 ++-
 net/tls/tls_main.c |   96 ++++++++++++++++++++++++++++++++++++----------------
 net/tls/tls_sw.c   |   50 ++++++++++++++++++---------
 3 files changed, 103 insertions(+), 49 deletions(-)

--
Signature

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-06-29  3:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 17:36 [PATCH 0/2] tls, add unhash callback John Fastabend
2019-06-27 17:36 ` [PATCH 1/2] tls: remove close callback sock unlock/lock and flush_sync John Fastabend
2019-06-27 23:44   ` Jakub Kicinski
2019-06-28 14:12     ` John Fastabend
2019-06-28 18:31       ` Jakub Kicinski
2019-06-28 19:40         ` John Fastabend
2019-06-28 22:48           ` Jakub Kicinski
2019-06-29  0:20             ` John Fastabend
2019-06-29  0:59               ` Jakub Kicinski
2019-06-29  3:46                 ` Jakub Kicinski
2019-06-27 17:36 ` [PATCH 2/2] bpf: tls, implement unhash to avoid transition out of ESTABLISHED John Fastabend
2019-06-27 18:16 ` [PATCH 0/2] tls, add unhash callback John Fastabend

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.