Commit 884cf705 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: remove dead code after sk_data_ready change

As a followup to commit 676d2369 ("net: Fix use after free by
removing length arg from sk_data_ready callbacks"), we can remove
some useless code in sock_queue_rcv_skb() and rxrpc_queue_rcv_skb()
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2de875c
...@@ -437,7 +437,6 @@ static void sock_disable_timestamp(struct sock *sk, unsigned long flags) ...@@ -437,7 +437,6 @@ static void sock_disable_timestamp(struct sock *sk, unsigned long flags)
int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{ {
int err; int err;
int skb_len;
unsigned long flags; unsigned long flags;
struct sk_buff_head *list = &sk->sk_receive_queue; struct sk_buff_head *list = &sk->sk_receive_queue;
...@@ -459,13 +458,6 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) ...@@ -459,13 +458,6 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
skb->dev = NULL; skb->dev = NULL;
skb_set_owner_r(skb, sk); skb_set_owner_r(skb, sk);
/* Cache the SKB length before we tack it onto the receive
* queue. Once it is added it no longer belongs to us and
* may be freed by other threads of control pulling packets
* from the queue.
*/
skb_len = skb->len;
/* we escape from rcu protected region, make sure we dont leak /* we escape from rcu protected region, make sure we dont leak
* a norefcounted dst * a norefcounted dst
*/ */
......
...@@ -45,7 +45,7 @@ int rxrpc_queue_rcv_skb(struct rxrpc_call *call, struct sk_buff *skb, ...@@ -45,7 +45,7 @@ int rxrpc_queue_rcv_skb(struct rxrpc_call *call, struct sk_buff *skb,
struct rxrpc_skb_priv *sp; struct rxrpc_skb_priv *sp;
struct rxrpc_sock *rx = call->socket; struct rxrpc_sock *rx = call->socket;
struct sock *sk; struct sock *sk;
int skb_len, ret; int ret;
_enter(",,%d,%d", force, terminal); _enter(",,%d,%d", force, terminal);
...@@ -101,13 +101,6 @@ int rxrpc_queue_rcv_skb(struct rxrpc_call *call, struct sk_buff *skb, ...@@ -101,13 +101,6 @@ int rxrpc_queue_rcv_skb(struct rxrpc_call *call, struct sk_buff *skb,
rx->interceptor(sk, call->user_call_ID, skb); rx->interceptor(sk, call->user_call_ID, skb);
spin_unlock_bh(&sk->sk_receive_queue.lock); spin_unlock_bh(&sk->sk_receive_queue.lock);
} else { } else {
/* Cache the SKB length before we tack it onto the
* receive queue. Once it is added it no longer
* belongs to us and may be freed by other threads of
* control pulling packets from the queue */
skb_len = skb->len;
_net("post skb %p", skb); _net("post skb %p", skb);
__skb_queue_tail(&sk->sk_receive_queue, skb); __skb_queue_tail(&sk->sk_receive_queue, skb);
spin_unlock_bh(&sk->sk_receive_queue.lock); spin_unlock_bh(&sk->sk_receive_queue.lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment