]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
bpf: Sockmap/tls, skmsg can have wrapped skmsg that needs extra chaining
authorJohn Fastabend <john.fastabend@gmail.com>
Sat, 11 Jan 2020 06:12:05 +0000 (06:12 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:00:53 +0000 (01:00 -0500)
commit1a30393a9ba29c7a62b060d8acab571a2f630f62
tree384b9f82f850f221e4e4fe8671fff88c69e68ab7
parent09f15d23e451561367908739545dc36812df8030
bpf: Sockmap/tls, skmsg can have wrapped skmsg that needs extra chaining

BugLink: https://bugs.launchpad.net/bugs/1862429
commit 9aaaa56845a06aeabdd597cbe19492dc01f281ec upstream.

Its possible through a set of push, pop, apply helper calls to construct
a skmsg, which is just a ring of scatterlist elements, with the start
value larger than the end value. For example,

      end       start
  |_0_|_1_| ... |_n_|_n+1_|

Where end points at 1 and start points and n so that valid elements is
the set {n, n+1, 0, 1}.

Currently, because we don't build the correct chain only {n, n+1} will
be sent. This adds a check and sg_chain call to correctly submit the
above to the crypto and tls send path.

Fixes: d3b18ad31f93d ("tls: add bpf support to sk_msg handling")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/bpf/20200111061206.8028-8-john.fastabend@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/tls/tls_sw.c