Skip to content

Commit b59db45

Browse files
ShacharKagankuba-moo
authored andcommitted
tcp: Revert no longer abort SYN_SENT when receiving some ICMP
This reverts commit 0a8de36. Shachar reported that Vagrant (https://www.vagrantup.com/), which is very popular tool to manage fleet of VMs stopped to work after commit citied in Fixes line. The issue appears while using Vagrant to manage nested VMs. The steps are: * create vagrant file * vagrant up * vagrant halt (VM is created but shut down) * vagrant up - fail Vagrant up stdout: Bringing machine 'player1' up with 'libvirt' provider... ==> player1: Creating shared folders metadata... ==> player1: Starting domain. ==> player1: Domain launching with graphics connection settings... ==> player1: -- Graphics Port: 5900 ==> player1: -- Graphics IP: 127.0.0.1 ==> player1: -- Graphics Password: Not defined ==> player1: -- Graphics Websocket: 5700 ==> player1: Waiting for domain to get an IP address... ==> player1: Waiting for machine to boot. This may take a few minutes... player1: SSH address: 192.168.123.61:22 player1: SSH username: vagrant player1: SSH auth method: private key ==> player1: Attempting graceful shutdown of VM... ==> player1: Attempting graceful shutdown of VM... ==> player1: Attempting graceful shutdown of VM... player1: Guest communication could not be established! This is usually because player1: SSH is not running, the authentication information was changed, player1: or some other networking issue. Vagrant will force halt, if player1: capable. ==> player1: Attempting direct shutdown of domain... Fixes: 0a8de36 ("tcp: no longer abort SYN_SENT when receiving some ICMP") Closes: https://lore.kernel.org/all/MN2PR12MB44863139E562A59329E89DBEB982A@MN2PR12MB4486.namprd12.prod.outlook.com Signed-off-by: Shachar Kagan <skagan@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/14459261ea9f9c7d7dfb28eb004ce8734fa83ade.1704185904.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3fbf612 commit b59db45

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

net/ipv4/tcp_ipv4.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
482482
const int code = icmp_hdr(skb)->code;
483483
struct sock *sk;
484484
struct request_sock *fastopen;
485-
bool harderr = false;
486485
u32 seq, snd_una;
487486
int err;
488487
struct net *net = dev_net(skb->dev);
@@ -556,7 +555,6 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
556555
goto out;
557556
case ICMP_PARAMETERPROB:
558557
err = EPROTO;
559-
harderr = true;
560558
break;
561559
case ICMP_DEST_UNREACH:
562560
if (code > NR_ICMP_UNREACH)
@@ -581,7 +579,6 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
581579
}
582580

583581
err = icmp_err_convert[code].errno;
584-
harderr = icmp_err_convert[code].fatal;
585582
/* check if this ICMP message allows revert of backoff.
586583
* (see RFC 6069)
587584
*/
@@ -607,9 +604,6 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
607604

608605
ip_icmp_error(sk, skb, err, th->dest, info, (u8 *)th);
609606

610-
if (!harderr)
611-
break;
612-
613607
if (!sock_owned_by_user(sk)) {
614608
WRITE_ONCE(sk->sk_err, err);
615609

net/ipv6/tcp_ipv6.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
381381
struct tcp_sock *tp;
382382
__u32 seq, snd_una;
383383
struct sock *sk;
384-
bool harderr;
384+
bool fatal;
385385
int err;
386386

387387
sk = __inet6_lookup_established(net, net->ipv4.tcp_death_row.hashinfo,
@@ -402,9 +402,9 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
402402
return 0;
403403
}
404404
seq = ntohl(th->seq);
405-
harderr = icmpv6_err_convert(type, code, &err);
405+
fatal = icmpv6_err_convert(type, code, &err);
406406
if (sk->sk_state == TCP_NEW_SYN_RECV) {
407-
tcp_req_err(sk, seq, harderr);
407+
tcp_req_err(sk, seq, fatal);
408408
return 0;
409409
}
410410

@@ -489,9 +489,6 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
489489

490490
ipv6_icmp_error(sk, skb, err, th->dest, ntohl(info), (u8 *)th);
491491

492-
if (!harderr)
493-
break;
494-
495492
if (!sock_owned_by_user(sk)) {
496493
WRITE_ONCE(sk->sk_err, err);
497494
sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */

0 commit comments

Comments
 (0)