Revert "bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues"
This reverts commite991558189which is commit d8616ee2affcff37c5d315310da557a694a3303d upstream. It breaks the in-kernel API, and is not needed for the true bugfix to be backported properly (this was a dependent patch to make upstream changes easier), so it can be reverted. If it is deemed that this change is needed in the Android branch, it can be added back later in an ABI-safe way. Bug: 161946584 Fixes:e991558189("bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues") Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I5db9531762c48519b4d4c98a0316e1fe467a8640
This commit is contained in:
@@ -2034,7 +2034,6 @@ int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);
|
||||
int sock_map_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype);
|
||||
int sock_map_update_elem_sys(struct bpf_map *map, void *key, void *value, u64 flags);
|
||||
void sock_map_unhash(struct sock *sk);
|
||||
void sock_map_destroy(struct sock *sk);
|
||||
void sock_map_close(struct sock *sk, long timeout);
|
||||
#else
|
||||
static inline int bpf_prog_offload_init(struct bpf_prog *prog,
|
||||
|
||||
@@ -96,7 +96,6 @@ struct sk_psock {
|
||||
spinlock_t link_lock;
|
||||
refcount_t refcnt;
|
||||
void (*saved_unhash)(struct sock *sk);
|
||||
void (*saved_destroy)(struct sock *sk);
|
||||
void (*saved_close)(struct sock *sk, long timeout);
|
||||
void (*saved_write_space)(struct sock *sk);
|
||||
void (*saved_data_ready)(struct sock *sk);
|
||||
|
||||
@@ -720,7 +720,6 @@ struct sk_psock *sk_psock_init(struct sock *sk, int node)
|
||||
psock->eval = __SK_NONE;
|
||||
psock->sk_proto = prot;
|
||||
psock->saved_unhash = prot->unhash;
|
||||
psock->saved_destroy = prot->destroy;
|
||||
psock->saved_close = prot->close;
|
||||
psock->saved_write_space = sk->sk_write_space;
|
||||
|
||||
|
||||
@@ -1524,29 +1524,6 @@ void sock_map_unhash(struct sock *sk)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sock_map_unhash);
|
||||
|
||||
void sock_map_destroy(struct sock *sk)
|
||||
{
|
||||
void (*saved_destroy)(struct sock *sk);
|
||||
struct sk_psock *psock;
|
||||
|
||||
rcu_read_lock();
|
||||
psock = sk_psock_get(sk);
|
||||
if (unlikely(!psock)) {
|
||||
rcu_read_unlock();
|
||||
if (sk->sk_prot->destroy)
|
||||
sk->sk_prot->destroy(sk);
|
||||
return;
|
||||
}
|
||||
|
||||
saved_destroy = psock->saved_destroy;
|
||||
sock_map_remove_links(sk, psock);
|
||||
rcu_read_unlock();
|
||||
sk_psock_stop(psock);
|
||||
sk_psock_put(sk, psock);
|
||||
saved_destroy(sk);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sock_map_destroy);
|
||||
|
||||
void sock_map_close(struct sock *sk, long timeout)
|
||||
{
|
||||
void (*saved_close)(struct sock *sk, long timeout);
|
||||
|
||||
@@ -543,7 +543,6 @@ static void tcp_bpf_rebuild_protos(struct proto prot[TCP_BPF_NUM_CFGS],
|
||||
struct proto *base)
|
||||
{
|
||||
prot[TCP_BPF_BASE] = *base;
|
||||
prot[TCP_BPF_BASE].destroy = sock_map_destroy;
|
||||
prot[TCP_BPF_BASE].close = sock_map_close;
|
||||
prot[TCP_BPF_BASE].recvmsg = tcp_bpf_recvmsg;
|
||||
prot[TCP_BPF_BASE].sock_is_readable = sk_msg_is_readable;
|
||||
|
||||
Reference in New Issue
Block a user