diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2019-07-22 17:04:17 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-07-22 17:04:18 +0300 |
commit | 57ebc6230f060fd467fd5fd4552de5ebc40cb48c (patch) | |
tree | 69dd3c719d6a6d8549bab63a33dfce5359430c74 /tools/lib/bpf/libbpf.c | |
parent | 1d4126c4e1190d2f7d3f388552f9bd17ae0c64fc (diff) | |
parent | d4d34185e710750ad748a0f0a73e8cdac7480bfc (diff) | |
download | linux-57ebc6230f060fd467fd5fd4552de5ebc40cb48c.tar.xz |
Merge branch 'bpf-sockmap-tls-fixes'
Jakub Kicinski says:
====================
John says:
Resolve a series of splats discovered by syzbot and an unhash
TLS issue noted by Eric Dumazet.
The main issues revolved around interaction between TLS and
sockmap tear down. TLS and sockmap could both reset sk->prot
ops creating a condition where a close or unhash op could be
called forever. A rare race condition resulting from a missing
rcu sync operation was causing a use after free. Then on the
TLS side dropping the sock lock and re-acquiring it during the
close op could hang. Finally, sockmap must be deployed before
tls for current stack assumptions to be met. This is enforced
now. A feature series can enable it.
To fix this first refactor TLS code so the 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. Then apply three fixes to sockmap to fix up races
on tear down around map free and close. Finally, if sockmap
is destroyed before TLS we add a new ULP op update to inform
the TLS stack it should not call sockmap ops. This last one
appears to be the most commonly found issue from syzbot.
v4:
- fix some use after frees;
- disable disconnect work for offload (ctx lifetime is much
more complex);
- remove some of the dead code which made it hard to understand
(for me) that things work correctly (e.g. the checks TLS is
the top ULP);
- add selftets.
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
0 files changed, 0 insertions, 0 deletions