mirror of
https://github.com/openharmony/kernel_linux_common_modules.git
synced 2026-08-27 01:31:36 -04:00
解决sk->sk_send_head指针可能使用已释放skb的问题
Signed-off-by: shiyunfei <shiyunfei3@huawei.com>
This commit is contained in:
@@ -163,6 +163,12 @@ static inline struct tcp_nip_request_sock *tcp_nip_rsk(const struct request_sock
|
||||
return (struct tcp_nip_request_sock *)req;
|
||||
}
|
||||
|
||||
static inline void tcp_nip_modify_send_head(struct sock *sk, const struct sk_buff *skb)
|
||||
{
|
||||
if (tcp_skb_is_last(sk, skb))
|
||||
sk->sk_send_head = NULL;
|
||||
}
|
||||
|
||||
/* connect */
|
||||
int __tcp_nip_connect(struct sock *sk);
|
||||
int _tcp_nip_conn_request(struct request_sock_ops *rsk_ops,
|
||||
|
||||
@@ -1578,6 +1578,7 @@ out:
|
||||
|
||||
do_fault:
|
||||
if (!skb->len) {
|
||||
tcp_nip_modify_send_head(sk, skb);
|
||||
tcp_unlink_write_queue(skb, sk);
|
||||
sk_wmem_free_skb(sk, skb);
|
||||
}
|
||||
|
||||
@@ -817,6 +817,7 @@ static int tcp_nip_clean_rtx_queue(struct sock *sk, ktime_t *skb_snd_tstamp)
|
||||
if (*skb_snd_tstamp == 0)
|
||||
*skb_snd_tstamp = skb->tstamp;
|
||||
|
||||
tcp_nip_modify_send_head(sk, skb);
|
||||
tcp_unlink_write_queue(skb, sk);
|
||||
sk_wmem_free_skb(sk, skb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user