From patchwork Thu May 9 13:13:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 13659734 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 714136E60E for ; Thu, 9 May 2024 13:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260403; cv=none; b=SRBogDrNNPw6gBiLw3Cc7qnQ8o3SdgBsJ9BRnKl1XAuSLEKHquUcfbZhadUQK602hwJxzJmR5ykwO+FebUISqCjz0BeU9ubFNZmrv+G8Bpa5FEdUXB9ldBCclrw6ah9qiIpVTaNUdz17rLQGUbX+tpZ8++mHoYfaY/QorSdG+2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260403; c=relaxed/simple; bh=OrfoT4YOwRlve6mV0AW69N1v9S7JlhMBl+7xYefdoZ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Xc1weI2JDuwqsDemazdl2Yi+EOE65dpNdA9AaPq9j/IzV9fX/dpONWR0pQC6X99LRlm5XXyTF0ziriyQcL2MS/u17p3oun5Sffg+MQhUwjvzkG2US5Msg9sjYFAsVgFUp+LITHUBtuxB2hGrGHCjDGmJBcZ0WqwWxrcbDat7kwo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ma1I1l7a; arc=none smtp.client-ip=209.85.166.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ma1I1l7a" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-36c67760b1aso3760395ab.1 for ; Thu, 09 May 2024 06:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715260399; x=1715865199; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dq4Oif0buUnA9JqMotGU1jFbPA8b2GKc51i6wlfOjfg=; b=ma1I1l7aYTzVmkyIl4hMjOZxuNGMxeYZr9D2Mb/iKgpJZVs3YjWUrTLP8HuScLtv0e zTf1NfVIJA/LLbtzVbh5LTn0th0tBtUNrWjH60fhwkg5xzXc5ACIFEEDUyEgsFafZKhY zPL0BcvfKobPVDcqRji+2a/ilQPeSvMhblr8v2/d2diJP+XfvQLpG8fxYJxdYS4UQGGY mXX/Yl8kGcc2FGtTVT/V0RPN6k/ZuwQe3xBu2ttRbl0W0Krc/wnrJelQsS8fdpQQCkjD h51C5QuA5yiw1MtvNKNv8LTKsdJ7MmAg4O6s/jjqDO7fGX/iuNK1g9GOFMiKn2Am3ew1 2U/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715260399; x=1715865199; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dq4Oif0buUnA9JqMotGU1jFbPA8b2GKc51i6wlfOjfg=; b=h24YKbhNT66ihG1BjUL7dUirmCS3QqKEEHRM3o2IEwn8y/u/IEwMDf0jWoNmFNd+c/ +Aipam/0Nt8LsfcBzU+UoilNb6syTlauReblV0XhbHEruqnZHsmIg9Nnxh5YK2LDTD23 AStzXL9EuzB/SgB9mXHBf/TR2IBeIVtOBzAZX2RZmLhYcFqTASRZiOfKsQC+6zIaVJ5W enlt9pzubDN3b4uwLiETTG8HbrLFG48c3Wta92SE78Lb1QXNxuxyjGo49yDGV44tBvPi QFMp6zW94PObWfPZVaVkTCBSTo02c/eEETyYy/idCc2MZxoljEXOHQi0YjQhZEFZlGYb MzfA== X-Gm-Message-State: AOJu0YwMnkfxACIFMe+zvQ9emKU7samg5BUtfwDpQ1AQo8TlAFOECMe1 62Ci0CjDAUgBe1vaIdoJUFLkrJvwa9YegIQ/bR0/P1u8Tk2jIOa2 X-Google-Smtp-Source: AGHT+IFkXlK5Fw9HqxHXuwWt+eSGe976Aw5wYsCuo/AKR/LYYoSJoqyGI+6ifYHVIeoDtfAVeDPjYQ== X-Received: by 2002:a05:6e02:168a:b0:36b:f940:ef89 with SMTP id e9e14a558f8ab-36caebb9100mr62397845ab.13.1715260399438; Thu, 09 May 2024 06:13:19 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([114.253.33.22]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-63411346eebsm1133887a12.84.2024.05.09.06.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 06:13:18 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next 1/5] tcp: fully support sk reset reasons in tcp_rcv_synsent_state_process() Date: Thu, 9 May 2024 21:13:02 +0800 Message-Id: <20240509131306.92931-2-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240509131306.92931-1-kerneljasonxing@gmail.com> References: <20240509131306.92931-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Jason Xing In this function, only updating the map can finish the job for socket reset reason because the corresponding drop reasons are ready. Signed-off-by: Jason Xing --- include/net/rstreason.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/net/rstreason.h b/include/net/rstreason.h index df3b6ac0c9b3..f87814a60205 100644 --- a/include/net/rstreason.h +++ b/include/net/rstreason.h @@ -8,6 +8,8 @@ #define DEFINE_RST_REASON(FN, FNe) \ FN(NOT_SPECIFIED) \ FN(NO_SOCKET) \ + FN(TCP_INVALID_ACK_SEQUENCE) \ + FN(TCP_RFC7323_PAWS) \ FN(MPTCP_RST_EUNSPEC) \ FN(MPTCP_RST_EMPTCP) \ FN(MPTCP_RST_ERESOURCE) \ @@ -37,6 +39,17 @@ enum sk_rst_reason { SK_RST_REASON_NOT_SPECIFIED, /** @SK_RST_REASON_NO_SOCKET: no valid socket that can be used */ SK_RST_REASON_NO_SOCKET, + /** + * @SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE: Not acceptable ACK SEQ + * field because ack sequence is not in the window between snd_una + * and snd_nxt + */ + SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE, + /** + * @SK_RST_REASON_TCP_RFC7323_PAWS: PAWS check, corresponding to + * LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED + */ + SK_RST_REASON_TCP_RFC7323_PAWS, /* Copy from include/uapi/linux/mptcp.h. * These reset fields will not be changed since they adhere to @@ -113,6 +126,10 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason) return SK_RST_REASON_NOT_SPECIFIED; case SKB_DROP_REASON_NO_SOCKET: return SK_RST_REASON_NO_SOCKET; + case SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE: + return SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE; + case SKB_DROP_REASON_TCP_RFC7323_PAWS: + return SK_RST_REASON_TCP_RFC7323_PAWS; default: /* If we don't have our own corresponding reason */ return SK_RST_REASON_NOT_SPECIFIED; From patchwork Thu May 9 13:13:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 13659735 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B0C715278A for ; Thu, 9 May 2024 13:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260406; cv=none; b=TgOZtjUTQVgp7Vouv89vkWhJb+MvUoRroR351dfwptYVTgHqyW6j+Ceix3xLz11nQiBiL8C7IhRqlGzpUsK6TlQ+2plhbMiTQkpoay2J906cQadWnzo+TLoXEYwvt/yf9Ic6fIQcfU8XdecZtkrjqpToUu951UHT1z9XaqGyuVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260406; c=relaxed/simple; bh=4Y5hE0JqjQhTWgaMvWIe+OKRtT7jhIwikn5Xh1NZ+u0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U3ZFz39zQxqPdtF29ohtWjdUQ41tSGhMBZ0A98OnGstXntZZA08aLqrq1k3YtjAIIrbcO8IfFPRL+oBYsZsa9XjQRvTFOdwI82jgzJBmVH0u72eapfOIlIXBv8agqASVV/bYdqqMUEc3hr+ThFThF5HiVdfz3Nmz7lQe2xkrrJ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ECTG80lB; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ECTG80lB" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6f460e05101so635824b3a.1 for ; Thu, 09 May 2024 06:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715260404; x=1715865204; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=etxF8fofAFwmXuwTGyWBEzPHeQxHlfGOewcxQZxNiGs=; b=ECTG80lBAxlkqX1YzPU7hsdqWmNXJSGrdLOdNS6YF9aO9yK8SV7VHFQ4RVprOZwiCN ohrjEm6FgFwk6FZWFiSqmYX32a94o45sVa5OaWlW9FZj2FzVXxwjWj+IMoJBBakfDDMH rOH+JcnxWgVG7j9ENhKC0K5moia3mOqpkHHZQPUh1tzfuE7smv6epWIWRX69fWnMnDl1 sbqrb7nvchOHJNF1eVDn+/Q+Xs6YJhKeNy8EocvAMWmRoM45rzezO1MA4S8uXWpoSnhe 5wrcs7cG7EJdREIJoJqwKJtRmI0n9UBcO3T2G7ygUh6kQSyBEvgGC7ViJlYXEtvRk3Gn Trqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715260404; x=1715865204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=etxF8fofAFwmXuwTGyWBEzPHeQxHlfGOewcxQZxNiGs=; b=wSCEctVePot8uBNN/YANpnEOhbo6sibaV1BCpnjLyK7tEkv6i6NfgTUbLRlFS+eero C0UjVXYxLhXiEF45hHanKOMIcj4JTjkuYsb5hszXPUyGc83gn9qfCDpqBzf7lPM0S/iL dfB30pR0oSSR9DlXOOigAsi+Nu3X/DAmotyl1OaZTiua+CSYIXLCRMvKF7byzQXiJ7mr SebUlXt8qBKKuq9FPf3Zbn1Nq5MSIgYz3Ik7t4QpNjEN9FMNrEhVx5qbXSbOtS9lHQKI jBhnTuLqfl/I5cd2nvhI9kJnV7LNU3AOnuIwi8O6R+S0ql56ttD7XPUXA9hhw7c0MYMo r8VQ== X-Gm-Message-State: AOJu0YxgFXBR6bPyKnmgbkERCxyXC8QF5ptwCtZzWdwYyMif5MMqJ/Ga 0EZF4yDg6mGqrXr3eKLzQwTxt2hcKv8RjQOGNZiiF6SvFI5p0WmOcOgBvCjN X-Google-Smtp-Source: AGHT+IFMiHdvHcDPDC66KQvx0qwMb4abf7o18W9wg7EO6rhbxOwucL1PKBd9zuc7Trxa+DV3LbLb9w== X-Received: by 2002:a05:6a20:6a2b:b0:1af:af86:ce47 with SMTP id adf61e73a8af0-1afd1444bb2mr4229257637.14.1715260403817; Thu, 09 May 2024 06:13:23 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([114.253.33.22]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-63411346eebsm1133887a12.84.2024.05.09.06.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 06:13:23 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next 2/5] tcp: fully support sk reset reason in tcp_ack() Date: Thu, 9 May 2024 21:13:03 +0800 Message-Id: <20240509131306.92931-3-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240509131306.92931-1-kerneljasonxing@gmail.com> References: <20240509131306.92931-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Jason Xing Based on the existing skb drop reason, updating the rstreason map can help us finish the rstreason job in this function. Signed-off-by: Jason Xing --- include/net/rstreason.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/net/rstreason.h b/include/net/rstreason.h index f87814a60205..a32b0fa17de2 100644 --- a/include/net/rstreason.h +++ b/include/net/rstreason.h @@ -10,6 +10,8 @@ FN(NO_SOCKET) \ FN(TCP_INVALID_ACK_SEQUENCE) \ FN(TCP_RFC7323_PAWS) \ + FN(TCP_TOO_OLD_ACK) \ + FN(TCP_ACK_UNSENT_DATA) \ FN(MPTCP_RST_EUNSPEC) \ FN(MPTCP_RST_EMPTCP) \ FN(MPTCP_RST_ERESOURCE) \ @@ -50,6 +52,10 @@ enum sk_rst_reason { * LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED */ SK_RST_REASON_TCP_RFC7323_PAWS, + /** @SK_RST_REASON_TCP_TOO_OLD_ACK: TCP ACK is too old */ + SK_RST_REASON_TCP_TOO_OLD_ACK, + /** @SK_RST_REASON_TCP_ACK_UNSENT_DATA */ + SK_RST_REASON_TCP_ACK_UNSENT_DATA, /* Copy from include/uapi/linux/mptcp.h. * These reset fields will not be changed since they adhere to @@ -130,6 +136,10 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason) return SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE; case SKB_DROP_REASON_TCP_RFC7323_PAWS: return SK_RST_REASON_TCP_RFC7323_PAWS; + case SKB_DROP_REASON_TCP_TOO_OLD_ACK: + return SK_RST_REASON_TCP_TOO_OLD_ACK; + case SKB_DROP_REASON_TCP_ACK_UNSENT_DATA: + return SK_RST_REASON_TCP_ACK_UNSENT_DATA; default: /* If we don't have our own corresponding reason */ return SK_RST_REASON_NOT_SPECIFIED; From patchwork Thu May 9 13:13:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 13659736 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2DDE15250D for ; Thu, 9 May 2024 13:13:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260410; cv=none; b=mYVpsfC+ASj+JcN2ZCE3xQGtjsoJRX5w0WNHlc8iZlq8H7fz2N2jUQZOij+R99fgfy+3v9WmW555baiBAEmebRXo3GyMCTUDJC4wn8SMEozKnJB+moX5dkB+nR2kMFzNFOB3r6gW64Zvw2zoL0r45hisNXXknul5e2NvFRCDEAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260410; c=relaxed/simple; bh=SLFZJ3lLmiYwe2AItyvfBVa6JDmROE9yr2ZOeMperEA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qQGjmt+FyOPkykC9dgykrkFnBxA0pAJVt+eAMr5IyUnRA4brHWaGHPJyRScb2EDDCjgYVcdFwPeycUX7i2LdA5OAR6C9MMAmkyrbY1MeVkFZCWD35k78d66eIQ/aHD22JoKm+7xe2sxs8m3IZKH8kQ0f5L1OEYc1XWW/6l27bFE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SYx1uF8t; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SYx1uF8t" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6f460e05101so635912b3a.1 for ; Thu, 09 May 2024 06:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715260408; x=1715865208; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fwUa7uvnucrEZQF/v2D/40AfjpobsUJHNZ1U22Qj0zc=; b=SYx1uF8t9d87FrBLuCs6J+4hWA+tgfvOCTnWg6clUbTJ6rZXbMKnHdKPTu0NDuw7lw PYXS/M+IVxVo9FgG6lEzhqsY1FWWPTBvuUBRIAEN07DIMc5ZNA6ioXk1Y1rWbVFo3LF6 OBiXvVliamXmS+r3ADCXCRuNOc76eVEdTHSBB1oHyFqvdpzh/bMxTXWdtv7LKGkY5Rbr RrtC2TlVsSFAMofgXgmiMjF2Z0F4UbvUUdPPwbRihnQQHn91eLEMObGOw7IAgKJs9BbI 62NuOjxHV1ldDVq8vqh8NwvttZ+ITtdSmE11uVAiDYXw+npVpEbs3zZI1krzlwj7RPe4 KqcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715260408; x=1715865208; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fwUa7uvnucrEZQF/v2D/40AfjpobsUJHNZ1U22Qj0zc=; b=DClc7SoHQxy18UojTggDG3M14RVg/pl1rZASeDkUo2xVgRu9CWZaGNlJePikXUPBki k+18YmKnD9yySKWI5OCMHSJSlv16OwAQFCoMPSOQbiWCr3S1N6r3HzDSPnWKXYszqpcv wh2tIZ+BIS1ncyGTKVLEiSBJtQq7p1D+m/jK0e28laQUY5lws2cDtcxPVeLydi8cbJ0p mv0vODk7J+YzFuUceFG0R4qt+kbLFX0uDtT3PEkuBeCHq4BqV6gIgE408Y7sEGCYyqRW Y4cHolmq1N7yUSQU0Wi3EAA6ae8FHkE31+CUoe/V81eQaNOtn/8m4vuMi3fyZso2jI70 q34A== X-Gm-Message-State: AOJu0Yxg0JHpl8sAV65DeA+ehYe+ncsILB4ZpECtolv036l2/TF/A2L3 LLQM0lZND1UuZAoDlmEjdHV6ltmPP0Jny0Opd45ErCMk7u7EOWrS X-Google-Smtp-Source: AGHT+IFPivDf1gorK+yiL8o40bp6ds0WHD8e3yxqe4LCEG562L21koPNkNXJiWv+1+pZIgaEDNIj8Q== X-Received: by 2002:a05:6a20:9783:b0:1ae:4266:b39c with SMTP id adf61e73a8af0-1afd1444f67mr3457143637.17.1715260408183; Thu, 09 May 2024 06:13:28 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([114.253.33.22]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-63411346eebsm1133887a12.84.2024.05.09.06.13.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 06:13:27 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next 3/5] tcp: fully support sk reset reason in tcp_rcv_state_process() Date: Thu, 9 May 2024 21:13:04 +0800 Message-Id: <20240509131306.92931-4-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240509131306.92931-1-kerneljasonxing@gmail.com> References: <20240509131306.92931-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Jason Xing Like the previous patch does in this series, finish the conversion map is enough to let rstreason mechanism work in this function. Signed-off-by: Jason Xing --- include/net/rstreason.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/net/rstreason.h b/include/net/rstreason.h index a32b0fa17de2..61855d4b27e2 100644 --- a/include/net/rstreason.h +++ b/include/net/rstreason.h @@ -12,6 +12,9 @@ FN(TCP_RFC7323_PAWS) \ FN(TCP_TOO_OLD_ACK) \ FN(TCP_ACK_UNSENT_DATA) \ + FN(TCP_FLAGS) \ + FN(TCP_OLD_ACK) \ + FN(TCP_ABORT_ON_DATA) \ FN(MPTCP_RST_EUNSPEC) \ FN(MPTCP_RST_EMPTCP) \ FN(MPTCP_RST_ERESOURCE) \ @@ -56,6 +59,15 @@ enum sk_rst_reason { SK_RST_REASON_TCP_TOO_OLD_ACK, /** @SK_RST_REASON_TCP_ACK_UNSENT_DATA */ SK_RST_REASON_TCP_ACK_UNSENT_DATA, + /** @SK_RST_REASON_TCP_FLAGS: TCP flags invalid */ + SK_RST_REASON_TCP_FLAGS, + /** @SK_RST_REASON_TCP_OLD_ACK: TCP ACK is old, but in window */ + SK_RST_REASON_TCP_OLD_ACK, + /** + * @SK_RST_REASON_TCP_ABORT_ON_DATA: abort on data + * corresponding to LINUX_MIB_TCPABORTONDATA + */ + SK_RST_REASON_TCP_ABORT_ON_DATA, /* Copy from include/uapi/linux/mptcp.h. * These reset fields will not be changed since they adhere to @@ -140,6 +152,12 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason) return SK_RST_REASON_TCP_TOO_OLD_ACK; case SKB_DROP_REASON_TCP_ACK_UNSENT_DATA: return SK_RST_REASON_TCP_ACK_UNSENT_DATA; + case SKB_DROP_REASON_TCP_FLAGS: + return SK_RST_REASON_TCP_FLAGS; + case SKB_DROP_REASON_TCP_OLD_ACK: + return SK_RST_REASON_TCP_OLD_ACK; + case SKB_DROP_REASON_TCP_ABORT_ON_DATA: + return SK_RST_REASON_TCP_ABORT_ON_DATA; default: /* If we don't have our own corresponding reason */ return SK_RST_REASON_NOT_SPECIFIED; From patchwork Thu May 9 13:13:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 13659737 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C98E06E60E for ; Thu, 9 May 2024 13:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260415; cv=none; b=QvDZeYREUAuU9WjMzWed67JO05rFyj4FnqD4rKbBjGglV6darhIfKZcyzkO1E0cRlTx6wQncylrKAVwTqF0QC+jfeSMW8+geKOjhVibmJ+Ir15UyErB3LNJIw11h5oseBZTNZAjI1y1oucAdeIY7hhfJlS2HmdOOSC8TRx+0MtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260415; c=relaxed/simple; bh=knq2CZJ/lIONxBGqA6bIZQPooOdPRX2qxDdFxQ3HazA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pgArNAROG10a4JQo9P/RJA5vVZb0dOMYpcQjN98+4LB3gzh66WAr3TxzwhVBuZIA95WzZddAhAXrxOLh7pm4iDrZ9pgHnGOyTcC+FRN4oKG2d2X+hMC6WhuAJr8tcKchX82dzvnf+fuOjaDa0lQTIf0+K5WBrGBvQqp0W2e7NKM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bmkwwJkR; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bmkwwJkR" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5ac8c73cf88so475107eaf.2 for ; Thu, 09 May 2024 06:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715260413; x=1715865213; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+ALCVOOSj+rqcdr8A1Z1U7kRca9PY4A8EpwP1XC8Nrw=; b=bmkwwJkRehWgPvdrQqgVRwQh91qvrbGyO4+nQWqiAwDZfmkJ8f3NCDci8iKGCagInb 4mcjAMX8AA6nwa9YwwCvbHCmAUnM908KhrsakCJ8T+HUlQPRvIS1mZnMHecbyv8g5wTT /fPJeTq+mIErVsu/Ul2/qJ4D7imbznStpLV7/S/gh3vhFysZgOYIFW+WKaSrX7DiZW99 R7s6BQhyZRxHZXdJj5D27GHm0TjviOYa30L/IavAwahfJITrFjQSTr0PYTcyhtMSQQF8 55koabfL/O7sD4OQ4coo6WQ9umpe9OyFS8VMgNZmOblhzIJcquxdFv7Tuyd2U3lCt6of cFPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715260413; x=1715865213; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+ALCVOOSj+rqcdr8A1Z1U7kRca9PY4A8EpwP1XC8Nrw=; b=s375Fz4/NRPPbXSn3XaKEk6BXaeCA+Td7gK/gyDr2jSGWTnCQwF9xH6WC+7XPJXmTR MgwCmQHpcPHUooElKJfGaluYPunR338JGVeZhl8Xb5vpV0dajzUwxMkK4+lPFs65jzQP T+IlmfXEwOZXI5uJT7NW9TQlmf1Xzk4wq/u6I1LTnG1KJ9UhHJgt7Qqw1u7rc68qDAsH 5mF8trytb8tgXMnWQQqZl46okkpq8wtuaYYAyl1dT7V4b046EtLH3nz7bSqd1jbr37fp YnSXNR7mCDYRdriVftYLRweOa8dbiR9HR0tOBqunZ91whGLZ8mVEa78m8V/xhGAStcXT x8Dw== X-Gm-Message-State: AOJu0YyRf13IiW6fYqstgdeECtq2xd4ynbtgXRK71h/TAXWV7krm5REQ uPHB3Gnt1NXj2lcVWWaimlZ+6YPwJViDSVnECFGrpBxvRWRuhPrq X-Google-Smtp-Source: AGHT+IGNhto5HWdEdUYmo6+zaYBWdeiplH+2dvFbY/piRJSSz2bRta1MvFUx/cB2zqGLjEVR5vddaQ== X-Received: by 2002:a05:6358:910c:b0:18a:8e58:b992 with SMTP id e5c5f4694b2df-192d396f526mr674015555d.28.1715260412712; Thu, 09 May 2024 06:13:32 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([114.253.33.22]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-63411346eebsm1133887a12.84.2024.05.09.06.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 06:13:32 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next 4/5] tcp: handle timewait cases in rstreason logic Date: Thu, 9 May 2024 21:13:05 +0800 Message-Id: <20240509131306.92931-5-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240509131306.92931-1-kerneljasonxing@gmail.com> References: <20240509131306.92931-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Jason Xing There are two possible cases where TCP layer can send an RST. Since they happen in the same place, I think using one independent reason is enough to identify this special situation. Signed-off-by: Jason Xing --- include/net/rstreason.h | 5 +++++ net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/net/rstreason.h b/include/net/rstreason.h index 61855d4b27e2..62e869089da4 100644 --- a/include/net/rstreason.h +++ b/include/net/rstreason.h @@ -15,6 +15,7 @@ FN(TCP_FLAGS) \ FN(TCP_OLD_ACK) \ FN(TCP_ABORT_ON_DATA) \ + FN(TCP_TIMEWAIT_SOCKET) \ FN(MPTCP_RST_EUNSPEC) \ FN(MPTCP_RST_EMPTCP) \ FN(MPTCP_RST_ERESOURCE) \ @@ -69,6 +70,10 @@ enum sk_rst_reason { */ SK_RST_REASON_TCP_ABORT_ON_DATA, + /* Here start with the independent reasons */ + /** @SK_RST_REASON_TCP_TIMEWAIT_SOCKET: happen on the timewait socket */ + SK_RST_REASON_TCP_TIMEWAIT_SOCKET, + /* Copy from include/uapi/linux/mptcp.h. * These reset fields will not be changed since they adhere to * RFC 8684. So do not touch them. I'm going to list each definition diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 0427deca3e0e..d35cdb77d7b5 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2421,7 +2421,7 @@ int tcp_v4_rcv(struct sk_buff *skb) tcp_v4_timewait_ack(sk, skb); break; case TCP_TW_RST: - tcp_v4_send_reset(sk, skb, sk_rst_convert_drop_reason(drop_reason)); + tcp_v4_send_reset(sk, skb, SK_RST_REASON_TCP_TIMEWAIT_SOCKET); inet_twsk_deschedule_put(inet_twsk(sk)); goto discard_it; case TCP_TW_SUCCESS:; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 37201c4fb393..bee26b961835 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1999,7 +1999,7 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) tcp_v6_timewait_ack(sk, skb); break; case TCP_TW_RST: - tcp_v6_send_reset(sk, skb, sk_rst_convert_drop_reason(drop_reason)); + tcp_v6_send_reset(sk, skb, SK_RST_REASON_TCP_TIMEWAIT_SOCKET); inet_twsk_deschedule_put(inet_twsk(sk)); goto discard_it; case TCP_TW_SUCCESS: From patchwork Thu May 9 13:13:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 13659738 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C4A21514D8 for ; Thu, 9 May 2024 13:13:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260419; cv=none; b=oHf5AvDkDa6xD8/xvfHBT/Bo1zXgiZyozwHLEXYU4iI2rH6dm8K3QIpGgLWADmv4w4/as7EsVHB2R46yhw4BvP4gc/h3objJE9NXzO3/QLWjMaD9z25d3zDOxtpsJooNBovCItiahsfgGQ4H7/3VXaxHWQ4yrcqladGZoGcnzKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715260419; c=relaxed/simple; bh=2rvYE6PluPzfpmoCmQHw0C2gV+bsXw+3M14T1fkC7KI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AU9PMZ2CqKSSD9KsYSQGdAnIrbv6Srsi7LbNFlHFDKckt3WSnrhElb8j32h7c2C10aZvOpy0KYsAM/mUri2ZuSugID8PFt/XDPdtpqJnUVQjj2ml6W2sCedUJ581ysZkNWzjFqDduDhIHhtk3TtMJqav/VolnFJc8+HvsQjR//I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lulL7ZGx; arc=none smtp.client-ip=209.85.166.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lulL7ZGx" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-36c5d26045bso3908925ab.0 for ; Thu, 09 May 2024 06:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715260417; x=1715865217; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e3w8I4AS7qJEwhuYtp9u5CkKL+sAa1rhMt6gkPETXNo=; b=lulL7ZGxnvWsYzBXTQ+GSLUOjz5YeQjDCTWGyP4wjF6SA21yW9aPP+AH653PH/wr3V s6FWwkH3tLJWJRrU99MQXrgWaRDIt5IR/aPQpN0+acVHQULmJjW/rshCF6Nu5en9GWLV eOfH3EBZ8nvHVdFML4Tbl7+AZmeEuDZr5ymsvFopCFAPqGV5nzUYNiDZPUVwbRxR7jjK SGPThjMKFKSaVCsgAztQJ+1jcM6HwioaXo2QbVLmoB+di5Zsw1rsTeTPl1+vktG1LLgr eEBvQ71wfsC1HbEIyaPqWuzdDEC/PNiaHW8TPlxSlbr6tqxlfN3fccthi0v4gLCMppe3 5yDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715260417; x=1715865217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e3w8I4AS7qJEwhuYtp9u5CkKL+sAa1rhMt6gkPETXNo=; b=Q+BdZItJ6d2sNbQnEMFvJdxA+/46CKzWXESG0mIXuECFBzidRQgJ9GThCNWkk/anrs ePhWCfDbei0ZcBY+585+UFIo6dcL+zNeHytBKfsX4Ey61di+ATbfus7v3H8HY0A93LcR ihhXmBpbJVhxEtDdQfYUXcQ8Ip+du6K3zJbDvLXgC029pNPOaSl1P/8v6bGZTrNlP2Ur Wq+ZBhIKKond/qeycK/5zCZtBhy1qUCWR6RmI7J8AScuf3uyEZWY6GcrHHP0jRNYA2s4 Y29r5ViUvMZWwmbNbtoJ9U2m/QU0ASD4afhMy38VZ+cXGh4LgmuRzGinuX83NphDm81q hyyw== X-Gm-Message-State: AOJu0Yzm1mvdHqO9/84ZRjV0Ct/8eS+DdsvcNdW1O/U4tu8y/a54Blkk XWbJQxq394jdlIIcxkjE/FZqjtVufq70MfEGDSxMZdW07eprRiTK X-Google-Smtp-Source: AGHT+IHFLrvi0HzuSZGQukH+2xhiJKv3lPgoYz/at6fwi9g4ByafHcNI7AjPORk2D0jwlvkzz+eawA== X-Received: by 2002:a05:6e02:1d16:b0:36c:51bf:8796 with SMTP id e9e14a558f8ab-36caeba74b5mr62691655ab.1.1715260417102; Thu, 09 May 2024 06:13:37 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([114.253.33.22]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-63411346eebsm1133887a12.84.2024.05.09.06.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 06:13:36 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next 5/5] tcp: handle rstreason in tcp_check_req() Date: Thu, 9 May 2024 21:13:06 +0800 Message-Id: <20240509131306.92931-6-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240509131306.92931-1-kerneljasonxing@gmail.com> References: <20240509131306.92931-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Jason Xing We're going to send an RST due to invalid syn packet which is already checked whether 1) it is in sequence, 2) it is a retransmitted skb. As RFC 793 says, if the state of socket is not CLOSED/LISTEN/SYN-SENT, then we should send an RST when receiving bad syn packet: "fourth, check the SYN bit,...If the SYN is in the window it is an error, send a reset" Signed-off-by: Jason Xing --- include/net/rstreason.h | 8 ++++++++ net/ipv4/tcp_minisocks.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/net/rstreason.h b/include/net/rstreason.h index 62e869089da4..bfea05ff8d88 100644 --- a/include/net/rstreason.h +++ b/include/net/rstreason.h @@ -16,6 +16,7 @@ FN(TCP_OLD_ACK) \ FN(TCP_ABORT_ON_DATA) \ FN(TCP_TIMEWAIT_SOCKET) \ + FN(INVALID_SYN) \ FN(MPTCP_RST_EUNSPEC) \ FN(MPTCP_RST_EMPTCP) \ FN(MPTCP_RST_ERESOURCE) \ @@ -73,6 +74,13 @@ enum sk_rst_reason { /* Here start with the independent reasons */ /** @SK_RST_REASON_TCP_TIMEWAIT_SOCKET: happen on the timewait socket */ SK_RST_REASON_TCP_TIMEWAIT_SOCKET, + /** + * @SK_RST_REASON_INVALID_SYN: receive bad syn packet + * RFC 793 says if the state is not CLOSED/LISTEN/SYN-SENT then + * "fourth, check the SYN bit,...If the SYN is in the window it is + * an error, send a reset" + */ + SK_RST_REASON_INVALID_SYN, /* Copy from include/uapi/linux/mptcp.h. * These reset fields will not be changed since they adhere to diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 7d543569a180..b93619b2384b 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -879,7 +879,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, * avoid becoming vulnerable to outside attack aiming at * resetting legit local connections. */ - req->rsk_ops->send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); + req->rsk_ops->send_reset(sk, skb, SK_RST_REASON_INVALID_SYN); } else if (fastopen) { /* received a valid RST pkt */ reqsk_fastopen_remove(sk, req, true); tcp_reset(sk, skb);