]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/ocfs2/cluster/tcp.c
net: Fix use after free by removing length arg from sk_data_ready callbacks.
[mirror_ubuntu-artful-kernel.git] / fs / ocfs2 / cluster / tcp.c
index eb649d23a4de24e4cde6860389528e7b2ef919dc..d857534b886efa23b67c9d332aa1cd75bf09518b 100644 (file)
@@ -137,7 +137,7 @@ static int o2net_sys_err_translations[O2NET_ERR_MAX] =
 static void o2net_sc_connect_completed(struct work_struct *work);
 static void o2net_rx_until_empty(struct work_struct *work);
 static void o2net_shutdown_sc(struct work_struct *work);
-static void o2net_listen_data_ready(struct sock *sk, int bytes);
+static void o2net_listen_data_ready(struct sock *sk);
 static void o2net_sc_send_keep_req(struct work_struct *work);
 static void o2net_idle_timer(unsigned long data);
 static void o2net_sc_postpone_idle(struct o2net_sock_container *sc);
@@ -597,9 +597,9 @@ static void o2net_set_nn_state(struct o2net_node *nn,
 }
 
 /* see o2net_register_callbacks() */
-static void o2net_data_ready(struct sock *sk, int bytes)
+static void o2net_data_ready(struct sock *sk)
 {
-       void (*ready)(struct sock *sk, int bytes);
+       void (*ready)(struct sock *sk);
 
        read_lock(&sk->sk_callback_lock);
        if (sk->sk_user_data) {
@@ -613,7 +613,7 @@ static void o2net_data_ready(struct sock *sk, int bytes)
        }
        read_unlock(&sk->sk_callback_lock);
 
-       ready(sk, bytes);
+       ready(sk);
 }
 
 /* see o2net_register_callbacks() */
@@ -1953,9 +1953,9 @@ static void o2net_accept_many(struct work_struct *work)
                cond_resched();
 }
 
-static void o2net_listen_data_ready(struct sock *sk, int bytes)
+static void o2net_listen_data_ready(struct sock *sk)
 {
-       void (*ready)(struct sock *sk, int bytes);
+       void (*ready)(struct sock *sk);
 
        read_lock(&sk->sk_callback_lock);
        ready = sk->sk_user_data;
@@ -1978,7 +1978,6 @@ static void o2net_listen_data_ready(struct sock *sk, int bytes)
         */
 
        if (sk->sk_state == TCP_LISTEN) {
-               mlog(ML_TCP, "bytes: %d\n", bytes);
                queue_work(o2net_wq, &o2net_listen_work);
        } else {
                ready = NULL;
@@ -1987,7 +1986,7 @@ static void o2net_listen_data_ready(struct sock *sk, int bytes)
 out:
        read_unlock(&sk->sk_callback_lock);
        if (ready != NULL)
-               ready(sk, bytes);
+               ready(sk);
 }
 
 static int o2net_open_listening_sock(__be32 addr, __be16 port)