diff options
author | John Fastabend <john.fastabend@gmail.com> | 2018-12-20 11:35:33 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-12 20:02:26 +0100 |
commit | 47c12a8a77e129fa934226af414a38043ab69d46 (patch) | |
tree | d7642daba52c8a29a25bd6472ed974916b6d23e6 /include | |
parent | a802513bff9657bbc60aea34f8932692f3c471eb (diff) |
bpf: sk_msg, fix socket data_ready events
[ Upstream commit 552de91068828daef50a227a665068cf8dde835e ]
When a skb verdict program is in-use and either another BPF program
redirects to that socket or the new SK_PASS support is used the
data_ready callback does not wake up application. Instead because
the stream parser/verdict is using the sk data_ready callback we wake
up the stream parser/verdict block.
Fix this by adding a helper to check if the stream parser block is
enabled on the sk and if so call the saved pointer which is the
upper layers wake up function.
This fixes application stalls observed when an application is waiting
for data in a blocking read().
Fixes: d829e9c4112b ("tls: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skmsg.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 2a11e9d91dfa..36bd85863081 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -416,6 +416,14 @@ static inline void sk_psock_put(struct sock *sk, struct sk_psock *psock) sk_psock_drop(sk, psock); } +static inline void sk_psock_data_ready(struct sock *sk, struct sk_psock *psock) +{ + if (psock->parser.enabled) + psock->parser.saved_data_ready(sk); + else + sk->sk_data_ready(sk); +} + static inline void psock_set_prog(struct bpf_prog **pprog, struct bpf_prog *prog) { |