netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][net-next] net: tcp: remove BUG_ON from tcp_v4_err
@ 2018-11-09  9:04 Li RongQing
  2018-11-09 17:12 ` Eric Dumazet
  2018-11-09 23:17 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Li RongQing @ 2018-11-09  9:04 UTC (permalink / raw)
  To: netdev

if skb is NULL pointer, and the following access of skb's
skb_mstamp_ns will trigger panic, which is same as BUG_ON

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/ipv4/tcp_ipv4.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index a336787d75e5..5424a4077c27 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -542,7 +542,6 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
 		icsk->icsk_rto = inet_csk_rto_backoff(icsk, TCP_RTO_MAX);
 
 		skb = tcp_rtx_queue_head(sk);
-		BUG_ON(!skb);
 
 		tcp_mstamp_refresh(tp);
 		delta_us = (u32)(tp->tcp_mstamp - tcp_skb_timestamp_us(skb));
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next] net: tcp: remove BUG_ON from tcp_v4_err
  2018-11-09  9:04 [PATCH][net-next] net: tcp: remove BUG_ON from tcp_v4_err Li RongQing
@ 2018-11-09 17:12 ` Eric Dumazet
  2018-11-09 23:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2018-11-09 17:12 UTC (permalink / raw)
  To: Li RongQing, netdev



On 11/09/2018 01:04 AM, Li RongQing wrote:
> if skb is NULL pointer, and the following access of skb's
> skb_mstamp_ns will trigger panic, which is same as BUG_ON
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  net/ipv4/tcp_ipv4.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index a336787d75e5..5424a4077c27 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -542,7 +542,6 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
>  		icsk->icsk_rto = inet_csk_rto_backoff(icsk, TCP_RTO_MAX);
>  
>  		skb = tcp_rtx_queue_head(sk);
> -		BUG_ON(!skb);
>  
>  		tcp_mstamp_refresh(tp);
>  		delta_us = (u32)(tp->tcp_mstamp - tcp_skb_timestamp_us(skb));
> 

SGTM, thanks.

Signed-off-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next] net: tcp: remove BUG_ON from tcp_v4_err
  2018-11-09  9:04 [PATCH][net-next] net: tcp: remove BUG_ON from tcp_v4_err Li RongQing
  2018-11-09 17:12 ` Eric Dumazet
@ 2018-11-09 23:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-11-09 23:17 UTC (permalink / raw)
  To: lirongqing; +Cc: netdev

From: Li RongQing <lirongqing@baidu.com>
Date: Fri,  9 Nov 2018 17:04:51 +0800

> if skb is NULL pointer, and the following access of skb's
> skb_mstamp_ns will trigger panic, which is same as BUG_ON
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-10  9:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-09  9:04 [PATCH][net-next] net: tcp: remove BUG_ON from tcp_v4_err Li RongQing
2018-11-09 17:12 ` Eric Dumazet
2018-11-09 23:17 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).